Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Use messenger #51

Merged
merged 1 commit into from
Jan 10, 2024
Merged

[Feature] Use messenger #51

merged 1 commit into from
Jan 10, 2024

Conversation

Prometee
Copy link
Member

@Prometee Prometee commented Jan 10, 2024

Use messenger to be able to retry Stripe API call in case it fails:

  • Refund
  • Cancel
  • CaptureAuthorized

This PR will allow devs to choose to make this call async by configuring messenger for those 3 Commands :

  • FluxSE\SyliusPayumStripePlugin\Command\CancelPayment
  • FluxSE\SyliusPayumStripePlugin\Command\CaptureAuthorizedPayment
  • FluxSE\SyliusPayumStripePlugin\Command\RefundPayment

Example of a messenger config to execute those commands asynchronously:

framework:
    messenger:
        reset_on_message: true
        transports:
            main:
                dsn: '%env(SYLIUS_MESSENGER_TRANSPORT_MAIN_DSN)%'
                failure_transport: main_failed
            main_failed:
                dsn: '%env(SYLIUS_MESSENGER_TRANSPORT_MAIN_FAILED_DSN)%'
        routing:
            'FluxSE\SyliusPayumStripePlugin\Command\CancelPayment': main
            'FluxSE\SyliusPayumStripePlugin\Command\CaptureAuthorizedPayment': main
            'FluxSE\SyliusPayumStripePlugin\Command\RefundPayment': main

@Prometee Prometee force-pushed the admin-messenger branch 2 times, most recently from 9c9ba33 to 0daaa63 Compare January 10, 2024 14:35
@Prometee Prometee merged commit 7ee8088 into master Jan 10, 2024
39 checks passed
@Prometee Prometee deleted the admin-messenger branch January 10, 2024 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant