A checkout flow must charge the customer through an external Payment Gateway, then update order and inventory state. These steps span multiple services and can fail independently — a payment might succeed while an inventory update fails, or vice versa. The system must avoid double-charging and stay consistent without a single distributed transaction.
Requirements
·Payments must not be double-charged even if a request is retried
·The system must handle partial failure (e.g. payment succeeds but a downstream update fails) without leaving inconsistent state
·Credentials for the external payment processor must not be hardcoded into services
·A flaky external payment processor should not directly block the checkout request thread indefinitely
·Payments must not be double-charged even if a request is retried
·The system must handle partial failure (e.g. payment succeeds but a downstream update fails) without leaving inconsistent state
·Credentials for the external payment processor must not be hardcoded into services
·A flaky external payment processor should not directly block the checkout request thread indefinitely