Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Inquisitive's avatar

How to make payment and booking atomic.

I am trying to make a futsal booking system. Here, a user selects the date as his/her preference and make payments to book it.

But, here I got a problem what if the payment is failed? How can I make this transaction atomic?

This means, book the system if payment is successful or make the payment if the booking is successful. What is the best approach for dealing with this? Any idea would be appreciated.

0 likes
0 replies

Please or to participate in this conversation.