Last active
September 8, 2020 09:53
-
-
Save LarryUllman/2b2939245b92a1d1eb96 to your computer and use it in GitHub Desktop.
Stripe - PHP - Update Subscription
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 subscription settings: | |
$subscription->trial_end = strtotime('first day of next month 12:00'); | |
// Save the changes: | |
$subscription->save(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment