Ahammad Jaffer
Ahammad Jaffer

Reputation: 1

Stripe subscription through checkout session

When creating a subscription on stripe using $stripe->subscriptions->create([]) we can provide a 'cancel_at' date specifying when this subscription ends. But when creating a subscription using checkout session no such option is available.

I have to bill one product and one subscription item on the same checkout without individually adding product and pricing on stripe(only showing them on checkout page). Here, I am not able to set an end date for subscription. Any one has any idea on how to do it?

Upvotes: 0

Views: 617

Answers (1)

Tarzan
Tarzan

Reputation: 1087

You can listen to the checkout.session.completed webhook event, then you can update the subscription's cancel_at.

Upvotes: 0

Related Questions