Created
July 23, 2014 13:43
-
-
Save LarryUllman/0db8a6c5a9ec355c0ccb to your computer and use it in GitHub Desktop.
Stripe - PHP - Upgrade Subscription Plan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Retrieve the customer: | |
$customer = Stripe_Customer::retrieve($customer_id); | |
// Retrieve the subscription being updated: | |
$subscription = $customer->subscriptions->retrieve($subscription_id); | |
// Change the plan: | |
$subscription->plan = '25_monthly'; // Was 10_monthly | |
// Use proration (default; not required): | |
$subscription->prorate = true; | |
// Save the changes: | |
$subscription->save(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment