services:
  _defaults:
    autowire: true
    autoconfigure: true
    public: true

  XCart\Payment\EventAssemblerInterface: '@XCart\Payment\EventAssembler'
  XCart\Payment\EventAssembler:
    arguments:
      $readRepository: '@xcart.repository.payment.transaction.read'
      $argumentsAssembler: '@XCart\Bundle\DoctrineBridgeBundle\Assembler\UpdateOne\Arguments\ArgumentsAssemblerInterface'

  XCart\Event\Payment\PaymentActionEvent:
    autowire: false

  XCart\EventListener\Payment\Offline:
    tags:
      - {name: kernel.event_listener, event: xcart.payment.action.init.xlite.model.payment.processor.offline, method: onPaymentInitAction}
      - {name: kernel.event_listener, event: xcart.payment.action.pay.xlite.model.payment.processor.offline, method: onPaymentPayAction}
      - {name: kernel.event_listener, event: xcart.payment.action.init.xlite.model.payment.processor.phone_ordering, method: onPaymentInitAction}
      - {name: kernel.event_listener, event: xcart.payment.action.pay.xlite.model.payment.processor.phone_ordering, method: onPaymentPayAction}
      - {name: kernel.event_listener, event: xcart.payment.action.init.xlite.model.payment.processor.purchase_order, method: onPaymentInitAction}
      - {name: kernel.event_listener, event: xcart.payment.action.pay.xlite.model.payment.processor.purchase_order, method: onPaymentPayAction}

  XCart\EventListener\Payment\CommonProcess:
    tags:
      - {name: kernel.event_listener, event: xcart.payment.action.before, method: onPaymentActionPreProcess}
      - {name: kernel.event_listener, event: xcart.payment.action.after, method: onPaymentActionPostProcess}

