This guide describes how to add Apple Pay to your Airwallex iOS SDK integration.
Create a Customer object and pass it to your server if you want to save your customer's details and attach payment information to this object. (This step is compulsory when you process recurring payments for a new customer)
From your server, access Airwallex API to Create a Customer API
Your client app will need a PaymentIntent to form a payment session for Airwallex SDK to present a payment flow.
From your server, access Airwallex API to Create a PaymentIntent API and pass the returned PaymentIntent to the client app.
Create a PaymentSession with all the order related information and payment type information. Ensure you include the merchant Identifier information received after registering on Apple developer portal, see Enable Apple Pay for iOS
AirwallexStarter.presentPaymentFlow with an
AirwallexSession and a
PaymentResultListener to present payment flow to the shopper.
PaymentResultListener, handle the payment status which shows whether the shopper has completed the payment flow or not.
Note that a completed flow does NOT imply a successful transaction, you will need to query the payment result afterwards through your server to know whether the order is paid or not. Inside
AWXPaymentResultDelegate, ask your server to retrieve the
From your server, retrieve the PaymentIntent API, get the payment result and return it to the client app.
Customise Apple Pay option
It is possible to further customise Apple Pay option, see code sample below: