I'd like to set up the recurring payment via Google Pay on my backend. My gateway provider is Adyen. I already implemented working solution for 1-time payments. Google Pay documentation is clear about that.
However, what I can't seem to find is a way to implement the request for a recurring payments. Eg. what JSON to send to Google Pay to retrieve a "special" token for recurring payments. Or at least that was my thinking that there is a special token for that.
I checked adyen docs, but there is nothing on how to implement this on Google Pay side.
I read this and this here on SO, but I am stil not more clever on what I have to actually send to Google Pay.
TLDR: Do I create payment request for $0 and use the returned token with adyen for subsequent recurring payments? Or is there something more special for recurring payments to work?
Making recurring payments with GooglePay (and other payment methods) involves 3 steps:
/payments
endpoint./payments
endpoint, however this is not always possible. See the details here.paymentMethod.storedPaymentMethodId
field {
"amount":{
"value":2000,
"currency":"USD"
},
"paymentMethod":{
"type":"googlepay",
"storedPaymentMethodId":"M5N7TQ4TG5PFWR50"
},
"reference":"YOUR_ORDER_REFERENCE",
"shopperInteraction": "ContAuth",
"recurringProcessingModel": "Subscription",
"merchantAccount":"YOUR_MERCHANT_ACCOUNT",
"shopperReference":"YOUR_SHOPPER_REFERENCE"
}
Make sure the shopperReference
is unique per shopper and it is the same one used in the request to create the token.