Login expired. Please log in again.

Feedback

0/300

Feedback

Submitted successfully

ok

Feedback

Network exception, please try again later

ok

Development Guide

Set Payment Authorization Directory


Ensure that the actual payment request directory is consistent with the directory configured at the backend, otherwise WeChat Pay will not be successfully triggered.


Set a payment directory for your Official Account Pay on WeChat Merchant Platform (pay.weixin.qq.com) in the following path: "Merchant Platform" > "Product Center" > "Development Configuration", as shown in Fig. 7.7. When a user initiates a payment request in the Official Account Pay mode, the system verifies whether the request source URL has been configured on the Merchant Platform. Make sure the authorized payment directory has been correctly configured. Otherwise, the payment request fails due to the verification failure.



Set Domain Name for Web Authorization

When developing Official Account Pay, the user openid is required to be transmitted in the API for order placement. For this purpose, you need to set the domain name for getting openid on the WeChat Official Accounts Platform first, because only the domain name that has been set is an effective one for obtaining openid. The setting page is shown in Fig. 7.8.




Business Process Sequence Diagram



interactions between the merchant system and the WeChat Pay system are as follows:

1. The merchant server calls the unified order placement API to request an order. For information on the API, see [Order Placement API].


2. The merchant server receives a payment notification. For information on the API, see the public API [Payment Result Notification API].


3. The merchant server inquires about the payment results. For information on the API, see the public API [Query Order API].


Get WeChat Version Number

Since WeChat Pay module was added since WeChat 5.0, it will be invalid for users using a lower version to call WeChat Pay feature. Therefore, it is suggested that the merchant determines the version number through the user agent before calling the payment API. Taking iPhone as an example, the following WeChat version information can be obtained through the user agent:


"Mozilla/5.0(iphone;CPU iphone OS 5_1_1 like Mac OS X) AppleWebKit/534.46(KHTML,like Geocko) Mobile/9B206 MicroMessenger/5.0"


5.0 is the version number of WeChat installed by the user. The merchant can parse the above HTTP header to determine if the WeChat version is 5.0 or above.




About  WeChat  Pay

Powered By Tencent & Tenpay Copyright©

2005-2024 Tenpay All Rights Reserved.

Contact Us
Wechat Pay Global

WeChat Pay Global