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 670 forks source link

Cannot use proration_date for updating the quantity #1637

Closed skeemer closed 7 months ago

skeemer commented 7 months ago

This works for add_price() and swap() because they have $options[] that get merged.

My suggestion is to do the same thing for update_price() and all of the increment/decrement functions that pass down to it. This would be for Subscription and SubscriptionItem.

I'm willing to put together the PR if that is an acceptable solution.

driesvints commented 7 months ago

Hi @skeemer. What do you mean with update_price? That method doesn't exist in Cashier.

I do agree sending along extra parameter options could be useful. But unfortunately we cannot change the method signatures on a patch release. I'm also not really comfortable polluting the public API with extra methods just to make this happen. So I guess the right option here is to target Cashier Stripe v16. If you can send in a PR we can have a look.

I btw don't know when we'd release that. For now, I suggest to copy the quantity methods into a new method you manage yourself and then swap them for the updated method whenever Cashier v16 gets released.

Thanks!

skeemer commented 7 months ago

I meant updateQuantity(). It would just be adding the $options array parameter the same way addPrice() and swap() do it. I don't think there would be any new methods.

driesvints commented 7 months ago

. It would just be adding the $options array parameter

Yeah that's what I'm trying to tell. We cannot do that. It'll be a breaking change. For example, any apps overwriting that method will break because the method signature doesn't matches anymore. It'll have to go into the next release.