Permission does not have to be enabled for refund through WeChat Public Accounts.
Please check against the following items:
1. Configuration authorization: the upper and lower cases in the address of the testing directory is consistent with those in the code.
2. The configuration in the payment authorization directory, the timeStamp used when generating signatures, and the timestamp used by the front-end js.
3. Please do not assign the payment directory to level 2 or 3 as it needs to be assigned to the last level.
4. Cite the WeChat js.
5. Developer Center - Web authorization for obtaining users' basic information - js security domain.
6. Discrepancy between WeChat authorization domain and WeChat payment domain, for example: one has "www", and the other does not.
7. Payment directory refers to the directory in the payment page instead of the payment link directory in the back-end.
It is a given rule that a timed out order cannot be paid. Payment can only be made after placing another order.
Payment via JSAPI: The merchant has a H5 online store, the user opens the webpage in a WeChat built-in browser by messaging or scanning QR codes. WeChat Pay can be called to complete the purchase process.
Payment via Mini Program: The merchant has a Mini Program. When the user opens the Mini Program via sharing by a friend or scanning QR codes, WeChat Pay can be called to complete the purchase process.
Note: The order placement interfaces of the two payment methods mentioned above are the same.
JSAPI: The merchant has a H5 online store, the user opens the webpage in WeChat by messaging or scanning QR codes, WeChat Pay can be called to complete the purchase process.
Payment via H5: refers to when the merchant displays products or services on the mobile webpage outside the WeChat client, the user confirms to use WeChat Pay on the aforementioned page, and the merchant initiates this service to call up the WeChat client for payment. It is mainly used in scenarios where touchscreen mobile browsers request WeChat payment. WeChat Pay can be conveniently called up by external browsers.
Further note: JSAPI requires WeChat browser; H5 can be operated via external browsers, but the WeChat client needs to be called when making payments.
When paying within WeChat, please use the JSAPI payment interface. When paying within the merchant's app, please use the app payment interface.
Yes, after placing an order, the interface needs to be initiated for payment. For specific steps, please refer to the guide document on API paid by initiating JSAPI.
The merchant can call the "user identifier" parameter in "check the order interface" to search for a specific user based on, i.e. openid.
If the prepay_id is within its 2-hour period of validity, it can be used to pay. If it is expired, please re-input the original parameters to obtain a new prepay_id to initiate the payment.
Error Analysis: Warning for repeated payments. Note: Please remind the user that if the payment is not repeated, simply proceed to pay.
Rules for identifying repeated payment:
1. Payments made to the same merchant in the same amount within 1 minute of each other and without any call-back or order checking are identified as repeated payments.
2. In the agency mode, repeated payments are determined as those with the same sub_mch_id; In the directly-connected merchant mode, repeated payments are determined as those with the same mchid. The specific pop-up prompts are as follows:
A. Pop-up prompts will be displayed for orders of the same amount are placed within 1 minute of each other at the same merchant.
B. No pop-up prompts are displayed when the orders of different amounts are placed at the same merchant within 1 minute of each other.
C. No pop-up prompts are displayed when orders of the same amount are placed at different merchants within 1 minute of each other.
D. No pop-up prompts are displayed when orders of different amounts are placed at different merchants within 1 minute of each other.
Error Analysis: Suspicious users are not allowed to purchase from cross-border merchants due to regulatory requirements.
Please check against the following items:
1. Please do not initiate payments in an emulator, please do so on a real device.
2. For the payment authorization directory of WeChat Public Accounts, please fill in the url that initiates the payments, for example:
For webpage: http://www.newfms.com/order/pay/id-115,
please fill in http://www.newfms.com/order/pay/
Please check against the following items:
1. Incorrect package parameter format, the package parameter format should be :"prepay_id=wx201410272009395522657a690389285100".
2. The package parameter is not obtained, "null" is returned.
3. Please check if the prepayment session identifier, prepay_id, is disabled.
4. Please check if the appid requested is consistent with the appid of the order-placing interface.
5. The WeChat Pay amount should be in "cent", and no decimal point is allowed.
6. The prepay_id is null because of:
a. Null amount;
b. Repeated order number;
c. Null order number.
Please check against the following items:
1. For calling the cashier through the JSSDK method, click [Details] to obtain the "JS-SDK Introduction Document".
2. Please check the code against the aforementioned document.
3. Please check if the JS file is correctly imported. (Note: If the first js import is unsuccessful, please import a second one.)
4. Please check if the page is initiated in WeChat using the built-in object method.
5. If the above methods do not work, please check the local environment.
Please check against the following items:
1. If the appid uploaded through the unified order-placing interface is consistent with the appid that the WeChat client initiated for payment.
2. If the necessary parameter for initiating the WeChat client to pay, prepayid, is correct, or if the prepayid is expired (2-hour period of validity).
In case of the above error report, please contact the operation personnel to enable payment authorization.
Please check against the following items:
1. Please check if the verification of the injection authority of the config interface is carried out on the payment page.
2. Please check if the parameters that initiate the payments are consistent with the requirements of the document. For example, if the category of the timeStamp is String (the default timestamp of php is int).
Please check against the following items:
1. Please check if the necessary parameters for order placement are complete.
2. Please check if the importing parameters are consistent with the document.
3. Request testing in postman. If postman testing is successful, print the finalized parameters and the postman parameters and compare them. Pay special attention to spacing.
4. Please use the same WeChat account to initiate payment for the order numbers of the same merchant. Please do not switch to another account halfway. If you switch to another account, the error "Incorrect merchant order information" will be reported, and the issue will not be solved.
Note The aforementioned field descriptions are generally applicable to payment via app, Native, Mini Program, merged orders, and H5.
Error Analysis: Error in the openid interface obtained from WeChat Public Accounts.
Please check the appid [Back-end of the Public Accounts] (mp.weixin.qq.com), and if the configured authorization domain is consistent with the openid obtained.
The configuration path of the authorization domain: Public Account Platform - Settings - Public Account Settings - Function Settings - Webpage Authorization Domain
Please check if the merchant number is correct.
When opening the payment webpage in the WeChat built-in browser, please pay via JSAPI; When opening the payment webpage in the external browser, please pay via H5.
The V3 and V2 interfaces can be used together. First, the merchant's API certificate needs to be upgraded to a certificate issued by the authoritative CA. Then, set up the V3 and V2 access according to the interface document. V3 and V2 do not affect each other, but both will call the merchant API certificate issued by the same authoritative CA. Second, when calling the corresponding interface, follow the corresponding interface rules of the version used
[Note].
1. If the certificate was not issued by the authoritative CA, please upgrade it first.
2.After upgrading to the API certificate issued by the authoritative CA, the API certificate issued by WeChat Pay (the merchant API certificate originally used by APIV2) will become invalid after 14 days. The technician needs to replace the old certificate on the server with the new certificate as soon as possible.
3. Note: The interfaces for placing and checking an order and starting a payment should be under the same version. For example, if the v2 version is used to place an order, then it also needs to be used to call a payment, and the signature specification must be consistent. The v3 interface can be used to apply for a refund, but it must be called according to the corresponding interface rules.
Please check against the following if you receive callback notifications repeatedly:
1. Repeated callbacks caused by network jitter is normal, but the merchant system must be able to correctly handle the repeated notifications.
2. If the merchant's response is not standard or exceeds the time limit, WeChat will determine that the notification failed and it will resend another one until it receives the standard response from the merchant. Merchants need to give standard response according to the following instructions. Instructions for standard response: The merchant's response to the payment result of V3 interface should be successful with the status code 204 or 200 rather than the code message in the document. No more callback notifications will be sent after the response succeeds. The HTTP status code for the response to abnormalities should be 500 or 4xx . If the response fails, the callback notification will be sent until the merchant responds as requested or the upper frequency limit is hit.
The merchant's actual payment directory must be the same as that set up on the WeChat Pay on the merchant platform, otherwise the error message "the URL of the current page is not registered" will be reported. The path to payment authorization directory: Log in to WeChat Pay on merchant platform - -> Development configuration. The setup will take effect within five minutes after completion. If error occurs again, please check against the following items:
1. The payment authorization directory is set incorrectly. For example, the order is put under merchant number ID A, but the payment authorization directory is set to the merchant platform of merchant ID B.
2. Only 5 authorized directories can be set at most. If more child directories are needed, a parent directory can be set directly. For example, if https://pay.weixin.qq.com/wiki/ and https://pay.weixin.qq.com/app/ are both needed, https://pay.weixin.qq.com/ can be set directly.
3. The directory is strictly case-sensitive, and has to start with http or https, and end with the left slash "/".
4. The authorization directory cannot be set to the IP form, like "https://8.8.8.8/test".
5. Assuming that "https://www.weixin.com/pay.php" is the address of the last page of the merchant, the authorization directory needs to be "https://www.weixin.com/"
Error Analysis: Under the same merchant ID, once an order is successfully placed with a number generated, the modification of its parameters and repeated submission will not be allowed because the parameters re-typed in should be the original parameters .
For example, after an order number is successfully placed at the JSAPI payment interface, it cannot be placed again at the APP payment interface.
Solution: Please verify whether the merchant order number was submitted repeatedly
The V2 interface callback format is xml and that of the V3 interface is JSON
It can be determined by the appid parameters of the decrypted callback information
The bank_type field parameter will certainly appear at the callback interface
No, different APPIDs are used in different payment scenarios. Currently, JSAPI payment can only use official accounts (service number) APPID. App payment uses App APPID
No, a repeat payment prompt will appear.
Whatever works. The signature is to ensure that the message comes from WeChat. In order to ensure data security, it is recommended that the information returned by the merchant interface be checked and signed. The interface that needs to be decrypted is mentioned in the interface document.
If the correct callback address is passed when an order is placed, the merchant can receive and view the callback information through the callback address
WeChat Pay can not be used in WeChat internal and external browsers at the same time. Please call the payment through the corresponding order and payment interface
Case 1: After the order closing interface is successfully called, the transaction status will return CLOSED if the order is queried.
Case 2: An order that has been placed but has not been paid for within 15 days will be canceled by default.
Note: The order closing interface can be only called when the order is unpaid
No, V3 only supports the asymmetric secret key SHA256-RSA.
No. The WeChat Pay order number is defined as the unique order number generated by the WeChat Pay system.
Yes, payment failure is a clear final status and users cannot pay
No, the callback notification can not be received normally without notify_url
Yes, if the order is not paid within 14 days, it will be closed automatically
The same outTradeNo can generate the prepayid multiple times if the order has not been paid successfully or closed
Payment can continue if payment was unsuccessful other than when there is a timeout prompt.
-[[Description of order validity period under basic payment interface]]
More about: [[Standard questions|Frequently asked questions on WeChat payment parameters]]
In order to prevent repeated payment, order closing can be called. It is recommended that the merchant call the order closing interface for unpaid orders. Unified order can not be placed under the order number after it is closed.
The correct callback address needs to be delivered only when the ordering interface is called, with no need for additional configuration.
V3 is recommended to new merchants because it is easier and more consistent than V2.
V2 has been suspended but is still available currently. Please pay close attention to the latest official website document for the specific offline time.
V2 and V3 can coexist if the merchant's API certificate has been upgraded and issued by the authoritative CA. Please follow the V2 and V3 interface documents for access. V3 and V2 do not affect each other, but both will call the merchant API certificate issued by the same authoritative CA.
Note:
1. If the certificate is not a merchant API certificate issued by the authoritative CA, please upgrade the API certificate first.
2. After upgrading to the API certificate issued by the authoritative CA, the API certificate issued by WeChat Pay (the merchant API certificate originally used by APIV2) will become invalid after 14 days. The technician needs to replace the old certificate on the server with the new certificate as soon as possible.
3. V3 interface rules are different from that of V2. Please refer to thev3 interface rules
No, please use the official account APPID for JSAPI orders
The contents of callback information can be obtained from the callback address.
The V2 interface is a data stream that sends xml format strings by post.
The V3 interface is a data stream that sends a json format string by post.
V2 interface: Please click on [details 1] for corresponding content.
V3 interface: Please click on [details 2] for corresponding content. Note: No official sample code is currently available.
Note:
V3 is recommended to new merchants because it is easier and more consistent than V2. V2 has been suspended but is still available currently. Please pay close attention to the latest official website document for the specific offline time.
-[[The document link for the API interface of WeChat Pay]]
-[[The difference between the APIV2 and APIV3 interface]]
-[[The SDK interface document of WeChat Pay]]
More about: [[Standard questions|Frequently asked questions on WeChat Pay callback]]
The notify_url of the order interface is the callback notification address, which is used to receive the asynchronous callback notification after a successful payment, and is not the jump address to the front-end page after the user's successful payment.
No, the same unpaid status will appear when users close WeChat and when the payment fails
The only payment notification status is when payment was successful. PAYERROR will not appear
Yes. Please set timestamp according to standard Beijing time. The time zone should be GMT+08, according to the seconds since 00:00:00 on January 1st,1970.
Note: Some systems measure in millisecond which needs to be converted to seconds (10 digits).
Example value: 1414561699
Different notifications for one order have the same ID
No, openid is the unique identity of users at each appid and each appid is different from one another.
If the payment hasn't been called after the order is placed, the original parameter of the order can be recorded again.
Orders that have been successfully paid can be viewed in real time on WeChat.
Yes, the callback notification data is placed in the request body.
Yes, attach additional data can be used as custom parameters and returned as it is in the query API and payment notifications
In agency mode, the request header information comes from the agency.
Yes, the service interface layer has to deal with the openid by itself
No, please write the corresponding code strictly following the document interface rules
Agency mode:
Two parameters identify the user's identity (either one).
1. When filling in the sp_openid: use the openid obtained from the agency's appid (sp_appid field)
2. When filling in the sub_openid: use the openid
direct connection mode:
obtained from the submerchant's appid (sub_appid field).
Only one parameter identifies the user's identity: Use the openid obtained from the direct merchant appid (appid field)
At present, only one WeChat Pay callback address is allowed when an order is placed.
Please check against the following items:
1. Check whether the merchant ID and appid are used correctly.
2. Check whether the request address is correct and whether the applicable object of the interface matches the merchant ID type.
3. Use the same parameters and call it again later.
4. Please check whether the merchant API certificate serial number of Authorization in the request header matches the merchant ID of the request header
There is only one notification for successful payment but repeated notifications will be returned if the response fails. Please click for payment notification
Only port 80 is allowed by default.
It is independent of the domain name level, but it must be an accessible domain name.
There are currently two ways to obtain the WeChat Pay order number.
1. The WeChat Pay order number can be obtained by calling the order query interface to get the return parameters.
2. The WeChat Pay order number can be obtained through the return of callback.
Special reminder:
1. The WeChat Pay order number can be generated only after successful payment.
2. The corresponding callback notification can be generated only after the payment succeeds
Upload the required address in the notify_url field of the order placement interface
There is no unioni in the payment notification returned by WeChat Pay
A callback notification is the callback address that is sent to the merchant when he places an order. The address sent is the same as the address filled in by the merchant.
Note: Only one address can be used in one order
No, the order needs to be submitted again under a new order number
Each order number can be paid for once and can not be paid repeatedly
Payment timeout will appear in the payment scenario when the password was not entered for a long period of time after the cashier desk is called. The user cannot call the payment again if payment timeout occurs.
A successful payment notification will be received or can be queried through searching for the order number.
Special note: Notification will only be received after successful payment
The merchant ID that initiated the mchid sending interface request should be uploaded to mchid; The merchant ID of the agency should be uploaded in agency mode; The direct merchant ID should be uploaded in direct connection mode.
The order amount cannot be 0
In general, the validity period of the order is subject to the failure time of prepayid, which should be two hours by default. The order needs to be placed again to obtain the prepayid after more than two hours.
Special note:
1. The rules above apply to V2 and V3 interface and above.
2. The validity period of the order is two hours by default in Native payment. The order needs to be placed again if two hours have lapsed.
3. The validity period of the order is five minutes by default in H5 payment. The order needs to be placed again if five minutes have lapsed
The minimum failure time interval should be more than 1 minute
Yes, it can contain lowercase letters
Reason: Currently, the order deadline can only ensure whether the order will be paid or not. It can not guarantee the change of status.
Solution: the order can be closed to ensure that it will not be paid
Please check against the following two items:
1. Please check whether the package parameter format is correct. The correct format is package: "prepay_id=wx201612032137789b201de80e0661234657".
2. Please check whether the package parameter was successfully sent to the interface. An empty package parameter will also cause the error
Error analysis: The openid for unified order placement is different from the openid for calling the payment.
Solution: The incoming openid needs to be obtained in real time.
The most direct way is to check whether the openid of users for obtaining the payment is the same as the openid for calling the payment. There will be an error prompt on the WeChat payment interface if they are different
Error analysis: The code request failed.
Special note: Normally, prepay_id won't be blank
Please check against the following items:
1. The transaction type parameters are incorrectly filled in when the payment interface of unified order is called.
2. Rules of filling:
fill in JSAPI if paying through official account and mini program,
fill in NATIVE if paying by scanning code,
fill in APP if paying though App,
and fill in MWEB if paying via H5
Please check against the following items:
1. Authorization directory: the payment authorization directory is the directory where the page of the website request is initiated, and must be accessed through the url address(regardless of the real physical directory path).
(Note: When registering and filling the directory, it needs to be accurate to the smallest level and the file name should be directly added after the use name. Do not add or delete directory).
2. Web authorization: When the developer uses the WeChat Pay"JS API", this payment requires web authorization. The code should be obtained first before using the code to obtain openid and prepay_id. Web page authorization requires log in to [WeChat official platform]. Click [Left Menu] - [Developer Center] - In the [Interface Rights List] on the right, find [Web Account] and click [Modify] on the far right to type in the test domain name without http.
3. Obtain the basic information of users through web page (location: [WeChat official account] - [Developer Center]). The most likely reason lies in the basic information obtained from the web page. Check whether the domain name in the user's basic information is filled in or filled in correctly to ensure the accurate setting of corresponding parameters.
Operations: [WeChat official account] - [Developer Center] - [Website authorization] to obtain [Basic User Information] - [Modify] - [Fill in Domain Name]) (without www and /)
4. The link address does not exist.
Click the corresponding button on WeChat, and if the system replies that the link address does not exist or that the configuration is not correct, please check and reset the link accurately when configuring the directory of internal linked websites.
5. The security domain name of JS interface is not filled in. Click [Official Account Setting] - [Function Setting] and click the setting button in [Security Domain Name of JS Interface]. Fill in the [Domain Name] in the first line and click [Save].
6. Code error. Please follow the development document to check the code.
7. Path error. In terms of the function setting and development settings in the background of WeChat official account, if you are not sure about the URL, please ask the developer or service provider for confirmation before filling in again.
For example, [Payment Path] and [Callback Path], etc.
1. Please check whether the serial number of the WeChat Pay platform certificate in the callback information is consistent with the serial number of the WeChat Pay platform certificate held by the merchant. If it is inconsistent, please get the WeChat Pay platform certificate again.
2. Check whether the signature string is processed in accordance with the document requirements.
3. Check whether the callback information is complete and whether the order has changed
1. Callback address for receiving the result notification from WeChat Pay asynchronously; the notification URL must be a URL that is accessible by an external network.
2. There must not be any parameters.
3. The domain name of public network must be https. It is recommended that the users that can accept the callback through http domain name currently replace it with https in case the callback can not be received later.
4. The current port number is not supported
Please check the following items if the callback notification is delayed.
1. The callback address is the default port. Do not customize the port.
2. Check whether there is the distribution and transmission of nginx and firewall before handling the server of the callback.
3. Check the memory of the CPU.
4. The payment callback will not be delayed normally. If there is a delay, please check whether there are problems with the network environment
Customer Service Tel
Business Development
9:00-18:00
Monday-Friday GMT+8
Technical Support
WeChat Pay Global
ICP证