You can make a compromise. When the interface has not been approved, the callback is useless. At this time, you can actively initiate a query, that is, on the page where the user scans the code, the backend AJAX can check it once every 10 seconds.
For this question, I don’t agree with @tintchao’s answer because Polling consumes too much performance. The official website also provides applicable scenarios for order inquiry:
Situations where the query interface needs to be called:
When there is an abnormality in the merchant's backend, network, server, etc., the merchant's system does not receive the payment notification in the end;
After calling the payment interface, a system error or unknown transaction status is returned;
Call the scanned payment API and return the status of USERPAYING;
Before calling the custom order or cancellation interface API, you need to confirm the payment status;
Back to the topic, it is recommended that the subject check as follows:
Check whether notify_url is accessible, pay attention to the POST 方式,不是 GET method.
Check the server log to see if there is an IP request from Tencent after calling the relevant API.
Check whether the web interface can accept XML format data requests.
You can make a compromise. When the interface has not been approved, the callback is useless. At this time, you can actively initiate a query, that is, on the page where the user scans the code, the backend AJAX can check it once every 10 seconds.
Check the web server log to see if there are any requests from Tencent’s IP.
Your domain name has been blocked by WeChat
It may be that the payment authorization directory is not set.
No parameters are allowed in the url
Your URL must be accessible from the external network
For this question, I don’t agree with @tintchao’s answer because Polling consumes too much performance. The official website also provides applicable scenarios for order inquiry:
Situations where the query interface needs to be called:
When there is an abnormality in the merchant's backend, network, server, etc., the merchant's system does not receive the payment notification in the end;
After calling the payment interface, a system error or unknown transaction status is returned;
Call the scanned payment API and return the status of USERPAYING;
Before calling the custom order or cancellation interface API, you need to confirm the payment status;
Back to the topic, it is recommended that the subject check as follows:
Check whether notify_url is accessible, pay attention to the
POST
方式,不是GET
method.Check the server log to see if there is an IP request from Tencent after calling the relevant API.
Check whether the web interface can accept XML format data requests.
Hello poster, has your problem been solved now? I am also encountering the same problem now
Make sure the URL is accurate and accessible from the external network
As shown below, determine whether to configure the authorization directory
The poster can search for a software called natapp, which can directly enable external network access locally, which makes debugging easier! !