Skip to content

Commit

Permalink
Add Transaction event flow section
Browse files Browse the repository at this point in the history
  • Loading branch information
IKarbowiak committed Sep 13, 2024
1 parent 7f96cf0 commit 3385f75
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docs/developer/payments/lifecycle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -334,3 +334,31 @@ for `transaction.canceledAmount` will not take into account the amount from `CAN
If an `CANCEL_FAILURE` event is related to an `CANCEL_REQUEST` event by `pspReference`, then the `transactionItem.cancelPendingAmount`
will be reduced by the amount reported in the `CANCEL_FAILURE` event. If there is no related `CANCEL_REQUEST`, the failure event will only
be used to provide the history of `transactionItem` actions.


## Transaction event flow

Transaction events modify the amount fields, which define the state of the transaction.
We do not require any specific order of up comming events, the transaction amounts will be calculated
based on the rules described [above](#transaction-event-types).
But to maintain accuracy and integrity, it is important that events are triggered in a valid order.
The chart below illustrates the possible sequence of events that can follow one another.
Failure to adhere to these guidelines may result in negative values and data inconsistencies.

```mermaid
stateDiagram-v2
direction LR
AUTHORIZATION
CHARGE
CANCEL
REFUND
AUTHORIZATION --> CHARGE
CHARGE --> AUTHORIZATION
CHARGE --> REFUND
REFUND --> CHARGE
AUTHORIZATION --> CANCEL
CANCEL --> AUTHORIZATION
```

0 comments on commit 3385f75

Please sign in to comment.