# This file is part of the Sylius package.
# (c) Sylius Sp. z o.o.

sylius_shop_order_thank_you:
    path: /thank-you
    methods: [GET]
    defaults:
        _controller: sylius.controller.order::thankYouAction
        _sylius:
            template: "@SyliusShop/order/thank_you.html.twig"

sylius_shop_order_pay:
    path: /{tokenValue}/pay
    methods: [GET]
    defaults:
        _controller: sylius_shop.controller.order_pay::payAction
        _sylius:
            redirect:
                route: sylius_shop_order_after_pay

sylius_shop_order_after_pay:
    path: /after-pay/{hash?}
    methods: [GET, POST]
    defaults:
        _controller: sylius_shop.controller.order_pay::afterPayAction

sylius_shop_order_show:
    path: /{tokenValue}
    methods: [GET, PUT]
    defaults:
        _controller: sylius.controller.order::updateAction
        _sylius:
            template: "@SyliusShop/order/show.html.twig"
            repository:
                method: findOneBy
                arguments: [tokenValue: $tokenValue]
            form:
                type: Sylius\Bundle\CoreBundle\Form\Type\Checkout\SelectPaymentType
                options:
                    validation_groups: [sylius_order_pay]
            redirect:
                route: sylius_shop_order_pay
                parameters:
                    tokenValue: resource.tokenValue
            flash: false
