Foreword
Note: This example only supports enterprise Alipay account.
APP applet payment and payment of the payment process and experience are basically the same, also supports write-off coupons reputation and the reputation of the merchant discount function. It has signed applet payment or business reputation of the shop recommended payment applet access. Applet pay a small program can not scan code, bar code, such as sound waves to pay to pay for, can only evoke the cashier for payment. See Products and access guidelines in this example, the applet pay .
Prerequisites
- Completed developer settled and created a small program .
- It has been downloaded and installed a small program developer tools .
Get the template code
Download the template message Demo.zip file , and extract it to a local.
Steps for usage
Add Features
1. Enter the applet development center , in my applet , select the appropriate applet, applet access to the details page.
2. In a small program development and management details page feature list , click on the upper right corner to add the function button to add the applet template messages , obtain membership information functions, applets payment function .
Take effect after payment function to be signed applet, click on the far right of the action bar features list signed ; the finished product after the signing process, the status is under review , the audit generally complete the contract within one business day; after approval, status changes have been take effect , you can call the applet payment function.
Back-end development
Open the Java> src> main> resources> application.properties file, fill in the parameters needed to run the service.
Generate RSA key and a private key and a public key configuration application, refer to set the interface mode endorsement .
- If the applet back-end service application deployed on the cloud, concrete steps to participate cloud applications -Spring Boot version .
data preparation
In the sample database, the new user_pay data table.
Front-end configuration
In development tools, open the front-end code in mini-program folder download code folder.
The applet pay quick example pages> index> index.js file URL modify back-end services for the actual domain name, you can program the development of small front-end interface.
online experience
Developers exchange
Scan code to join Ali cloud cloud applet support group for more live discussions and exchange of technical issues you watch