Demo: payment declined, compensations run
On This Lesson 3 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
exercise the failure path end to end. Prepares MID-031-LAB1.
Draft outline details
Step by step
- Use a test card number that
paymentsdeclines. paymentsrepliesPaymentDeclined; the saga moves toCOMPENSATING.- The orchestrator sends
ReleaseStock;inventoryreleases the reservation; the order becomesCANCELLED. - Planned mistake: write the compensation assuming a reservation exists; trigger the decline before stock replied and it throws. Fix: tolerate a missing reservation and record the cancellation.
- Replay
ReleaseStockand confirm stock is unchanged the second time. - Add a timeout case: stop
payments; after the deadline the saga compensates.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.