piesync / billbo

Easy to use billing service for Stripe with VAT support
MIT License
73 stars 3 forks source link

Race conditions #53

Closed challengee closed 10 years ago

challengee commented 10 years ago

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

Could also lead to duplicate invoices.