|
|
|
|
|
by batou
3994 days ago
|
|
ERP call is atomic and happens first. All that says Is "can I have 2kg of potatoes for 10mins please?" If that returns a success code then you can process the payment. Also if the ERP says "in ten days you can have that amount of potatoes" you can ask for a longer reservation and issue the payment later. Its all about careful ordering and atomicity at the service level and determining what must be done synchronously and what can be done asynchronously. |
|
1. reservation is placed.
2. Payment succeeds, but either success is not known, the process requesting payment crashes before the response, etc.
3. ???
Since we never got to telling ERP "hey, that reservation will be permanent because the payment succeeded", but the payment succeeded… what do you do? Does the reservation expire (but my potatoes!)? How do you even know that the payment succeeded, if perhaps a network connection goes dark and requires 2h to fix?