invoice.created event while still creating invoice in create_subscription
InvoiceService#apply_vat tries to apply VAT again becauses Invoice#added_vat? is not true yet because the create_subscription method is still executing.
The calls to InvoiceService#ensure_invoice could also lead to duplicate invoices for the same Stripe invoice.
invoice.payment_succeeded event while still creating invoice in create_subscription
invoice.created
event while still creating invoice increate_subscription
InvoiceService#apply_vat
tries to apply VAT again becausesInvoice#added_vat?
is not true yet because thecreate_subscription
method is still executing.The calls to
InvoiceService#ensure_invoice
could also lead to duplicate invoices for the same Stripe invoice.invoice.payment_succeeded
event while still creating invoice increate_subscription
Could also lead to duplicate invoices.