Using stable Sylius 1.2.0
, how one can mark the order as paid after the offline payment method was selected?
Tried using an after-callback of the sylius_order_payment
state-machine`, but it doesn't seem to fire on any transition:
winzou_state_machine:
sylius_order_payment:
callbacks:
after:
set_order_paid:
on: ['complete']
do: ['@AppBundle\Payment\StateMachine\Callback\CallbackClass', 'updateOrder']
args: ['object']
Is the state machine used at all? Maybe I'm using the wrong one. Any suggestions are welcome. Thank you for your patience.
Update 1
Tomorrow I'm going to try the Completing a Payment with a state machine transition chapter from the documentation. I'm thinking about putting this code inside an event listener listening on Order created resource event, albeit the state machine callback sounds like a better solution.