[Demo] applet with you all the fun for a small applet program of the treasure fast payment

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 .

_2019_06_05_9_55_13

Prerequisites

Get the template code

Download the template message Demo.zip file , and extract it to a local.

Steps for usage

_2019_06_05_9_56_53

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 .

_2019_06_05_9_58_18

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.

_2019_06_05_9_59_32

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 .

_2019_06_05_10_01_58

_2019_06_05_10_02_18

_2019_06_05_10_03_08

data preparation

In the sample database, the new user_pay data table.

_2019_06_05_10_08_29

Front-end configuration

In development tools, open the front-end code in mini-program folder download code folder.

_2019_06_05_10_09_21

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.

_2019_06_05_10_10_16

online experience

_2019_06_05_10_11_21

Developers exchange

Scan code to join Ali cloud cloud applet support group for more live discussions and exchange of technical issues you watch

_jpeg

Guess you like

Origin yq.aliyun.com/articles/704576