php - The third-party payment platform notifies multiple times asynchronously in a short period of time, and the order is confirmed and collected multiple times.
ringa_lee
ringa_lee 2017-05-25 15:08:25
0
4
922

Third-party payment asynchronous notification notifies the callback address multiple times. The previous notification request has not been processed yet, and the subsequent request is sent, resulting in multiple confirmations of receipt. How to solve it

ringa_lee
ringa_lee

ringa_lee

reply all(4)
左手右手慢动作

Payment needs to be processed according to a unique ID, such as transaction number, serial number, etc. It is impossible to allow multiple repetitions.

Ty80

When a request comes, first update the record status in the db from the initial state to an intermediate state
Then process the request, update the intermediate state to the processing completion state
and then return a message to the third-party asynchronous request

PHPzhong

What I’m curious about is, multiple times in a short period of time, so how many times in a short period of time?

  • For example, 5-10 times in 10 seconds, you should consider optimizing your code. Why can't you process one request in 1 second? After the first one is processed, subsequent requests are ignored.

  • For example, 5-10 times in 1 second, simple processing is to queue up and turn concurrent requests into serial ones, which can be solved.

For the above, I feel that if the frequency is so high, there must be something wrong, and I can find a third-party platform to raise it.

Ty80

After the program is processed, it will return success to the third party, otherwise it will fail. The third party will not make any more requests after receiving the success, otherwise the IP address will be blocked easily. This kind of problem should be written in the document for third parties to see

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!