Airwallex logo
Airwallex logo

Before you start

The Airwallex Android SDK is compatible with apps supporting Android API level 21 and above.

Step 1: Set up SDK

Airwallex Android SDK is available through Maven Central , you only need to add the Gradle dependency.

In your app-level build.gradle file, add the following:

Java
1dependencies {
2 // This is required
3 implementation 'io.github.airwallex:payment:4.0.1'
4
5 // Select the payment method you want to support.
6 implementation 'io.github.airwallex:payment-card:4.0.1'
7 implementation 'io.github.airwallex:payment-redirect:4.0.1'
8 implementation 'io.github.airwallex:payment-wechat:4.0.1'
9 }

You can choose one or more individual modules depending on the payment methods available to you.

If you are integrating AirwallexWeChatPay

Please register your app at WeChat Pay to get a WeChat app ID and configure it in your Airwallex account. We will need your WeChat app ID to initiate WeChat payments. For more details on how Airwallex SDK interacts with WeChat Pay, see WeChat In-App Pay Development Guide

Step 2: Set up your server to access Airwallex API

You will need to obtain an access token that allows you server to reach all other API endpoints. Use your unique Client ID and API key (which can be generated within Account settings > API keys ) to call the Authentication API endpoint API. On success, an access token will be granted.

Before processing a payment, your server must create a PaymentIntent API and pass it to the client. After the payment is completed, your server need to retrieve the PaymentIntent API to check the payment result.

Step 3: Configure SDK

After installing the SDK, you are required to configure your SDK with some parameters when your app starts.

Kotlin
1Airwallex.initialize(
2 AirwallexConfiguration.Builder()
3 .enableLogging(true) // Enable log in sdk, and don’t forogt to set to false when it is ready to release
4 .setEnvironment(Environment.DEMO) // You can change the environment to STAGING, DEMO or PRODUCTION. It must be set to PRODUCTION when it is ready to release.
5 .setSupportComponentProviders(
6 listOf(
7 CardComponent.PROVIDER,
8 WeChatComponent.PROVIDER,
9 RedirectComponent.PROVIDER
10 )
11 )
12 .build()
13 )
Was this page helpful?