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

Unable to resume() multi-plan subscription. #921

Closed rambo666 closed 4 years ago

rambo666 commented 4 years ago

Description:

Resuming the subscription works fine if there is single subscription. If I have multplan subscription and try to resume the canceled subscription it throws stripe error

Stripe \ Exception \ InvalidRequestException

Whenever I try to resume a plan that has subscription Item [on Multiplan] I get this error

You passed an empty string for 'plan'. We assume empty values are an attempt to unset a parameter; however 'plan' cannot be unset. You should remove 'plan' from your request or supply a non-empty value.

Steps To Reproduce:

Remove

$subscription->plan = $this->stripe_plan;

from resume function. This will not work with multiplan. I dont think there is a need to put this line of code even thought it is a single plan subscription. Just updating the cancel_at_period_end should be fine from the stripe point of view

driesvints commented 4 years ago

I actually removed it at first and re-added it because I wasn't sure if removing it was a right idea. I'll fix this and add a dedicated test case for resuming multiplan subscriptions. Thanks for reporting.

driesvints commented 4 years ago

PR: https://github.com/laravel/cashier/pull/925