Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize the delivery Notification function in WeChat Pay

Shulou Source: shulou.com Published: 2022-06-03 16:16:53 10月03日 Update

This article mainly shows you "how to realize the delivery notification function in WeChat Pay". The content is easy to understand and clear. I hope it can help you solve your doubts. Next, let the editor lead you to study and learn the article "how to realize the delivery notification function in WeChat Pay".

I. delivery notice

In order to better track the situation of the order, it is necessary for the third party to call the shipping notification API to inform the Wechat backend of the shipping status of the order after receiving the final payment notice.

Delivery time limit: virtual, service within 24 hours, physical category within 72 hours.

Please ship the goods on time after receiving the payment notice, and use the shipping notification interface to synchronize the relevant information to the Wechat backstage. If the platform does not receive it within the specified time, it will be treated as a delivery overtime.

The URL of the shipping notification API is:

Https://api.weixin.qq.com/pay/delivernotify?access_token=xxxxxx

The parameters in URL only contain the current Wechat public platform voucher access_token, while the real data of the shipping notification is placed in PostData in the following format:

{"appid": "wwwwb4f85f3a797777", "openid": "oX99MDgNcgwnz3zFN3DNmo8uwa-w", "transid": "111112222233333", "out_trade_no": "555666uuu", "deliver_timestamp": "1369745073", "deliver_status": "1", "deliver_msg": "ok", "app_signature": "53cca9d47b883bd4a5c85a9300df3da0cb48565c", "sign_method": "sha1"}

The above content parameters are described in Table 6-12.

Parameters.

Description

Appid

AppId of the public platform account

Openid

The OpenId of the seller and buyer, which has been placed in the PostData of the notification of the final payment result

Transid

Transaction order number

Out_trade_no

Third-party order number

Deliver_timestamp

Delivery timestamp, which refers to the Linux timestamp

Deliver_status

Delivery status. 1 indicates success, 0 indicates failure. In case of failure, you need to enter the cause of failure in deliver_msg.

Deliver_msg

Shipping status information, you can fill in the wrong gag message encoded by UTF8 in case of failure, such as "the item has been refunded"

App_signature

Generated according to the signature method described in the payment signature (paySign) generation method, the participating signature fields are: appid, appkey, openid, transid, out_trade_no, deliver_timestamp, deliver_status, deliver_msg

Sign_method

Signature method (excluding signature generation)

Table 6-12 description of shipping notification parameters

After verifying ok, Wechat public platform will return data indicating whether the notification was successful, for example: {"errcode": 0, "errmsg": "ok"} if there is an exception, it will be described in errcode and errmsg. If successful, errcode is 0.

Second, program realization

Some of the parameters in the program come from the WeChat Pay development data in front of this blog. Readers, please refer to run

Tags: Payment content parameters platform time success information public data status articles orders generation background hours methods programs third parties results learning Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Huawei Shulou Technology Microsoft Xiaomi