I am trying to create a recurring payment by using Stripe. It works just fine, but the problem is that I have 4 different payment plans, and the first time the user is paying, I am subscribing him to the lowest plan. Then, if I try to change the subscription, and set it to another plan, just like in their official documentation, it does not work for me. The code from their documentation looks like this:
Stripe::setApiKey("sk_test_cTYCUNuIv8w6NeJcXSoAeLDO");
$cu = Stripe_Customer::retrieve("cus_4keRPGExpTWMwe");
$subscription = $cu->subscriptions->retrieve("sub_4keRoLrCJiHzAq");
$subscription->plan = "gold";
$subscription->save();
If I try to save the subscription, it gives me an error which says that the save method is not defined. Do you know any workarounds?
Thank you.