Search...
Log inGet started
Airwallex logo
Home
Core API
Payments
Transactional FX
Payouts
Issuing
Back to home
OverviewChoose your payments solutionGet started with payments
Online payments
Online payments overviewGet started with online paymentsHosted Payment Page
Drop-in Element
Embedded Elements
Card Element
Split Card Element
Full Featured Card Element
Redirect Element
Guest user checkoutRegistered user checkout
QR Code Element
Mobile SDK
Plugins
Native API
Automatic Currency Conversion
Invoice integrations

Registered user checkout

This implementation applies to Redirect Element and QR Code Element.

Redirect Element and QR Code Element integrations allow you to save payment details for future payments. To save payment details, Airwallex allows you to create a PaymentConsent, which represents the consent between you and the shopper to use the shopper’s saved payment method for future payments. You can use the PaymentConsent to initiate scheduled (recurring) or unscheduled (one-time) payments without the shopper involved.

Supported payment methods include:

  • Redirect: Alipay, AlipayHK, Gcash, Dana, KakaoPay, Touch ‘n Go
  • QR Code: AlipayHK, KakaoPay

Before you begin

Before you implement the integration, consider the following:

Save payment details for the first time

You can choose to create and verify a PaymentConsent without an initial payment and charge the shopper later. This is helpful if you want to first onboard a shopper, save their payments details, and then initiate payments (recurring or one-time) in the future without the shopper involved.

Step 1: Create a Customer

To set a card up for future payments, you must first store the card on a Customer object. Create a Customer object using Create a Customer API API when your shopper creates an account with your business. You can also store name, email and other details on the Customer. The response will contain a unique id for the shopper and also the client_secret. Save the client_secret for later.

Step 2: Generate a client secret for the Customer

Provide the Customer id in Generate a client secret for a Customer API API and save the returned client_secret

Step 3: Create a PaymentConsent

Create a checkout page with Redirect/QR code Element to collect payment details by passing the following fields in createElement( ):

  • client_secret from Step 2
  • currency
  • method (Redirect Element) or qrcodeMethod (QR Code Element)
  • customer_id: The id of the Customer for whom the PaymentConsent is created.
  • mode: Set this to recurring

By default, next_triggered_by is set to merchant.

When the shopper completes the authorization, Airwallex verifies the PaymentConsent and attaches the payment details (in a PaymentMethod object) to the provided Customer. You will receive payment_consent.verified event via webhook notifications, and you can use the returned unique PaymentConsent id in Confirm a PaymentIntent API API to make subsequent payments.

Merchant-initiated subsequent payments

Follow these integration steps to trigger subsequent payments using saved payment details. Note that you must integrate subscription management into your application to initiate scheduled payments at set intervals for an agreed amount.

Step 1: Create a PaymentIntent

Call Create a PaymentIntent API API by providing the amount, currency, and id of the shopper in the customer_id parameter. Save the returned intent id and client_secret.

Step 2: Confirm the PaymentIntent

Call Confirm a PaymentIntent API API with the following parameters to charge the shopper.

  • intent_id: The id of the PaymentIntent you want to confirm and complete.

  • client_secret: The client_secret of the PaymentIntent you want to confirm and complete.

  • customer_id: The id of the Customer associated with the saved payment method.

  • payment_consent_reference.id: The PaymentConsent id associated with the saved payment method.

On this page