This guide describes how to add Google Pay to your Airwallex Android SDK integration.
In addition to this, please refer additional material
When setting up your Google registration, use the following Airwallex details when you are requested to provide your gateway information to tokenize card details:
gateway : airwallex gatewayMerchantId : Your merchant name as registered with Airwallex
SDK components are available through Maven Central, you only need to add the Gradle dependency.
To install the SDK, in your app-level build.gradle, add the following:
We provide GooglePay parameter that can be used to debug the SDK, you can call it in Application. Please refer sample code below:
Note : Do not fill information under direct integration section on Goolge Pay API business console , this is not required since Airwallex amanges this your behalf.
Configure your SDK with required options to process Goolge Pay transactions. Refer code sample below:
( allowedCardAuthMethods = listOf("CRYPTOGRAM_3DS") billingAddressParameters = BillingAddressParameters(BillingAddressParameters.Format.FULL), shippingAddressParameters = ShippingAddressParameters(listOf("AU", "CN"), true) ) val paymentSession = AirwallexPaymentSession.Builder ( paymentIntent = ..., countryCode = ..., googlePayOptions = googlePayOptions )
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.
Present the payment sheet to the shopper, Use presentPaymentFlow to complete the payment, you need to pass in a AirwallexSession object.
To obtain the payment result, you can use the retrievePaymentIntent method and check the latest status. Then you can prompt the shopper with the result.