Alipay+ DocsAlipay+ Docs

Quick start

This topic introduces how to quickly set up the Alipay+ Android SDK.

Before you begin

Before you get started, ensure that the following requirements are met:

  • Install or update Android Studio to a working version.
  • Use target API level 15 (ICE_CREAM_SANDWICH_MR1) or later.
  • Use Gradle 4.1 or later.
  • Set up a physical device or use an emulator to run your app.

Step 1. Add the SDK to your project

  1. Log on to Alipay+ Developer Center to download the SDK binaries as a package. You can also obtain the source code if you need to review or customize the SDK source code.

The following table lists the SDK packages that are required for different Alipay+ payment products:

Product

Merchant-presented Mode Payment

Auto Debit

aar

Foundational

  • sdk-alipayplus.aar
  • iaptinylog.aar

Product-specific

  • sdk-mpm.aar
  • sdk-autodebit.aar

Page loading acceleration (optional)

  • sdk-container-resource.aar

N/A

Note: If you want to accelerate page loading for Merchant-presented Mode Payment, integrate the page loading acceleration aars in the SDK and call the preload API to enable acceleration as soon as the MPP app is launched.

  1. Add the SDK binaries (the .arr files) to the libs folder of your project.
  2. Add the following code to the build.gradle file of your module.
copy
dependencies {

    implementation fileTree(dir: "libs", include: ["*.jar", "*.aar"])
   
}

Step 2. Set up the SDK before using other APIs

Configure the following parameters to set up the SDK before you use other APIs provided by the SDK.

copy
Configuration configuration = new Configuration();
configuration.envType = "PROD";
configuration.clientId = "XXX";
configuration.siteName = "YYY";
AlipayPlusClient.getInstance().setConfiguration(configuration);

Next steps

After you have integrated the SDK, you can move on to use the SDK in different payment scenarios.

For more information about how to use the SDK in Merchant-presented Mode Payment, see Merchant-presented Mode Payment integration.

For more information about how to use the SDK in Auto Debit, see Auto Debit integration.