2

I have a functionality where I need to upgrade a plan for a subscription but only on the next billing cycle. Default behaviour, when using swap() method, is that the prorate is calculated and then Cashier figures out how much to charge. In my case that is not a good scenario since i'm selling fixed amounts through another table and my quantity is always 1. I've manage to find a partial solution and implement it like this:

$customer->subscription($current_subscription->name)->noProrate()->swap($plan->plan_id);

And it does not calculate prorate, which is fine, however it upgrades the plan immediately without charging the customer. I'm looking for either to delay this upgrade until the next billing cycle (have a webhook tell me when to switch plans, or to charge the customer right away, which probably isn't the best solution). I couldn't find anything on Cashier docs i'm wandering is there a solution to this, or should I just go with manually implementing logic for canceling the plan and then staring a new one with the trial.

Nermin Sehic
  • 594
  • 6
  • 22

0 Answers0