#skoshkarli-sub-default_incomplete
1 messages ยท Page 1 of 1 (latest)
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.
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
Yep then a trial is proper for that.
Also to clarify, the status will be trialing not active... I previously mispoke.
so would i call update on subscription to go from default_incomplete to trialing?
Nope
so setup initially then with trialing?
You can create with default_incomplete and just set a trial period and the Sub will be created with status: trialing
oh
so what about other users that i want on trial, but i want to collect payment from without activating their subscription?
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?
so i have a few different flows
- create sub with default incomplete with a trial period based on the product, collect payment from customer then call stripe.confirmPayment to activate
- create a sub with default incomplete without a trial period based on the product, collect payment from customer then call stripe.confirmPayment to activate
- 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
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?
wouldn't i get a pending_setup_intent that i would use to pass to confirmPayment?
You pass the client_secret of the pending_setup_intent to confirmSetup()
Not confirmPayment
So that may have been what was confusing me
in your docs it says
so you are saying i need to call confirmSetup instead of confirmPayment?
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
what if i don't start it with trial, but then update it to a trial right before confirming payment?
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.
but i don't want users to have a subscription until they provided payment in some cases
Okay, in that case wouldn't you just not have a trial period at all and collect payment up front?
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
If you generate a Subscription without a trial period it will automatically create a Payment Intent
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
If you are collecting payment, the sub should be active (which is how subs behave by default).
again, we are using default_incomplete
payment_settings: { save_default_payment_method: 'on_subscription' },```
your docs say to do this on submission: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements&html-or-react=react#web-submit-payment
calling stripe.confirmPayment
Which confirms the payment and transitions the sub to active
Because the customer has paid. There is no trial in that case
so how can i achieven what i am trying to do?
You either collect payment up front or offer a free trial.
If you collect payment, that's not a free trial
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
We show that in our docs right here: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
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
https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements - there is no trial in this flow
do you have a flow that shows a trial?
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?
Your process still makes 0 sense to me. If you collect payment, there isn't a free trial. Because the customer paid already.
i am not collecting payment
i am collecting payment information
so that when trial expires
Okay that is very different
it can charge it
so my current flow is
- Create a customer
- Create a sub for that customer
- Use the clientSecret to render Payment Elements
- 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
Okay so when you create the sub for the customer, you include the trial period.
right now i dont, but i can add that in
Then the subscription object returned will include the pending_setup_intent
https://stripe.com/docs/api/subscriptions/object#subscription_object-pending_setup_intent
would it cause an email to go out to customer that their subscription has been setup in 'trialing' though?
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
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?
So this is after the user has selected their products, confirmed their subscription, and provided a payment method?
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
Short answer: Yes. You can update the subscription with trial_end='now'
ok so if i set it to trial_end now, what will the status of the subscription be then?
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
Also. Your process is pretty complicated so I would highly recommend you test this thoroughly
- test scenarios: https://stripe.com/docs/billing/testing
- test cards: https://stripe.com/docs/testing
- test clocks (simulate time for subscriptions): https://stripe.com/docs/billing/testing/test-clocks
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
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.
Sure thing. I hope it comes together
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?
No, active means the customer has paid. If it's on a trial the status is trialing
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?
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.
what do you mean by use setup intent?
i already have payment intent because i create a subscription right away
?
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?
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
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?
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?
Correct
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 ?
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.
Sorry, this question doesn't make sense to me. Why would you collect payment for a trialing Subscription?
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
That's the point of Setup Intents, they're very similar to Payment Intents but don't actually charge anything.
Can setup intent be passed to Stripe Elements ?
This is our overall guide for using Setup Intents with the Payment Element, but you can use the intent created by the Subscription rather than creating one as shown in Step 4.
https://stripe.com/docs/payments/save-and-reuse?platform=web
but the one created with subscription, isn't it a payment intent?
Which one, can you share an example of what you're referring to?
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?
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.
so the ones that DON't have a trial period, will not have a pending setup intent?
The behavior that drives whether a Setup Intent is created, is whether the Subscription creation requires an initial payment.
https://stripe.com/docs/billing/migration/strong-customer-authentication#scenario-2:~:text=If subscription creation does not require an initial payment and if authentication is recommended while the customer is on-session%2C Stripe Billing automatically creates a SetupIntent.