services:
  _defaults:
    autowire: true
    autoconfigure: true

  xcart.logic.storefront.payment.action.get_one.action:
    class: XCart\Logic\Action\Storefront\PaymentAction\GetOne\Action
    arguments:
      $responseFactory: '@xcart.logic.storefront.payment.action.get_one.action.factory.response'
    tags:
      - {name: xcart.logic.action, request: XCart\Logic\Action\Storefront\Payment\Action\GetOne\DTO\Request, response: XCart\Logic\Action\Storefront\Payment\Action\GetOne\DTO\Response}

  xcart.logic.storefront.payment.action.update_one.action.arguments_assembler:
    class: XCart\Bundle\DoctrineBridgeBundle\Assembler\UpdateOne\Arguments\IdBasedArgumentsAssembler
    arguments:
      $idFieldName: 'publicTxnId'

  # This need to be removed after ECOM-3177, right now it is no way to set custom $argumentsAssembler
  xcart.logic.storefront.payment.action.update_one.action:
    class: XCart\Bundle\DoctrineBridgeBundle\Action\UpdateOneAction
    arguments:
      $writeRepository: '@xcart.repository.payment.transaction.write'
      $argumentsAssembler: '@xcart.logic.storefront.payment.action.update_one.action.arguments_assembler'
      $entityEnricher: '@xcart.logic.storefront.payment.action.update_one.entity.enricher'
      $responseAssembler: '@xcart.logic.storefront.payment.action.update_one.response.assembler'
    tags:
      - {name: xcart.logic.action, request: XCart\Logic\Action\Storefront\Payment\Action\UpdateOne\DTO\Request, response: XCart\Logic\Action\Storefront\Payment\Action\UpdateOne\DTO\Response}

  XCart\Logic\Action\Storefront\PaymentAction\UpdateOne\PaymentActionDecorator:
    decorates: xcart.logic.storefront.payment.action.update_one.action
    arguments:
      $inner: '@.inner'

  XCart\Logic\Action\Storefront\PaymentAction\UpdateOne\Enricher\EntityEnricher:
    decorates: xcart.logic.storefront.payment.action.update_one.entity.enricher.internal
