#farhan-subscriptions

1 messages · Page 1 of 1 (latest)

fresh sparrow
#

hi! what do you mean by it doesn't work exactly?

tidal chasm
#

the payment is not taken

#

3D Secure attempt incomplete
The cardholder began 3D Secure authentication but has not completed it.

#

but in testing, i have definitely clicked the complete button that pop's up for 3ds testing

fresh sparrow
#

do you have the ID of the object this is about?

#

like the PaymentIntent pi_xxx or Invoice in_xxx or SetupIntent seti_xxx or so on, the object you're looking at in your Stripe dashboard where that text you pasted, is from?

tidal chasm
#

pi_3LZWWJBIyYWjTWBB1mZxeMCq

#

i suspect that i'm doing something wrong with the flow. So what we do, is create the customer and subscription first on our signup page..

#

then we get the setupintent id and client secret from the pendingsetup intent

#

and use that in PaymentElement

fresh sparrow
#

yep, that is correct so far.

tidal chasm
#

once the customer pays via the PaymentElement, we set the paymentMethodId as the default

#

but when i check dashboard

#

payment is still not paid

fresh sparrow
#

So why do you manually end the trial period a few seconds later?

tidal chasm
#

to make the subscription active?

#

or is that wrong?

fresh sparrow
#

hmm, but it is active? is this is just something you're doing to test?

#

the way it works is as soon as you create the subscription with a trial period, the subscription exists and is active. A payment method is not required

#

when the trial naturally ends (in 14 days in your case), it will try to charge the customer's payment method, like the one you saved via the SetupIntent as you describe.

#

if no such payment method was added then that payment attempt would fail and the subscription cancels

#

in your case the payment at the end of the trial period required 3DS because you used the test card that requires 3DS on every payment

tidal chasm
#

i see so i don't need to manually end trial?because that's how we do it before.. Before we create a token then attach it to customer then we end the trial to make it active

#

is there a way for me to test the trial end? i can't wait days for it to be active?

#

ok thank you will try that card

fresh sparrow
tidal chasm
#

thanks for the help will try that

#

just got a response from my colleague.. as soon as the customer add in the card details

#

we will charge them immediately

#

so if they signup today and put in card details today, we will charge today and end the trial

#

will there be issues for the 3ds?

fresh sparrow
#

fair enough, that's not really a use case we have great support for. The best way to do it is to end the trial first and then use the PaymentIntent from the subscription to collect the details via a PaymentElement, but that doesn't really make sense for your use case

#

I don't really understand why you create subscription -> trial-> collect payment info -> end trial all immediately in the span of 5 minutes though. Why not just don't use a trial at all.

tidal chasm
#

^ that usecase is just for testing

#

but we have 14 days trial

#

we create a subscriptoin -> trial (14) days

#

and customer can pay on 3rd day for example

#

what if, after i collect payment info and attach it to customer, i end trial and delete the subscription and create a new subscription without the trial..

#

will it use the attached payment info?

#

because we can't end the trial until we're sure the payment is valid.

fresh sparrow
#

what does "valid" mean to you?

tidal chasm
#

all details are correct including 3ds

fresh sparrow
#

what does "correct" mean to you?

tidal chasm
#

card number, cvc, expiry date, etc..

fresh sparrow
#

well if those are wrong the Setup/PaymentIntent would fail to confirm.

tidal chasm
#

i mean. if i end the trial and use the payment intent, then the customer puts in an invalid card, then the trial will end and our customer can't use the platform even if customer has supposed remaining trial days

#

what do you suggest for our scenario?

fresh sparrow
#

really like I said this is not a use case that we really support well and it's a little unusual.

The 'official'/best way to approach this that I would do is

  • start a subscription with a trial period. Don't use the SetupIntent since you said the customer is not going to enter their payment details for 3 days, you're not doing a 'normal' Stripe trial where you accept the card details now, validate them via SetupIntent, and wait for the end of the trial to have them get charged.
  • 3 days later the customer says they're going to enter their card details. Call the API to end the trial, get the latest_invoice.payment_intent
  • confirm that PaymentIntent on your frontend with the customer entering their details in the PaymentElement.
  • that activates the subscription and charges for the upcoming billing period and can do 3DS.

There's some other options but none of them are really good and can lead to more declines or the customer doing 3D Secure twice in a row.

tidal chasm
#

i see. i get your point

#

i'm just worried about ending the trial before having the customer enter the details.. if the card is declined for some reason then we have already ended the trial

fresh sparrow
#

yep, that is a problem with my approach

#

but with your approach what can happen is the customer does 3DS when saving their card with the SetupIntent, and then they have to do it again when you manually end the trial to charge them(hence 'doing 3D Secure twice in a row' as I mentioned). There's no great solution, usually you would just let let the customer enter their payment details and wait for the trial to end(the SetupIntent validates the card), you don't force it to end and charge them an actual payment, that makes the set up more complicated here.