Alipay payment - face to face DEMO - sandbox test
The online mall project I did some time ago could not make WeChat payment because I didn’t have a corporate account. I learned that Alipay has a sandbox test environment, so I came to run the official DEMO specially.
Go to Ant Financial to register, get certified, download and pay the DEMO face -to-face
Step 1: Configure the sandbox application environment
Click "Open Platform - Developer Center - Sandbox Environment". Enter the sandbox environment page, the system has automatically created an application for you, and you can see the application information in the basic information.
Download Generate RSA Key Tool here
After opening the tool, you can see the following interface
The key length of 2048 is the RSA2 key, and 1024 is the RSA key. Here we use 2048, click to generate the key
Copy the generated Alipay public key, fill in the following, and then copy the Alipay public key
Import the downloaded DEMO into the IDE and start filling in the configuration file
open_api_domain = Alipay gateway
mcloud_api_domain = http://mcloudmonitor.com/gateway.do
pid = Merchant UID
appid = APPID
private_key = private key generated by the
tool public_key = public key generated by the tool
alipay_public_key = Alipay public key just copied
Step 2: Test
Run the project and
see the following interface
Here we test the QR code payment for face-to-face payment, jump to the order page, and set the order information
Generate QR code
Use Alipay sandbox wallet to scan code to pay
payment successful