Institution could call the Unified Order API to get the prepay_id, which is used to call the payment plugin with different APIs based on different payment methods.
If institution have already integrated Official Account Payment, the calling payment way is much the same with Mini Program Payment. Here are the differences:
Contents | JSAPI | Mini Program |
---|---|---|
Unified Order API | Both need to get the openid first and then call the unified order API | |
Signature for Calling Payment | Both use 5 fields for sign: appId, nonceStr, package, signType, timeStamp | |
Webpage Protocol for calling Payment | http or https | https |
Payment Directory | Y | N |
Authorized Domain | Y | N |
Callback Function | Y | Callback functions such as complete, fail, success |
Note:appid is the appid of institution’s official account
Mch_id is the merchant ID of the institution
Sub_mch_id is the sub merchant ID generated by the institution on WeChat pay platform
Sub_appid is the appid of the mini program
Trade_type is JSAPI
For mini program payment, institutions should choose field sub_openid (openid, sub_openid, choose one to submit) to call the Unified Order API, since only the sub_openid could be got through API wx.login.
Main interaction between merchant system and wechat payment system:
1. Call the login API in the mini program to obtain the user's openid. Refer to the public API " Mini Program Login API".
2. The merchant server call the payment unified order. Refer to the public API "Unified Order API”.
3. Merchant server call to sign again. Refer to public API “sign again”.
4. Merchant server receive payment notification.Refer to public API "Payment Result Notification API".
5. The merchant server query the payment result. Refer to public API "Query Order API".
Customer Service Tel
Business Development
9:00-18:00
Monday-Friday GMT+8
Technical Support
WeChat Pay Global
ICP证