Alipay+ DocsAlipay+ Docs

Quick start

This topic introduces how to quickly set up the Alipay+ ACQP Web/WAP SDK.

Before you begin

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

  • Use iOS 8 or later.
  • Use Android 4.2 or later.
  • Use Internet Explorer 11 or later.

Step 1. Add the SDK to your project

Choose one of the following methods to add the SDK to your project.

  • Install the SDK npm package (recommended).
copy
npm install --save alipayplus-sdk-acqp-web
  • Embed the SDK script into your HTML file.
copy
<!doctype html>
<html>
  <head>
      <script src="https://g.alipayplus.com/sdk/acqp/v1/index.js"></script>
  </head> 
<html> 

Step 2. Set up the SDK

If you install the npm package, call the loadAlipayPlus API to set up the SDK as follows:

copy
import { loadAlipayPlus } from 'alipayplus-sdk-acqp-web';

loadAlipayPlus().then((AlipayPlus) => {
  const config = {
    acquirerId: 'acquirerId', // acquirer ID
    merchantId: 'merchantId', // merchant ID
    envType: 'SANDBOX', // Change to 'PROD' for the online.
    language: 'en_US',
  };
  const alipayPlus = AlipayPlus.create(config);
}, (error) => {
    // handle error
});

If you embed the SDK script, configure the following parameters to set up the SDK:

copy
const config = {
  acquirerId: 'acquirerId', // acquirer ID
  merchantId: 'merchantId', // merchant ID
  envType: 'SANDBOX', // Change to 'PROD' for the online.
  language: 'en_US',
};

const alipayPlus = AlipayPlus.create(config);

Next steps

After you have integrated the Alipay+ ACQP Web/WAP SDK, you can move on to use the SDK in different payment scenarios.