winzou_state_machine:
    sylius_payment:
        class: "%sylius.model.payment.class%"
        property_path: state
        graph: sylius_payment
        state_machine_class: "%sylius.state_machine.class%"
        states:
            cart: ~
            new: ~
            processing: ~
            authorized: ~
            completed: ~
            failed: ~
            cancelled: ~
            refunded: ~
        transitions:
            create:
                from: [cart]
                to: new
            process:
                from: [new]
                to: processing
            authorize:
                from: [new, processing]
                to: authorized
            complete:
                from: [new, processing, authorized]
                to: completed
            fail:
                from: [new, processing, authorized]
                to: failed
            cancel:
                from: [new, processing, authorized]
                to: cancelled
            refund:
                from: [completed]
                to: refunded
        callbacks:
            after:
                sylius_process_order:
                    on: ["fail", "cancel"]
                    do: ["@sylius.order_processing.order_payment_processor.after_checkout", "process"]
                    args: ["object.getOrder()"]
                    priority: -100
                sylius_resolve_state:
                    on: ["complete", "process", "refund", "authorize"]
                    do: ["@sylius.state_resolver.order_payment", "resolve"]
                    args: ["object.getOrder()"]
                    priority: -100
