#Hazim

1 messages · Page 1 of 1 (latest)

barren edgeBOT
final sparrow
#

Can you share an example request ID that errors?

#

lkike req_123

#

or what is the error message you get back?

#

The request generally looks fine to me, but it's possible that eg customerId or priceId are invalid

devout dirge
#

oh its not that , the problem is that the response does not give me back a client secret so that I can give it to the the front that I have built with React so that the user can enter the payment

#

My goal is that the user needs to put his card info and needs to be valid so that I can activate the sub

#

I do not want to activate the sub or launch the trial if the guy does not have a valid payment method

final sparrow
#

oh

#

That's different than what you asked, which was about getting 400 responses

#

But now i understand

#

it's because you added a trial

devout dirge
#

Yeah my bad, I just saw in stripe that the client indeed has a sub with a trial

final sparrow
#

There's no payment in that case, the initial invoice will be a trial mode invoice for $0

#

So what you need to look at instead is the subscription's pending_setup_intent and expand that

#

that setup intent will have a client_secret and you need to use that when using eg confirmSetup or similar

devout dirge
#

pending setup intent is in the response ?

#

or in the request?

final sparrow
#

in the subscription response

#

it'll be an ID like seti_123 unless you expand it, which you should do

#

expand: ['pending_setup_intent'],

#

to get the full setup intent object and be able to grab the client_secret

devout dirge
#

okay so in that case the sub and trial won't start unless the client has a payment method?

final sparrow
#

The trial is active right away, the pending setup intent is how you'd get a PM on file to pay later

#

So that eg the subscription will cancel or pause if no PM is set up for it before the trial ends

devout dirge
#

what happens at the end of the trial if the payment didnt succeed?

#

and is it possible to activate a trial with a payment method instead ?

final sparrow
#

as in you successfully set up a PM using the setup intent, but then the actual payment fails?

devout dirge
#

I mean that would be great if I can activate a trial when I get the payment method becuse in your documentation , it says trials without a payment methods

final sparrow
#

Or you could use a setup intent without a subscription to collect the PM details up front, before you even create the subscription

#

Again, up to you

#

Or you could eg use Checkout subscription mode to start subscriptions, which I highly recommend, which handles logic like this for you

devout dirge
#

Okay I see I will try to collect the payment method then activate the sub

#

thank you so much for your response

#

I don't know who you are but I hope you have a really good day buddy