Skip to content

Commit

Permalink
[Maintenance][Core] Update payment state machine
Browse files Browse the repository at this point in the history
  • Loading branch information
NoResponseMate committed Oct 12, 2023
1 parent df61733 commit 2b6ab98
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
12 changes: 11 additions & 1 deletion UPGRADE-1.13.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,12 @@
- From: `void`
- To: `unknown`

1. In the `sylius_payment` state machine of `PaymentBundle`, a new state `authorized` has been introduced, with the following transition:
1. In the `sylius_payment` state machine of `PaymentBundle`, a new state `authorized` has been introduced, along with new transistion:
- Transition `authorize`:
- From states: [`new`, `processing`]
- To state: `authorized`

Due to that the following transitions have been updated:
- Transition `complete`:
- From states: [`new`, `processing`, `authorized`]
- To state: `completed`
Expand All @@ -190,3 +192,11 @@
- Transition `void`:
- From states: [`new`, `processing`, `authorized`]
- To state: `unknown`

1. The `sylius_payment` state machine of `CoreBundle` has been updated to allow failing an authorized payment:
```diff
fail:
- from: [new, processing]
+ from: [new, processing, authorized]
to: failed
```
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ winzou_state_machine:
from: [new, processing, authorized]
to: completed
fail:
from: [new, processing]
from: [new, processing, authorized]
to: failed
cancel:
from: [new, processing, authorized]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ framework:
from:
- !php/const Sylius\Component\Payment\Model\PaymentInterface::STATE_NEW
- !php/const Sylius\Component\Payment\Model\PaymentInterface::STATE_PROCESSING
- !php/const Sylius\Component\Payment\Model\PaymentInterface::STATE_AUTHORIZED
to: !php/const Sylius\Component\Payment\Model\PaymentInterface::STATE_FAILED
!php/const Sylius\Component\Payment\PaymentTransitions::TRANSITION_CANCEL:
from:
Expand Down

0 comments on commit 2b6ab98

Please sign in to comment.