# 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/thankYou.html.twig"

sylius_shop_order_pay:
    path: /{tokenValue}/pay
    methods: [GET]
    defaults:
        _controller: sylius.controller.payum::prepareCaptureAction
        _sylius:
            redirect:
                route: sylius_shop_order_after_pay

sylius_shop_order_after_pay:
    path: /after-pay
    methods: [GET, POST]
    defaults:
        _controller: sylius.controller.payum::afterCaptureAction

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
