Current location - Quotes Website - Signature design - How to connect WeChat payment and WeChat delivery notification interface?
How to connect WeChat payment and WeChat delivery notification interface?
Wechat payment provides a payment test page, and the formal use of WeChat payment requires testing the payment, delivery notification interface, alarm interface and rights protection interface. The alarm interface and the rights protection interface are very simple. The payment interface is relatively simple, mainly because the delivery notification interface is slightly more complicated. Pay attention to the following points when calling the delivery notification interface:

PostData of the delivery notification interface is mentioned in the WeChat payment document, which is actually not an item in a form. In fact, the reference to PostData is a bit misleading and can be understood as a json string.

When ok is returned, ask the merchant whether the background has received the notification of successful transaction, and if so, the front end will display the interface of successful transaction; If no notice is received at this time, the merchant background actively calls the interface for querying orders to query the current status of orders, and feeds back the corresponding interface to the front end.

The appid appearing in the debug delivery interface is different from the appid of access _ token; The problem is generally not that appId and access_token do not match, because most developers can get the correct access_token. The main reason is that (1) forms may be submitted with various parameters. (2) Non-json format. (3) Understand PostData as a hidden field in the form and distribute json data.

According to the code, the problem of delivery notification interface can be solved. Of course, various merchant IDs and keys of WeChat accounts should also be configured correctly.