#cavint9510

1 messages ยท Page 1 of 1 (latest)

wispy treeBOT
violet meteor
#

Hi! Let me help you with this.

#

Why you can't use it?

kindred basin
#

this is my backend code

#

this is my front js code

#

finally , error

wispy treeBOT
kindred basin
#

The other day, Your engineer tell me:if i need use setupIntent to collect card info.i should set automatic_payment_methods.enabled=true.But only when i create setupIntent , i can change it.

#

i can't update this setupIntent automatic_payment_methods.enabled

grave sundial
#

๐Ÿ‘‹ taking over for my colleague. Let me catch up.

kindred basin
#

ok

grave sundial
kindred basin
#

i have read this doc.But you engineer not recommend that i use create setupIntent to bind card info

#

he say use subscription

grave sundial
#

if you are creating the subscription first, you don't have to use a SetupIntent that's correct

#

I would do some changes to your backend code first

#

in the addAllExpand I would pass both latest_invoice.payment_intent and pending_setup_intent

#

and then based on which one of these fields latest_invoice.payment_intent and pending_setup_intent is not null, you would send its client_secret to the front end, with another field telling the front end whether this is a payment or a setup Intent

#

then you would pass that cleint_secret to the Payment Element

#

and use confirmPayment or confirmSetup depending on which type of Intent you have

kindred basin
#

you can read my code

#

That's exactly what I did

#

but error

grave sundial
#

would you mind sharing the code that you used to initialize the Payment Element?

kindred basin
#

yep,that's all

#

have any question?