database - Handling multiple commands as transaction -


im developing payment system performs payment , writes item bought in cloud hosted database, azure.

how works is:

  1. transaction 3rd party payment system
  2. if success, new subscription row in database added user
  3. transaction history , other relevant stuff written database

however, in unlikely event that:

  1. transaction success(http call payment gateway returns success)
  2. for reason, insert in database fails

i end user having paid item without actual subscription item.(since row wont in our database)

these 2 calls not database related (one is, 1 simple async http request) cannot treat them transaction( since cant rollback ).

so question more experienced how handle situation?


Comments

Popular posts from this blog

python - Best design pattern for collection of objects -

go - serving up pdfs using golang -

python - django admin: changing the way a field (w/ relationship to another model) is submitted on a form so that it can be submitted multiple times -