#raju_42209

1 messages · Page 1 of 1 (latest)

stone stormBOT
marble siren
#

👋 happy to help

#

yes you can use Payment Elements with both PaymentIntents and SetupIntents

#

the only difference would be in the confirmation function

#

in the first case you'd use confirmPayment whereas in the second you'd use confirmSetup

surreal storm
#

I have paymentIntent already. How can i use it for setupIntent? I mean, which method like update, retrieve etc I have to use in setupIntent?

marble siren
surreal storm
#

Tarzan, I have already been to above link, where I can only see how to create setupIntent. but, my requirement is, how to use paymentIntentId with setupIntent, which setupintent method to be used to consume paymentIntent into setupIntent

marble siren
#

that's not possible

#

you need to have 2 separate logics

#

depending on the choice of your users

surreal storm
#

so you meant, paymentIntentId cannot be used with setupIntent, right?

#

and wise-versa

stone stormBOT
hallow lintel
#

correct, they are different object types.

surreal storm
#

Okay. Is there any way to accomplish above task like making payment using Payment Element and making payment using zero charge but save card-on-file?

#

above two tasks have to happened with paymetn element only

hallow lintel
#

no, a PaymentIntent has a minumum amount, it can't be zero

hallow lintel
# surreal storm above two tasks have to happened with paymetn element only

you just have an if-statement somewhere and if the page is being visited with the intention of making a payment, you get a PaymentIntent from your backend and call confirmPayment , if it's being visited with the intention of saving a card, you get a SetupIntent from your backend and call confirmSetup

surreal storm
#

Is there a way to first load the payment element without client secret, but, later charge the customer using the paymentIntent or setupIntenet on service side?

#

@hallow lintel You answe is fine but, to do above action first I must load payment element, right?