Alipay payment - face to face DEMO - sandbox test

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.

write picture description here

Download Generate RSA Key Tool here

After opening the tool, you can see the following interface
write picture description here

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
write picture description here

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
write picture description here

Step 2: Test

Run the project and
see the following interface

write picture description here

Here we test the QR code payment for face-to-face payment, jump to the order page, and set the order information

write picture description here

Generate QR code

write picture description here

Use Alipay sandbox wallet to scan code to pay

write picture description here

payment successful

write picture description here

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324685137&siteId=291194637