imports:
  - { resource: ../common.yml }

services:
  resursbank.merchantapi.autoloader:
    file: '%modules_dir%/resursbank/src/EventListener/KernelRequest/Autoloader.php'
    class: 'Resursbank\MerchantApi\EventListener\KernelRequest\Autoloader'
    tags:
      - { name: kernel.event_listener, event: kernel.request, method: 'exec', priority: 2 }

  resursbank.merchantapi.configure.ecom:
    class: 'Resursbank\MerchantApi\EventListener\KernelRequest\ConfigureEcom'
    arguments:
      - '@resursbank.merchantapi.service.ecom'
    tags:
      - { name: kernel.event_listener, event: kernel.request, method: 'exec', priority: 1 }

  resursbank.merchantapi.twig.translation.filter:
    class: 'Resursbank\MerchantApi\EventListener\KernelRequest\TwigTranslations'
    arguments:
      - '@twig'
    tags:
      - { name: kernel.event_listener, event: kernel.request, method: 'exec', priority: 0 }

  resursbank.merchantapi.controller.admin.config.save:
    class: 'Resursbank\MerchantApi\Controller\Admin\Config\Save'
    arguments:
      - '@resursbank.merchantapi.logger'
      - '@resursbank.merchantapi.config.form.data.provider'
    public: true

  resursbank.merchantapi.controller.admin.config.get.stores:
      class: 'Resursbank\MerchantApi\Controller\Admin\Config\GetStores'
      arguments:
        - '@resursbank.merchantapi.config'
      public: true

  resursbank.merchantapi.controller.admin.config.callback.test:
      class: 'Resursbank\MerchantApi\Controller\Admin\Config\CallbackTest'
      arguments:
          - '@resursbank.merchantapi.service.callbacktest'
      public: true

  resursbank.merchantapi.controller.admin.config.clear.cache:
      class: 'Resursbank\MerchantApi\Controller\Admin\Config\ClearCache'
      arguments:
        - '@resursbank.merchantapi.service.ecom'
      public: true

  resursbank.merchantapi.config.form.data.provider:
    class: 'Resursbank\MerchantApi\Config\Form\DataProvider'
    arguments:
      - '@resursbank.merchantapi.config'
      - '@resursbank.merchantapi.logger'
      - '@resursbank.merchantapi.service.ecom'
      - '@=service("translator")'
    public: true

  resursbank.merchantapi.config.form.builder.api:
    class: 'Resursbank\MerchantApi\Config\Form\Builder\Api'
    public: true

  resursbank.merchantapi.config.form.builder.advanced:
    class: 'Resursbank\MerchantApi\Config\Form\Builder\Advanced'
    public: true

  resursbank.merchantapi.config.form.builder.callbacks:
      class: 'Resursbank\MerchantApi\Config\Form\Builder\Callbacks'
      public: true

  resursbank.merchantapi.config.form.builder.partpayment:
    class: 'Resursbank\MerchantApi\Config\Form\Builder\Partpayment'
    public: true

  resursbank.merchantapi.config.form:
    class: 'Resursbank\MerchantApi\Config\Form\Builder'
    arguments:
      - '@=service("form.factory")'
      - '@resursbank.merchantapi.config.form.data.provider'
      - '@=service("router")'
      - '@resursbank.merchantapi.config'
      - '@resursbank.merchantapi.logger'
    public: true

  resursbank.merchantapi.controller.admin.config.view:
    class: 'Resursbank\MerchantApi\Controller\Admin\Config\View'
    arguments:
      - '@resursbank.merchantapi.logger'
      - '@resursbank.merchantapi.config.form'
      - '@resursbank.merchantapi.config'
      -
    public: true

  resursbank.merchantapi.service.callbacktest:
      class: 'Resursbank\MerchantApi\Service\CallbackTest'
      arguments:
          - '@resursbank.merchantapi.config'

  resursbank.merchantapi.repository.resursbank_order:
    class: 'Resursbank\MerchantApi\Repository\ResursbankOrder'
    arguments:
      - '@resursbank.merchantapi.config'
      - '@doctrine.orm.default_entity_manager'
    public: true

  resursbank.merchantapi.hook.display_admin_order_main:
    class: 'Resursbank\MerchantApi\Hook\DisplayAdminOrderMain'
    arguments:
      - '@resursbank.merchantapi.repository.resursbank_order'
      - '@=service("router")'
    public: true

  resursbank.merchantapi.hook.action_get_admin_order_buttons:
    class: 'Resursbank\MerchantApi\Hook\ActionGetAdminOrderButtons'
    arguments:
      - '@=service("router")'
      - '@resursbank.merchantapi.repository.resursbank_order'
      - '@resursbank.merchantapi.config'
    public: true

  resursbank.merchantapi.hook.action_order_slip_add:
    class: 'Resursbank\MerchantApi\Hook\ActionOrderSlipAdd'
    arguments:
      - '@resursbank.merchantapi.repository.resursbank_order'
    public: true

  resursbank.merchantapi.hook.action_order_edited:
    class: 'Resursbank\MerchantApi\Hook\ActionOrderEdited'
    arguments:
      - '@resursbank.merchantapi.repository.resursbank_order'
    public: true

  resursbank.merchantapi.hook.action_update_shipping_action:
    class: 'Resursbank\MerchantApi\Hook\ActionUpdateShippingAction'
    arguments:
      - '@resursbank.merchantapi.repository.resursbank_order'
    public: true

  resursbank.merchantapi.service.migration:
    class: 'Resursbank\MerchantApi\Service\Migration'
    arguments:
      - '@resursbank.merchantapi.config'
    public: true

  resursbank.merchantapi.controller.admin.order.capture:
    class: 'Resursbank\MerchantApi\Controller\Admin\Order\Capture'
    arguments:
      - '@resursbank.merchantapi.config'
      - '@session'
      - '@request_stack'
      - '@resursbank.merchantapi.repository.resursbank_order'
    public: true

  resursbank.merchantapi.controller.admin.order.cancel:
    class: 'Resursbank\MerchantApi\Controller\Admin\Order\Cancel'
    arguments:
      - '@resursbank.merchantapi.config'
      - '@session'
      - '@request_stack'
      - '@resursbank.merchantapi.repository.resursbank_order'
    public: true

  resursbank.merchantapi.controller.admin.order.refund:
    class: 'Resursbank\MerchantApi\Controller\Admin\Order\Refund'
    arguments:
      - '@resursbank.merchantapi.config'
      - '@session'
      - '@request_stack'
      - '@resursbank.merchantapi.repository.resursbank_order'
    public: true

  PrestaShopBundle\Controller\Admin\Sell\Order\OrderController:
    class: 'Resursbank\MerchantApi\Controller\Admin\Order\OrderController'
    public: true

  resursbank.merchantapi.controller.admin.order.reload.payment.information:
      class: 'Resursbank\MerchantApi\Controller\Admin\Order\ReloadPaymentInformation'
      public: true
