Airwallex logo
Airwallex logo

Registered user checkout

Subscription payments

Airwallex allows you to create a PaymentConsent with the shopper to initiate future payments using shopper's saved payments details. For more information, see Save payment details for future payments. You need to add additional information about the order & terms of the payment to display this information on the payment sheet.

1. See below example to understand how to setup recurring with Google Pay without payment

JSON
1createElement("googlePayButton",{
2 "mode": "recurring",
3 "client_secret": "xxx",
4 "countryCode": "CN",
5 "merchantInfo": {
6 "merchantName": "Airwallex",
7 },
8 "customer_id": 'your customer id',
9 "amount": {
10 value: '0', // if the intent_id is passed, it should be the intent amount.
11 currency: 'USD',
12 },
13 "displayItems":[{
14 label: "monthly"
15 price: "1"
16 status: "FINAL"
17 type: "LINE_ITEM"
18 }],
19 "totalPriceLabel": "Pay now",
20 "buttonType": "subscribe",
21})

2. See below example to understand how to setup recurring with Google Pay with payment

JSON
1createElement("googlePayButton",{
2 "mode": "recurring",
3 "client_secret": "xxx",
4 "intent_id": 'xxx',
5 "countryCode": "CN",
6 "merchantInfo": {
7 "merchantName": "Airwallex",
8 },
9 "customer_id": 'your customer id',
10 "amount": {
11 value: '20',
12 currency: 'USD',
13 },
14 "displayItems":[{
15 label: "monthly"
16 price: "1"
17 status: "FINAL"
18 type: "LINE_ITEM"
19 }],
20 "totalPriceLabel": "Pay now",
21 "buttonType": "subscribe",
22})
Was this page helpful?