#dragon.frost

1 messages · Page 1 of 1 (latest)

robust helmBOT
shell night
#

You can use the threads already open to ask another question, FYI

#

trialing I would imagine

novel fern
#

and if there was no trail period?

shell night
#

incomplete assuming a payment confirmation is required

novel fern
#

Yes. So if the payment confirmation is done after that, then what would be the correct status with trial and not with trail

shell night
#

trialing and active

#

Should be easy enough for you to test to confirm

novel fern
#

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

shell night
#

Nope, because trials are free we don't require a payment method for them to start

novel fern
#

I would assume the trial period will not be activated on just creating a subscription payment intent before a payment confirmation right?

shell night
#

There's no Payment Intent with a trial subscription anyway

novel fern
#

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?

shell night
#

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

novel fern
#

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?

shell night
#

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

novel fern
#

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?

shell night
#

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?

novel fern
#

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.

shell night
#

So you want to prevent Subscription creation until you have card details?

novel fern
#

yes

shell night
novel fern
#

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?

shell night
#

I'm confused, why do you need a Payment Intent if it's a free trial?

novel fern
#

Let's say I don't want to use the deferred flow you linked above.

  1. I would create an intent when user selects a subscription plan and then goes to the checkout flow
  2. 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?

shell night
#

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?

novel fern
#

Sorry, by payment complete I mean they entered their card details, so they can be charged automatically after the trial ends

shell night
#

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

novel fern
#

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.

shell night
#

Afriad not. They're required so the Element can render the correct UI and payment methods according to the values

novel fern
#

I'm actually just using the old card elements for this. Is it required for this as well?

shell night
#

You can't use the Card Element in the deferred flow

novel fern
#

I guess you can customize the card input components using the payment element as well right?

shell night
novel fern
#

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

shell night
#

I just linked it above

novel fern
#

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.

shell night
#

Yup, it's for the Payment Element only

novel fern
#

One last question, is it possible to update a subscription with 'incomplete' status to have the property trial_end later on?

turbid crystal
#

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?

novel fern
#

yup

turbid crystal
#

I would need to test this, give me a few minutes.

#

No, I get an error message:

You cannot update a subscription in incomplete status in a way that results in a new invoice or invoice items. Only minor attributes, like metadata or default_payment_method, can be updated on such subscriptions.

novel fern
#

So I would assume for this we would need to add trial_end propery when creating a subscription right?

turbid crystal
#

Correct

novel fern
#

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?

turbid crystal
#

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.

novel fern
#

so its technically like a deferred flow while still using the paymentIntent flow with client_secret right?

turbid crystal
#

yes exactly

novel fern
#

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?