#cavint9510
1 messages ยท Page 1 of 1 (latest)
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
๐ taking over for my colleague. Let me catch up.
ok
you can use the deferred way if you prefer to collect the details then create the Intent https://stripe.com/docs/payments/accept-a-payment-deferred?platform=web&type=setup
i have read this doc.But you engineer not recommend that i use create setupIntent to bind card info
he say use subscription
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
I would also add https://stripe.com/docs/api/subscriptions/create#create_subscription-payment_settings-save_default_payment_method on_subscription
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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
would you mind sharing the code that you used to initialize the Payment Element?