Skip to content
Ameen Abozaid
Planned lessonMID-031-L08

Demo: payment declined, compensations run

  • Lesson 8 of 8
  • Mid-level
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

  1. Use a test card number that payments declines.
  2. payments replies PaymentDeclined; the saga moves to COMPENSATING.
  3. The orchestrator sends ReleaseStock; inventory releases the reservation; the order becomes CANCELLED.
  4. 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.
  5. Replay ReleaseStock and confirm stock is unchanged the second time.
  6. Add a timeout case: stop payments; after the deadline the saga compensates.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Type to search levels, phases, modules and lessons.