parameters:
    flux_se.sylius_stripe.processor.webhook_event.checkout_session:
        'stripe_checkout':
            - !php/const Stripe\Event::CHECKOUT_SESSION_COMPLETED
            - !php/const Stripe\Event::CHECKOUT_SESSION_EXPIRED
            - !php/const Stripe\Event::CHECKOUT_SESSION_ASYNC_PAYMENT_FAILED
            - !php/const Stripe\Event::CHECKOUT_SESSION_ASYNC_PAYMENT_SUCCEEDED
    flux_se.sylius_stripe.processor.webhook_event.payment_intent:
        'stripe_web_elements':
            - !php/const Stripe\Event::PAYMENT_INTENT_SUCCEEDED
            - !php/const Stripe\Event::PAYMENT_INTENT_CANCELED
            - !php/const Stripe\Event::PAYMENT_INTENT_PROCESSING

services:
    
    flux_se.sylius_stripe.processor.payment_transition.checkout:
        class: FluxSE\SyliusStripePlugin\Processor\Checkout\SessionTransitionProcessor
        arguments:
            - '@flux_se.sylius_stripe.processor.transition.checkout.session'
            - '@sylius_abstraction.state_machine'
    
    flux_se.sylius_stripe.processor.payment_transition.web_elements:
        class: FluxSE\SyliusStripePlugin\Processor\WebElements\PaymentIntentTransitionProcessor
        arguments:
            - '@flux_se.sylius_stripe.processor.transition.web_elements.payment_intent'
            - '@sylius_abstraction.state_machine'

    FluxSE\SyliusStripePlugin\Processor\NotifyPayloadProcessor:
        decorates: sylius.processor.payment_request.notify_payload
        arguments:
            - '@.inner'
            - '%flux_se.sylius_stripe.factories%'
    
    flux_se.sylius_stripe.processor.webhook_event.checkout.composite:
        class: FluxSE\SyliusStripePlugin\Processor\CompositeWebhookEventProcessor
        arguments:
            - !tagged_iterator flux_se.sylius_stripe.processor.webhook_event.checkout
    
    flux_se.sylius_stripe.processor.webhook_event.web_elements.composite:
        class: FluxSE\SyliusStripePlugin\Processor\CompositeWebhookEventProcessor
        arguments:
            - !tagged_iterator flux_se.sylius_stripe.processor.webhook_event.web_elements
        
    
    flux_se.sylius_stripe.processor.webhook_event.checkout.checkout_session:
        class: FluxSE\SyliusStripePlugin\Processor\WebhookEventProcessor
        arguments:
            - '%flux_se.sylius_stripe.processor.webhook_event.checkout_session%'
            - '@flux_se.sylius_stripe.manager.checkout.retrieve'
        tags:
            - name: flux_se.sylius_stripe.processor.webhook_event.checkout
        
    flux_se.sylius_stripe.processor.webhook_event.web_elements.payment_intent:
        class: FluxSE\SyliusStripePlugin\Processor\WebhookEventProcessor
        arguments:
            - '%flux_se.sylius_stripe.processor.webhook_event.payment_intent%'
            - '@flux_se.sylius_stripe.manager.web_elements.retrieve'
        tags:
            - name: flux_se.sylius_stripe.processor.webhook_event.web_elements
