database - Handling multiple commands as transaction -
im developing payment system performs payment , writes item bought in cloud hosted database, azure.
how works is:
- transaction 3rd party payment system
- if success, new subscription row in database added user
- transaction history , other relevant stuff written database
however, in unlikely event that:
- transaction success(http call payment gateway returns success)
- 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
Post a Comment