Backend & systems·Transactions and isolation
you cannot roll back the payment you already captured, so you issue a refund that puts the world approximately back.
Compensating transaction
A business-level operation that semantically reverses an earlier committed one. It is the only rollback available once a step has left your system. The gap between "reversed" and "never happened" is where the interesting bugs live: the email was sent, the webhook fired, the inventory was briefly visible as sold.