Alipay+ DocsAlipay+ Docs

Test APIs locally with Postman script

Read this chapter to learn about how to use the Postman script to test Alipay+ APIs.

Follow these steps:

  1. Download the Postman script file on the iTest page of Alipay+ Developer Center.

image

  1. Import the Alipay+ environment into Postman.

Download the following file and import it to the Postman environment:

📎Alipay+ Postman Environment.json

  1. Set values in Postman.

Enter "A+ APS" for the Environment Name field and provide values for the pk, which stands for privateKey, and clientId parameters.

image

If you don't have a private key, use Alipay+ Developer Center to generate the key pairs associated with your own client ID. For more information about how to get your client ID and generate key pairs, see steps 1 and 2 in Configure the sandbox.

  1. Import the Alipay+ collection.

Download the following file and import it into Postman:

📎Alipay+ Postman Collection.json

  1. Edit the API request body.

Click the API and you can edit its request body. Note that for the pay APIs in different scenarios, values for one parameter might be different. For more information about how to specify parameter values in Alipay+ APIs, see API Reference.

image

If you need to view or modify the algorithm, right-click the API and click Edit to edit the script.

image

image

Note: The script is based on this open-source library: https://joolfe.github.io/postman-util-lib/.