#towc

1 messages · Page 1 of 1 (latest)

outer waveBOT
gleaming trout
#

Hi there!

#

but in my case the subscription is already created so the user has already been charged, right?
I'm not sure what you mean. Are you trying to create a new subscription with a trial, or update an existing subscription?

mighty shale
#

the first case

#

but in my situation, it looks like stripe already creates the subscription, I don't create one myself

#

not sure how I'm supposed to create one myself before any checkouts happen

#

because the subscription should still need the 0$ checkout to start

gleaming trout
#

I still don't understand. If you want a subscription with a free trial, create a Checkout Session with trial_end:xxx, and Stripe will create a Subscription with a trial for you. What exactly is the issue?

#

And in this case the user won't be charged, until the free trial ends

mighty shale
#

I'm confused about how I would implement that. I do want the user to provide a valid card before starting

gleaming trout
#

Have you tried creating a Checkout Session in test mode with a free trial to see how it works?

#

It will ask the user for their card details, but they will only be charged when the free trial ends.

mighty shale
#

do you have any articles on integrating it? I'm not sure what my "start free trial" button should do.

#

should it talk to my backend, my backend generates the subscription, and at what point does the user insert their card details?

gleaming trout
#

Oh wait, I assumed you were using Checkout Session to create the subscription, sorry about the confusion.

#

So you are creating the Subscriptions yourself directly?

mighty shale
#

not right now, I think it's being created in stripe's backend

#

I have no references to stripe.Subscription.create in my code

gleaming trout
#

We recommend using Checkout Session as it makes everything simpler. But if you want to directly create Subscription with a free trial and collect a payment method then:

  • First create the Subscription on the backend with the free trial
  • Retrieve the pending_setup_intent.client_secret from the subscription
  • Use the client secret on the frontend with the Payment Element to collect the payment information
mighty shale
#

the ideal flow I'm imagining is:

  1. user clicks the start free trial button on my website
  2. user is redirected to add payment information
  3. user adds payment information
  4. user is redirected to website and can use website with the subscription
#

I'm happy to continue using the checkout session, just not sure how to start the subscription with a trial in that case, because I'm not generating the subscription myself and the only place where I see I can set a trial period on the dashboard is marked by that legacy tag in the picture in the first message

gleaming trout
#

Please read my above message on how to use Subscription + Payment Element with free trials

mighty shale
#

ok thanks, will try

#

I think I'm confused about how you would achieve this result using only checkout sessions

We recommend using Checkout Session as it makes everything simpler. But ...
this suggests you were thinking of a simpler way? Or is that to solve a different problem?

gleaming trout
#

With Checkout Session it's simpler:

  • Create the Checkout Session on the backend with a free trial
  • You get back a URL. Redirect the user to that URL
    And that's it. Checkout Session will take care of collecting the payment method and creating the subscription for you
mighty shale
#

I see, but you can't configure that with trials, right?

gleaming trout
mighty shale
#

aaaah thanks, this is what I was looking for!