czende / gopay-plugin

💳 Sylius GoPay payment gateway plugin 💳
MIT License
8 stars 6 forks source link

Sylius payment callbacks are fired twice #5

Open Holicz opened 3 years ago

Holicz commented 3 years ago

Hi there,

I am using this plugin on my Sylius eshop and I got a problem when some orders which are paid through GoPay fire the payment events twice.

My events are configured like this:

winzou_state_machine:
    sylius_payment:
        callbacks:
            after:
                generate_invoice:
                    on: [ 'complete' ]
                    do: [ '@App\StateMachine\Order\Callback\InvoiceGenerator', 'generateInvoice' ]
                    args: [ 'object' ]

Which e.g. means that most of the orders generated two invoices, send users duplicate emails, etc.

Am I doing something wrong?