Section 6. Practical implementation of project payment function-margin payment, payment callback

Summary

In the previous section, we applied for the merchant's certificate, APIv3 key, and wrote the relevant code for downloading the WeChat platform certificate. We also used the WeChat platform certificate download and WeChat order interface as examples to analyze the use of sdkapi and how sdk works. Encapsulates the process of signing and verifying. In this section we will combine the actual margin payment business to implement the entire payment function.

Function realization

1. Implement the mini program to display the amount input interface and payment button
2. Implement the mini program order interface
3. The mini program activates the WeChat payment interface
4. The mini program notification callback url
5. Scheduled task order checking
6. Cancel the order

Mini program amount input interface:

The mini program payment interface is as follows:
Margin payment interface

WeChat order interface development

After entering the amount, click the payment button, call the mini program's order API (backend interface call), and create WxPayControllera request to receive the mini program.

@ApiOperation("小程序统一下单API")
    @PostMapping(

Guess you like

Origin blog.csdn.net/superzhang6666/article/details/135271227