What happens when I initiate a transaction to say Citrus, or Ccavenue or PayUmoney or any payment gateways, and the money is deducted on the client side and my server fails the time it was about to receive the response, and on the response I need to update a few columns in the DB for that particular client ? How should it be handled?I use Mysql as the database and Laravel.
This could handle by a separate queue service like Laravel Queue(https://laravel.com/docs/5.6/queues)
Also make sure you have an API to check the payment status.Most of the payment gateways are providing API interface to check the payment status.
Queue service should be running as a server process isolated from the client application.So your payment cycle won't be break at any outages/delays(network timeouts,server outages,etc...)