laravel / cashier-stripe

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.
https://laravel.com/docs/billing
MIT License
2.37k stars 671 forks source link

Use TaxRates instead of tax_percent #657

Closed kennethsinder closed 4 years ago

kennethsinder commented 5 years ago

With the recent ship of EU invoicing and TaxRates by Stripe Billing as the new way to model taxes, it might be a good first step to update syncTaxPercentage() in Subscription to create TaxRate objects instead of setting it via the deprecated tax_percent.

This would involve:

There are no direct immediate benefits of doing this, but it unlocks:

This can be done separately from Payment Intent / SCA support which is already listed as a separate issue (https://github.com/laravel/cashier/issues/636) in this repo, but it seems like a modest step that can unlock richer tax functionality.

driesvints commented 5 years ago

Heya, thanks for the detailed issue! I'll be happy to look into this further but only after we've made all the changes for the upcoming v10 release. We might be able to get this in that release as well but for now I'd like to focus on getting payment intents support into Cashier.

kennethsinder commented 5 years ago

Awesome, sounds good! I should have clarified I'm offering to try implementing this myself but it sounds like you're looking to finalize v10 first, but if it becomes a good time for me to jump in, let me know!

lucidlive commented 5 years ago

Would greatly appreciate this feature!

ReckeDJ commented 5 years ago

Awesome. This is definitely something that we need to operate in different countries in the EU (and outside the EU later). Maybe I can help in some way, just let me know.

azatotht commented 5 years ago

This would be great indeed. We need to be able to charge 2 different taxes in Stripe (Canadian federal and provincial taxes) which both have different rates. If I understand well, we need this update in order to be able to do that in the new Stripe API, right now we can only have one tax amount.

pierrocknroll commented 4 years ago

I think this could be taken into account now since Cashier 10 is out

johnRivs commented 4 years ago

Is the new Tax Rate the only way to apply an inclusive tax percentage to a new subscription? Currently, every subscription I start with Cashier is creating and reusing an exclusive tax rate instead of using the inclusive one I have set up.

If this proposal would help with this, that'd be awesome.

lsmith77 commented 4 years ago

@kennethsinder did you ever turn your very concrete suggestions into a PR?

pierrocknroll commented 4 years ago

I created a small PR #818. With it, you can add a taxRates method in your Billable model that returns an array of TaxRates ids to add to the Subscription creation.

kennethsinder commented 4 years ago

@kennethsinder did you ever turn your very concrete suggestions into a PR?

Hi @lsmith77, nope I didn't get a chance to yet and I didn't get the go-ahead from any of the repo maintainers. I'm new to open source so I didn't want to code anything up before hearing back. Sounds like @pierrocknroll, @driesvints and Taylor Otwell have it under control in #818 😄

driesvints commented 4 years ago

I'm gonna start working on this tomorrow.

driesvints commented 4 years ago

WIP pr here: https://github.com/laravel/cashier/pull/830

driesvints commented 4 years ago

I just finished up the PR for this. I'd really appreciate any feedback before it gets merged. Please comment on the PR.

https://github.com/laravel/cashier/pull/830