#Suren-attach-card
1 messages · Page 1 of 1 (latest)
Hey! What specifically do you mean by 'attach a card'? Are you using Payment Methods and you wish to attach it to a Customer object?
yes i need to bind carts customers
and do not enter card details when paying
only when binding
Got it, so they're on your website adding a new card but not actually paying for anything at this point?
well we have to use for one-time payments
Got it. But there won't be a payment at the time of the payment details being captured?
You'll likely want to look at using a Setup Intent when saving the payment data: https://stripe.com/docs/payments/save-and-reuse
Will attach it to the provided Customer object for future re-use and perform and required 3DS/auth
yes, you really will not be connected to the payment
I think this is not what I'm looking for
what if I get the current from the front and bind in this way
You shouldn't be using Sources really, they're an older API (replaced by Payment Methods)
Equally, attaching a PM to a Customer that way isn't really optimised for 3DS
The document I linked is the best way to collect payment data, carry out auth and then save for future usage
I just can't figure out how the binding is happening?
I mean adding a card to a specific customer
It's done when you create the Setup Intent, passing the customer parameter: https://stripe.com/docs/payments/save-and-reuse?platform=web#web-create-intent
That tells the API that the resulting Payment Method object created from the successful Setup Intent belongs to that customer
No, it's not used solely to attach a payment method to a customer. The primary purpose of a Setup Intent is to authenticate payment details for future payment (i.e. saving a card). You don't have to provide a customer, but then it won't be resuable
so I can use 3DS here?
Yup, exactly. You're authenticating the card whilst your customer is present so that it can be charged in the future without requiring authentication
ok thanks a lot,
if I don't understand something I will write
Sure, we'll be happy to answer!