Alipay+ DocsAlipay+ Docs

Integrate the Alipay+ SDK

The Alipay+ SDK consists of the mobile SDK and Web/WAP SDK. In the Auto Debit scenario, only the Web/WAP SDK is applicable. If the terminal type of your client side is Web or WAP, your client side can integrate the Web/WAP SDK.

Workflow

The following figure illustrates the main workflow of how to consult the payment method information by using the Web/WAP SDK.

call WebWAP SDK to consult EN.jpg

Figure 1. Consult payment method info with Web/WAP SDK

The workflow contains the following major steps:

  1. When the user starts the binding process, your client side needs to obtain the payment method information as follows:

1.1 Call your server side to obtain the payment method list (Step 2-4);

1.2 Call the inquireAuthorizationOption API provided by the Web/WAP SDK with the paymentCurrency parameter (Step 5).

Note: You may implement Step 2 and Step 5 concurrently.

  1. Alipay+ returns a response that includes the following information (Step 7-8):
    • If the API call is accepted and the value of the authorizationOption.enabled parameter is true, the Alipay+ logo, brand name, and promotion information are specified on the authorizationOption parameter.
  1. Your client side renders the payment method page or add payment method page by using the result returned by your server side and Alipay+ (Step 9).

Processing logic

When you call the inquireAuthorizationOption API, take the following things into consideration:

  • Prerequisites
    • Call the AlipayPlus.create() method of the Web/WAP SDK with the following parameters to create an instance during system initialization: merchantId, acquirerId, language, and envType.
    • The merchantId must be the same as the merchantInfo.referenceMerchantId that is specified in the registration API request.
    • The acquirerId is assigned by Alipay+ to identify an ACQP.
  • How to handle the output parameters
    • If the value of the authorizationOption.enabled parameter is false, this indicates that the Alipay+ payment method is not available for this transaction.
    • If the value of the authorizationOption.enabled parameter is true, this indicates that the Alipay+ payment method is available and you need to display the Alipay+ logo, brand name, and promotion information (if any) on the payment method or add payment method page.
      • If no aggregated logo is preconfigured, the default Alipay+ logo is returned. You need to display the default Alipay+ logo along with the promotion information (if any).
      • If aggregated logos are preconfigured, one or more aggregated logos are returned.
        • The aggregated logos are returned based on the currency specified in the input parameter. If no aggregated logo matches the currency, the default aggregated logo is returned.
        • If the aggregated logos are configured with the promotion tag, you can directly display these logos; otherwise, you need to display the aggregated logos along with the promotion information (if any).

Samples

AlipayPlus.create()

The following sample shows how to call the AlipayPlus.create() method:

copy
const alipayPlus = AlipayPlus.create({
  acquirerId: 'xxx',
  merchantId: 'yyy',
  language: 'en_US',
  envType: 'SANDBOX',
});

inquireAuthorizationOption()

The following sample shows how to call the inquireAuthorizationOption() API:

copy
alipayPlus.inquireAuthorizationOption({
  paymentCurrency: 'PHP',
}).then((authorizationOption) => {
  // show payment method page or add payment method page with Alipay+ payment method
}, (error) => {
  // handle error
});

For more information about how to consult the payment method information by using the Web/WAP SDK, see Alipay+ ACQP Web/WAP SDK overview.