WeChat Pay after the success of the callback function has not been completed, the user exited the page, how to solve?

yesterday, the company"s project was launched and suddenly found that many users reported that they were still waiting for payment after the successful payment of their order.



1

clipboard.png

it seems that the callback has no effect because many people close the page directly after loading for too long after WeChat Pay"s success. If you wait patiently to load, you won"t have this problem, so how do you solve it like this?


payment callback includes Synchronize callback and asynchronous callback

  1. Synchronize means that the user continues the current business logic after the payment is completed
  2. asynchronism means that the user leaves after the payment is completed. At this time, Wechat requests your interface many times within a certain period of time. If he knows that your interface returns true, he will not request it. This API can continue to do the logic after successful payment
  3. .

https://pay.weixin.qq.com/wik.


jshttps://pay.weixin.qq.com/wik...





clipboard.png

Menu