Registered user checkout
When capturing a Stored Credential for the first time
Card and Direct Debit
- Create customer API if it is a new customer
- Create payment consent API with the customer ID from Step 1, and save consent ID for subsequent transactions.
- (Optional) Create payment intent API for the order with the customer ID. This step is only needed for shopper wishes to pay for the first order in the payment method binding process.
Verify payment consent API through a transaction authorization or verification with payment method provided. You have 2 options for verifying the payment consent
- Option 1 (Verification only):For cards, you can submit zero or supplementary amounts for the verification process. This will automatically create payment intent, which will be
CANCELLED
after verification is completed. For Direct debit, Airwallex will send out verification email to the shopper automatically to complete verification process. - Option 2 (Verification by completing first payment): You can use the payment intent created in Step 3 to do verification by Confirm payment intent API with
payment_consent_id
. This will result in payment intent to beSUCCEEDED
when verification is completed.
Successfully verifying a payment consent will result in the status of payment consent changed to
VERIFIED
. If payment consent is not verified, the status will stay asREQUIRES_PAYMENT_METHOD
orREQUIRES_CUSTOMER_ACTION
, andnext_action
will appear in the response.In case full 3DS authentication is mandatory (for card transactions in EU region) or triggered by fraud detection during a card verification, you can continue the verification by finishing the payment using payment_intents/confirm_continue API.
- Option 1 (Verification only):For cards, you can submit zero or supplementary amounts for the verification process. This will automatically create payment intent, which will be
E-wallet (eg. Kakaopay)
- Create customer APIif it is a new customer.
- Create payment consent API with the customer you created in Step 1 and save Consent ID for subsequent transactions.
- Verify payment consent API through the authorization process. Provide details in
payment_method
includingflow
andos_type
for the E-wallet your customer selected. Verifying a payment consent will result in the status of payment consent changed toVERIFIED
. If payment consent is not verified, the status will stay asREQUIRES_PAYMENT_METHOD
orREQUIRES_CUSTOMER_ACTION
, andnext_action
will appear in the response. For E-wallet, you need to render the redirect page to the customer in order to complete the authorization. Once finished, you will receive a webhook notification ofpayment_consent.verified
.
When initiating a subsequent transaction using a stored credential
A. For subsequent Subscription and Autodebit (MIT) transactions
- Create payment intent API with the corresponding customer ID
- Confirm payment intent APIwith
payment_consent_id
to request payment with reference to stored payment consent
B. For subsequent Oneclick (CIT) transactions:
- Create payment intent API with the corresponding customer ID
- Query payment consent API with the corresponding customer ID to render the list of customer’s payment consents they previously verified
- Confirm payment intent APIwith
payment_consent_id
to request payment with reference to stored Payment consent. If the subsequent payment is for card payment, 3DS might be triggered in the process
Error Cases
Error Code | Scenario |
---|---|
resource_not_found | create a payment consent with non-existing customer_id , non-existing payment_consent_id , or payment consent with DISABLED /REQUIRES_PAYMENT_METHOD or REQUIRES_CUSTOMER_ACTION statuses |
invalid_status_for_operation | confirm a payment consent with DISABLED /REQUIRES_PAYMENT_METHOD or REQUIRES_CUSTOMER_ACTION statuses |
validation_error | confirm a payment intent with payment consent without providing cvc |
currency_not_supported | confirm a payment intent with payment consent whose currency is different from the intent currency |