#skoshkarli-sub-default_incomplete

1 messages ยท Page 1 of 1 (latest)

final kernel
#

Hi there! When you create a Subscription with a Trial it will automatically become active and does not require you to collect a payment method up front.

#

To be clear, the Subscription started with a trial will also include a pending_setup_intent which gives you the option to collect a payment method or not.

formal carbon
#

we setup our subscriptions with default_incomplete because we don't activate them until we call confirmPayment

#

but there is one case where we want to activate them immediately

#

and not collect payment

final kernel
#

Yep then a trial is proper for that.

#

Also to clarify, the status will be trialing not active... I previously mispoke.

formal carbon
#

so would i call update on subscription to go from default_incomplete to trialing?

final kernel
#

Nope

formal carbon
#

so setup initially then with trialing?

final kernel
#

You can create with default_incomplete and just set a trial period and the Sub will be created with status: trialing

formal carbon
#

oh

#

so what about other users that i want on trial, but i want to collect payment from without activating their subscription?

final kernel
#

Sorry that doesn't really make sense to me? How are you going to have a Subscription on trial but also collect payment and have their Subscription not be active?

#

Can you clarify what you mean exactly?

formal carbon
#

so i have a few different flows

  1. create sub with default incomplete with a trial period based on the product, collect payment from customer then call stripe.confirmPayment to activate
  2. create a sub with default incomplete without a trial period based on the product, collect payment from customer then call stripe.confirmPayment to activate
  3. create a sub with default incomplete with a trial, don't collect payment from customer and immediately activate that sub so that they can use product without providing payment
#

in flow 3, their sub would just expire at end of trial, unless they updated the payment info

final kernel
#

Okay so for the first scenario does your Subscription actually have a trial period set for it?

#

Like there is no payment to collect and nothing to call stripe.confirmPayment() on if you are actually setting a trial period.

#

Can you provide an example Subscription ID for this scenario that I could look at?

formal carbon
#

wouldn't i get a pending_setup_intent that i would use to pass to confirmPayment?

final kernel
#

You pass the client_secret of the pending_setup_intent to confirmSetup()

#

Not confirmPayment

#

So that may have been what was confusing me

formal carbon
#

in your docs it says

#

so you are saying i need to call confirmSetup instead of confirmPayment?

final kernel
#

If you set an actual trial period then yes.

#

But that is only if you want to actually collect a payment method

#

The Subscription is going to be "active" (really status: trialing) regardless of whether you collect the payment method or not if you start it with a trial

formal carbon
#

what if i don't start it with trial, but then update it to a trial right before confirming payment?

midnight meteor
#

HI ๐Ÿ‘‹ I'm stepping in for @final kernel . Give me a minute to catch up

#

Okay so to be clear. if you are using a trial period, then you won't collect payment initially. That's the point of a free trial.

#

You can collect the Payment Method and in that case this payment method can be billed automatically once the trial ends.

formal carbon
#

but i don't want users to have a subscription until they provided payment in some cases

midnight meteor
#

Okay, in that case wouldn't you just not have a trial period at all and collect payment up front?

formal carbon
#

i can't collect payment until i have a payment intent

#

this is what you guys told me to do before

#

i am using stripe elements

#

in a custom checkout page

midnight meteor
#

If you generate a Subscription without a trial period it will automatically create a Payment Intent

formal carbon
#

right, thats what i am doing

#

but i will need to add a trial period before making the sub active

#

how can i do that?

#

i am going to be calling stripe.confirmpayment on the intent

#

and if payment succeeds, i want to give them the trial

#

and activate the sub

midnight meteor
#

If you are collecting payment, the sub should be active (which is how subs behave by default).

formal carbon
#

again, we are using default_incomplete

#
      payment_settings: { save_default_payment_method: 'on_subscription' },```
#

calling stripe.confirmPayment

midnight meteor
#

Which confirms the payment and transitions the sub to active

#

Because the customer has paid. There is no trial in that case

formal carbon
#

so how can i achieven what i am trying to do?

midnight meteor
#

You either collect payment up front or offer a free trial.

#

If you collect payment, that's not a free trial

formal carbon
#

how can i collect payment upfront using StripeElements if it requires payment intent?

#

you guys told me to do this

#

so i built all this based on what you told me

midnight meteor
formal carbon
#

free trial or not, why does collecting payment cancel out free trial?

#

doesn't make sense

#

you can offer a trial and collect payment information

#

you are not charging

midnight meteor
#

Sure

#

That's the Setup Intent

formal carbon
#

do you have a flow that shows a trial?

midnight meteor
formal carbon
#

so then going back to the question i asked before

#

can i technically update the subscription with a trial right before i call confirmPayment?

#

i guess that may leave the user with a trial if the payment fails though

#

which doesn't make sense

#

so how can i achieven what i am trying to do?

midnight meteor
#

Your process still makes 0 sense to me. If you collect payment, there isn't a free trial. Because the customer paid already.

formal carbon
#

i am not collecting payment

#

i am collecting payment information

#

so that when trial expires

midnight meteor
#

Okay that is very different

formal carbon
#

it can charge it

#

so my current flow is

  1. Create a customer
  2. Create a sub for that customer
  3. Use the clientSecret to render Payment Elements
  4. Collect payment information and call stripe.confirmPayment with the paymentElements
#

what do i need to change to make sure i am able to provide a free trial

midnight meteor
#

Okay so when you create the sub for the customer, you include the trial period.

formal carbon
#

right now i dont, but i can add that in

midnight meteor
formal carbon
#

would it cause an email to go out to customer that their subscription has been setup in 'trialing' though?

midnight meteor
#

You then use the client_secret from that setup intent to render the payment Element and call stripe.confirmSetup() to save the payment method

#

That is up to your account settings

formal carbon
#

so here is another follow up

#

on my payment page, i have multiple products that they can select

#

if they decide to choose another product

#

(maybe one that doesn't have a trial)

#

can i update the subscription to not include the trial anymore at that point?

midnight meteor
#

So this is after the user has selected their products, confirmed their subscription, and provided a payment method?

formal carbon
#

no, initially i select a default product, but on the payment page, before they provide payment method, they have an option to select another product

midnight meteor
#

Short answer: Yes. You can update the subscription with trial_end='now'

formal carbon
#

ok so if i set it to trial_end now, what will the status of the subscription be then?

midnight meteor
#

incomplete since they still haven't added a payment method

#

But honestly I would have the user make the final product selections before you create the subscription

formal carbon
#

i can't really make the final selection before creating the sub, because our selections are on a payment page and i am required to setup the sub because i need the client secret, so i am kinda stuck

midnight meteor
#

Well wait, sorry not too complicated ( think that was just a misunderstanding about collecting payment vs collecting payment methods)

#

Yeah, a less than ideal approach is to create a new subscription, retrieve the new Payment Intent (no trial) or Setup Intent (trial) and re-render the Payment Element.

formal carbon
#

yeah

#

thanks for the help

midnight meteor
#

Sure thing. I hope it comes together

formal carbon
#

sorry

#

i actually just realized that i still don't have an answer to my first question lol

#

is it possible to put a subscription in 'active' status while on a trial without payment information?

midnight meteor
#

No, active means the customer has paid. If it's on a trial the status is trialing

formal carbon
#

hmm ok. and one more thing i am thinking of, is it possible to add a trial after collecting payment information and calling confirmPayment? or will confirm payment charge the customer right away?

sacred blaze
#

Hi ๐Ÿ‘‹ jumping in as my teammate needed to step away. I believe you can update a Subscription to put it into a trialing phase (I would need to test to double check that) but the confirmation step is where we get authorization for a payment from the issuing banks.

#

If you want to collect payment method information without processing a payment then you would use a Setup Intent instead.

formal carbon
#

what do you mean by use setup intent?

#

i already have payment intent because i create a subscription right away

#

?

sacred blaze
#

Apologies, I'm still catching up on context here and may be overlooking a detail, can you clarify which of the three scenarios that you mentioned previously is the one that this question is about?

formal carbon
#

it would be 1 or 2 i guess. I am worried about setting up a subscription with a trial and then have the payment fail when i call confirmPayment

sacred blaze
#

I think I'm a little confused overall about what you're trying to accomplish. If you create a Subscription with a trial period, there won't be an associated Payment Intent for you to use. The first Invoice will be a $0 invoice (the trial period is free) that will automatically move to a paid state and the Subscription will move to a trialing status.

Could we try taking a step back, can you describe what the flow you're trying to build looks like without mapping any of it to Stripe objects yet?

formal carbon
#

omg

#

so when i create a sub, its without a trial

#

and that gives me a payment intent right now

#

you are saying if i create one with a trial, then it won't give me a payment intent?

sacred blaze
#

Correct

formal carbon
#

is there a setup intent i can get instead of payment intent?

#

how can i collect payment on a subscrtiption that is trialing

#

and i need a client_secret to show Stripe Payment Elements

#

ok can you answer this:
How does one collect payment on a trial sub using Stripe Elements ?

sacred blaze
#

Yes, the Subscription will create a Setup Intent and provide that ID in the pending_setup_intent field within the creation response.

What do you mean collect payment on a Subscription that is trialing? The Subscription will automatically attempt to process a payment when the trial period ends.

Setup Intents also contain client secrets so they can be used with the Payment Element.

sacred blaze
formal carbon
#

it can't collect payment if payment info was never provided

#

i am trying to collect payment information so that when the trial expires, stripe can automatically charge it

sacred blaze
#

That's the point of Setup Intents, they're very similar to Payment Intents but don't actually charge anything.

formal carbon
#

Can setup intent be passed to Stripe Elements ?

sacred blaze
formal carbon
#

but the one created with subscription, isn't it a payment intent?

sacred blaze
#

Which one, can you share an example of what you're referring to?

formal carbon
#

ok i founnd it in the docs

#

so the setup intent will be there even if a sub is created with a trial for sure?

sacred blaze
#

Yes, I've created 4 subscriptions while we've been chatting and the three that had trial periods contained a value within pending_setup_intent.

formal carbon
#

so the ones that DON't have a trial period, will not have a pending setup intent?

sacred blaze
#

Update your Billing implementation to support new Strong Customer Authentication (SCA) requirements.