Reputation: 9890
I am trying to implement the quantity increment with the Laravel Cashier which uses Stripe. I am able to set the quantity when I create a new subscription like this:
// THIS WORKS!
$user = User::find(4);
$user->subscription('monthly')->quantity(5)->create($token);
But when I try to update the quantity number to an existing subscription, it doesnt work:
$user = User::find(4);
$user->subscription()->increment(5);
// This doesnt work neither
$user->subscription()->updateQuantity(5);
When I go to Stripe's Payment page, its still on 1 quantity and doesn't show the increased quantity there. What have I got wrong? Am I supposed to get the token and pass the token again even on update? I read the Laravel doc and followed it as it says: http://laravel.com/docs/5.1/billing#subscription-quantity
I've got laravel 5.1
Upvotes: 1
Views: 860
Reputation: 9890
Okay, I misunderstood how stripe shows the subscription increment()
. Basically, the reason the increment wasnt showing in the payment page is because the payment for the increment update is not processed immediately. The increment will be added to the pending invoice where the amount is adjusted pro-rata based. So this means, in the next billing cycle, the user will be charged the following:
1) Refund of the pro-rata based unused time on that plan after the increment change
2) + Remaining time on the month for the increment + 1
number of plans from the date of change to billing date
3) + 1 month advance of the increment + 1
number of plans from the billing date.
These charges will be listed in the next invoice and the payment will be processed in the next billing date.
Upvotes: 1