#mikeargus
1 messages · Page 1 of 1 (latest)
Hi there, so you want to collect a payment method from your customer during the checkout flow?
No. We would like not to when they are eligible for our free trial period. But if we never collect it, we cannot end the trial immediately if they'd like to fast-forward to the paid period, since the update call to the subscription object will fail since there's no default payment method attached.
Let's imagine we have a service that does evaluations of some sort. We want to provide a free trial to our users to try it out but to manage resources we want to restrict this to 5 evaluations during the free trial period so they cannot abuse our system. But in case they like it a lot and they use up all 5 evaluations in a day we don't want them to be waiting until the 7 day free trial ends, we'd like to move them to a paid period immediately. How would we have this, if during checkout we didn't require a payment method?
A new checkout session doesn't work, because that creates a new subscription unfortunately. Am I right?
You can use setup mode checkout to collect a payment method from your customer, and set it as the default_payment_method of the subscription
Oh, that sounds nice. I'll give it a try
after that set the trail_end to now (https://stripe.com/docs/api/subscriptions/update?lang=curl#update_subscription-trial_end) to end the trial
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.