Home  >  Article  >  Backend Development  >  thinkphp automatically cancels transactions

thinkphp automatically cancels transactions

WBOY
WBOYOriginal
2016-08-23 09:17:421244browse

When a transaction occurs between users, if someone sends a transaction request, the system will deduct the person's money, but if another user never accepts the transaction. How should the transaction be automatically canceled at this time and the amount of money deducted be returned to the user?

Reply content:

When a transaction occurs between users, if someone sends a transaction request, the system will deduct the person's money, but if another user never accepts the transaction. How should the transaction be automatically canceled at this time and the amount of money deducted be returned to the user?

Make a task plan, regularly detect which transactions have not been completed, and perform refunds and other operations that have not been executed.

For PHP, the most commonly used method for automatic tasks is cron scheduled execution. Others like guard queues are also possible. In short, a permanent or scheduled processing mechanism is needed.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn