Skip to content

Instantly share code, notes, and snippets.

@LarryUllman
Last active September 8, 2020 09:53
Show Gist options
  • Save LarryUllman/2b2939245b92a1d1eb96 to your computer and use it in GitHub Desktop.
Save LarryUllman/2b2939245b92a1d1eb96 to your computer and use it in GitHub Desktop.
Stripe - PHP - Update Subscription
// 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