May 20, 2021 WeChat Mini Program Development Document
Starting with developer tool 1.02.2005111, the cloud console supports cloud development WeChat payment merchant binding, which can be natively connected to WeChat payment in cloud development after binding:
The need is that WeChat payment has been opened, and the merchant number has been bound to the small program.
It's on in the cloud console - settings -
Account binding, jsapi, and api refund permission authorization are required after the merchant number is added. Please note:
1) Account binding: you need to confirm the authorization on the WeChat Payment Merchant Assistant program provided by WeChat Payment.
2) jsapi and api refund permissions, you need to go to WeChat Payment Merchant Platform my authorized products to confirm authorization. Description
After the authorization is completed, weChat payment-related interface capabilities can be invoked.
wx-server-sdk >= 2.0.2
Cloud Development provides WeChat payment-related interface and service-side callbacks, including unified order orders, query orders, close orders, request refunds, query refunds, download statements, as detailed in the API documentation.
Order critical development processes:
Note: The cloud function that receives the payment result callback must return an object for "errcode": 0, otherwise the callback processing will be considered a failure and the callback will continue to be received for the next two days until the return is successful. The specific return value protocol can be found in the unified order interface documentation.