The createSubscription()
method takes a CreateSubscriptionRequest
object as its second parameter.
$request = $stripe->subscriptions->createSubscriptionRequest("plan_id");
$stripe->subscriptions->createSubscription("customer_id", $request);
$subscription = $stripe->subscriptions->getSubscription("customer_id", "subscription_id");
The updateSubscription()
method takes an UpdateSubscriptionRequest
object as its third parameter.
$request = $stripe->subscriptions->updateSubscriptionRequest()->setQuantity(2);
$stripe->subscriptions->updateSubscription("customer_id", "subscription_id", $request);
$stripe->subscriptions->cancelSubscription("customer_id", "subscription_id");
$subscriptions = $stripe->subscriptions->listSubscriptions("customer_id");