Alipay, China's leading third-party online payment solutionAlipay, China's leading third-party online payment solution

Quick Start Guide for Integration

Before the integration, you must contact Alipay business developer (BD) to complete the required business steps and get connected with the Technical Support team. Alipay Technical Support team can assist you in integration designing, implementing, and acceptance.

Integration

The integration process consists of the following steps. For full information about the integration (such as introduction of main flows, API specifications, and signature), see Documentation.

  1. Log in to My Alipay with the assigned account information. If you experience any problems when applying for the account, contact Technical Support team for help.

     

On the My Alipay page, you can view information that is required for the integration, such as Documentation and Sandbox Information (where you can find both buyer and merchant information for test).

Quick Start Guide for Integration

  1. Under Sandbox Information -> Basic Information, move to RSA2 key, and then click Set up. You can configure and then upload you key information here.

Quick Start Guide for Integration

  1. Download Alipay sandbox App by scanning the QR code. The app, mainly with Scan, Pay, and Transactions functions,  is only available on Android for now. When you perform the test:  

  • Log in to the sandbox Alipay app with the Buyer Information

  • Use the Partner ID and Client ID that you find in Merchant Information for API calls

  1. View reconciliation files. You can only view reconciliation files when real transactions exist in product environment.

     An example of the reconciliation file is as below:

Partner_transaction_id|Transaction_id|Transaction_amount|Charge_amount|Currency|Payment_time|Transaction_type|Secondary_merchant_id|Store_id|Remark|Secondary_merchant_industry|Secondary_merchant_name|Operator_name|Order_scene|Trans_currency|Trans_amount|

Trans_forex_rate11277xxxxx448169|20180xxxxx001004280571701722|10.00|0.10|AUD|2018-05-29 07:37:10|CANCEL|110xxxxx0100001|110xxxxx0100001||5331|Quest Marketing|Quest Marketing|transactionQrCode|AUD|10.00|

     You can obtain reconciliation files through SFTP. To setup SFTP connection, contact the Technical Support team.

  1. (Optional) Configure asynchronous notification. The asynchronous notification can only be configured in production environment currently. Once configured, it will be applied to all products, including payments and refunds made in Customer-scan and Merchant-scan payments. In addition, a separate configuration is required for each merchant.

  1. (Optional) For certain projects, in product environment, SHA256 instead of RSA2 key is used for signature. Alipay will send the key information to you by Email.  An example is provided as below:

Quick Start Guide for Integration

Acceptance test

All API tests can be performed in sandbox environment. After the integration is completed, you must download Alipay test cases and questionnaires to complete the acceptance test. Please send test results and answered questionnaires to Technical Support team. The technical support team can then help you analyze the integration quality and provide suggestions for improvement.

Product

Test Case

Checklist

Barcode Payment

Download

General / Product

Merchant QR Code Payment

Download

General / Product

Transaction QR Code Payment

Download

General / Product

Third-party Merchant QR Code Payment

Download

General / Product

FAQ

1. How to generate signature for an API request?

Refer to Digital Signature when signType is RAS2. When signType is SHA256, append the SHA256 key to the content to be signed.

2. In direct integration mode, what values should be used for storeId and secondaryMerchantId of PAY API, are they required?

For PAY API, the seller filed in order is required for request. The value of storeId and secondaryMerchantId under seller must be the same as that of partnerId.

3. Why error code CURRENCY_NOT_SUPPORT is returned when testing PAY API?

Currently, only the currency USD is supported in sandbox environment. Ensure that the currency you specified in order is USD.

4. Why error code UNKNOWN_EXCEPTION is returned when testing REFUND API in asynchronous refund mode?

Currently, only synchronous refund is supported in sandbox environment. Ensure that  isSync is configured as true.