We are switching to Stripe's tax_percent instead of the hacky method to add taxes to invoices. We had some problems where taxes could not be added to invoices anymore because they were already closed on creation. The logic behind this is rather complex, Stripe's suggestion is to move to tax_percent as well.
What's changed
The Billbo subscription create call doesn't do the hacky VAT invoiceitem adding anymore but just calculates the tax_percent and sets that on the subscription.
We don't catch the invoice.created hook anymore. We did that to add VAT to invoices but that'll happen automatically by Stripe now (because of the tax_percent on the subscription).
The invoice.payment_succeeded hook creates the internal Billbo invoice. This means that no unpaid invoices will be present in Billbo anymore. We don't have to the complex calculations to figure out the final discount and VAT amount anymore, we can just get those from the Stripe invoice. Easy as that!
Migration
Deploy Billbo. Hooks to invoice.created will now fail to avoid invoices being closed & paid during the migration period. This gives us time to add the correct tax_percent to these invoices.
Run the migration script to add the correct tax percent to all subscriptions AND add the correct tax_percent to all unpaid invoices.
Deploy Billbo without the failing invoice.created hook.
We are switching to Stripe's
tax_percent
instead of the hacky method to add taxes to invoices. We had some problems where taxes could not be added to invoices anymore because they were already closed on creation. The logic behind this is rather complex, Stripe's suggestion is to move totax_percent
as well.What's changed
tax_percent
and sets that on the subscription.invoice.created
hook anymore. We did that to add VAT to invoices but that'll happen automatically by Stripe now (because of thetax_percent
on the subscription).invoice.payment_succeeded
hook creates the internal Billbo invoice. This means that no unpaid invoices will be present in Billbo anymore. We don't have to the complex calculations to figure out the final discount and VAT amount anymore, we can just get those from the Stripe invoice. Easy as that!Migration
invoice.created
will now fail to avoid invoices being closed & paid during the migration period. This gives us time to add the correcttax_percent
to these invoices.invoice.created
hook.