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?
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.