Android SDK
When capturing a Stored Credential for the first time
Create a customer object and pass it to your server if it is a new customer. Recurring payment requires a customer ID to be initiated.
From your server, Create a Customer API with customer data received from client app and save the
Customer ID
returned.(Optional) If the shopper wishes to pay for the first order
Your client app will need a
PaymentIntent
to form a payment session for Airwallex SDK to present payment flow.From your server, access Airwallex API to Create a Payment Intent API and pass the
PaymentIntent
returned to client app.Call
AirwallexStarter.presentPaymentFlow
to present the payment flow or the autentication flow to the shopper.a. PaymentIntent was created
Call
AirwallexStarter.presentPaymentFlow
with anAirwallexRecurringWithIntentSession
and aPaymentResultListener
to present payment flow to the shopper. See sample code below for parameters required to create anAirwallexRecurringWithIntentSession
.Javab. NO payment is required here
Call
AirwallexStarter.presentPaymentFlow
with anAirwallexRecurringSession
and aPaymentResultListener
to present the authentication flow to the shopper. See sample code below for parameters required to create anAirwallexRecurringWithIntentSession
.JavaIn your
PaymentFLowListener
, handle the authentication result returned from SDK and present it to the shopper.If
PaymentIntent
was created earlier, inonSuccess
function above, ask your server to retrieve the payment result. From your server , retrieve the Payment Intent API after SDK has confirmed it with Airwallex API, and pass the payment result to your client app.
When initiating a subsequent one-click transaction (CIT)
Create a Payment Intent with Customer ID to request payment for this order. You will get Payment Intent ID and client_secret returned
Call
AirwallexStarter.presentPaymentFlow
with anAirwallexSession
and aPaymentResultListener
to present payment flow to the shopper.JavaRetrieve the Payment Intent API in
onSuccess
function above to get the payment result from thePaymentIntent
after the SDK has confirmed it with Airwallex API.
When initiating a subsequent subscription and autodebit transaction (MIT)
From your server, Create a Payment Intent API to request for a subsequent payment.
Confirm the Payment Intent API with reference to Payment Consent ID of the stored Payment Consent