#dragon.frost
1 messages · Page 1 of 1 (latest)
You can use the threads already open to ask another question, FYI
trialing I would imagine
and if there was no trail period?
incomplete assuming a payment confirmation is required
Yes. So if the payment confirmation is done after that, then what would be the correct status with trial and not with trail
yup. was just confused as to why the trail one is trailing even before and after the payment. I would assume it would be incomplete or something before
Nope, because trials are free we don't require a payment method for them to start
You can configure the behaviour when the trial ends and there's no payment method, though: https://stripe.com/docs/billing/subscriptions/trials#create-free-trials-without-payment
I would assume the trial period will not be activated on just creating a subscription payment intent before a payment confirmation right?
It will yes. A Subscription with a trial set will always immediately transition to trialing. See: https://stripe.com/docs/billing/subscriptions/overview#subscription-lifecycle
There's no Payment Intent with a trial subscription anyway
I created a subscription with intent that has code of something like this:
const stripeSubscriptionData = {
customer: stripeUser.id,
items: [{ plan: stripePlanId }],
metadata: { id: user._id.toString(), rebuild: true as any },
collection_method: "charge_automatically" as const,
payment_behavior: "default_incomplete" as any,
expand: ["latest_invoice.payment_intent", "pending_setup_intent"],
payment_settings: { save_default_payment_method: "on_subscription" },
{ trial_end: trialExpiration },
{ coupon: stripeCoupon.stripe_id },
};
const stripeSubscription = await stripe.subscriptions.create(
stripeSubscriptionData,
);
response of "create" has subsription with status: 'trailing'. Which should not be the case right according to you?
Am I missing something?
I think you're confused: #1156540204212043807 message
Anytime you pass trial_end or trial_period_days it will automatically start with status: 'trialing'
Regardless or whether you confirm the intent or not
Anytime you pass trial_end or trial_period_days it will automatically start with status: 'trialing'
Regardless or whether you confirm the intent or not
So, in my flow, even if the payment is not confirmed, the customer can still be subscribed to a trial period just by creating a payment intent subscription?
There is no payment though, that's the thing. If you're starting a subscription with a trial, we don't generate a Payment Intent
But yes, the trial will start without confirming the Setup Intent
Cool. So, How/when do you think is the best way to attach a trail period so that the customer is subscribed to the trial period only after payment is made?
Depends what you mean by 'payment'? As I said, there is no payment if you set a trial period – the initial invoice will be $0
What are you actually trying to do?
I want the user to subscribe to the trial period only after they submit their card details and get charged the subscription amount automatically after the trial period ends.
So you want to prevent Subscription creation until you have card details?
yes
You can use the deferred flow then. Collect payment details first and then create the subscription: https://stripe.com/docs/payments/accept-a-payment-deferred?platform=web&type=subscription
is it possible to create a payment intent invoice by creating a subscription, and update the subscription invoice by attaching the trial period to that subscription after payment is complete?
I'm confused, why do you need a Payment Intent if it's a free trial?
Let's say I don't want to use the deferred flow you linked above.
- I would create an intent when user selects a subscription plan and then goes to the checkout flow
- But I also want to offer/attach the trial only after a payment is complete, not when the intent is created
What could be the best way to do this?
or is using deffered flow the only possibility?
Sorry, I'm really confused. You keep referencing a payment/Payment Intent but then also a free trial. That's contradictory. If you want to offer a free trial, there'll never be a payment
So what exactly do you mean by:
But I also want to offer/attach the trial only after a payment is complete, not when the intent is created
What is 'payment is complete'? What are they paying for?
Sorry, by payment complete I mean they entered their card details, so they can be charged automatically after the trial ends
Then the deferred flow is perfect for this use case
Otherwise you'd be creating a Setup Intent and collecting card details before you create the Subscription. And that's not optimal as it means that the user could potential encounter two 3DS/auth flows
Thank you.
Is it possible to use the deferred flow without passing amount and currency to "Elements" provider. I want to handle them on the backend.
Afriad not. They're required so the Element can render the correct UI and payment methods according to the values
I'm actually just using the old card elements for this. Is it required for this as well?
You can't use the Card Element in the deferred flow
I guess you can customize the card input components using the payment element as well right?
Yep, usign the Appearance API. It's actually way more flexible: https://stripe.com/docs/elements/appearance-api
We previously added styles/wrappers around these Components from stripe to make our own custom card element design:
CardNumberElement,
CardExpiryElement,
CardCvcElement,
Is something similar available using payment element? i cant find it
I just linked it above
Thanks. I just missed this note:
The Elements Appearance API doesn’t support individual payment method Elements (such as CardElement). Use the Style object to customize your Element instead.
Yup, it's for the Payment Element only
One last question, is it possible to update a subscription with 'incomplete' status to have the property trial_end later on?
Hi! I'm taking over this thread.
I'm not sure I understand the question. You have an existing Subscription in incomplete status, and want to update the trial_end parameter?
yup
I would need to test this, give me a few minutes.
No, I get an error message:
You cannot update a subscription in
incompletestatus in a way that results in a new invoice or invoice items. Only minor attributes, likemetadataordefault_payment_method, can be updated on such subscriptions.
So I would assume for this we would need to add trial_end propery when creating a subscription right?
Correct
One last question, does using CardElements as opposed to payment elements violate the SCA regulations requirements?
And is it alright to use card elements for using the deffered flow?
One last question, does using CardElements as opposed to payment elements violate the SCA regulations requirements?
No both are the same.
And is it alright to use card elements for using the deffered flow?
Not sure, give me a few minutes to check.
If you use CardElement you can just call createPaymentMethod directly and then confirm the PaymentIntent. So using the new "deferred intent" flow doesn't really makes sense here.
so its technically like a deferred flow while still using the paymentIntent flow with client_secret right?
yes exactly
oh cool.
Do you see any reason that I need to update my card element to payment element? For reference we are currently on an old implementation before the use of payment Intents and we want to be compliant with SCA regulations.
And also we only want to support card payements for now
are there anything more I might need to consider?