services:

  flux_se.sylius_payum_stripe.action.convert_payment:
    public: true
    class: FluxSE\SyliusPayumStripePlugin\Action\ConvertPaymentAction
    arguments:
      $detailsProvider: '@flux_se.sylius_payum_stripe.provider.details'
    tags:
      - name: payum.action
        factory: stripe_checkout_session
        alias: flux_se.sylius_payum_stripe.convert_payment

  flux_se.sylius_payum_stripe.extension.update_payment_state:
    public: true
    class: FluxSE\SyliusPayumStripePlugin\Extension\UpdatePaymentStateExtension
    arguments:
      $factory: '@sm.factory'
      # Alias of "@payum.storage.sylius_component_core_model_payment"
      # or "@payum.storage.app_entity_payment_payment" or any other available
      # Payum storage handling Payment entity
      $storage: '@payum.storage.flux_se_sylius_payment'
      $getStatusRequestFactory: '@sylius.factory.payum_get_status_action'
    tags:
      - name: payum.extension
        factory: stripe_checkout_session
        alias: flux_se.sylius_payum_stripe.extension.update_payment_state

  flux_se.sylius_payum_stripe.extension.cancel_existing_payment_intent:
    public: true
    class: FluxSE\SyliusPayumStripePlugin\Extension\CancelExistingPaymentIntentExtension
    arguments:
      $cancelPaymentIntentRequestFactory: '@flux_se.sylius_payum_stripe.factory.cancel_payment_intent_request'
    tags:
      - name: payum.extension
        factory: stripe_checkout_session
        alias: flux_se.sylius_payum_stripe.extension.cancel_existing_payment_intent