#shaitan1126

1 messages · Page 1 of 1 (latest)

rustic ether
#

hello @floral gorge, when creating / confirming the payment intent, pass in the specific payment_method_id of the customer

floral gorge
#

Ok, this is an another method I know, can we do using card token?

#

If i create tok_ using card elements and attached that token to customer, will it work same as payment intent?

rustic ether
#

you really shouldn't be using card tokens anymore and should switch to using PaymentIntents and PaymentMethods

#

tokens don't support 3DS

floral gorge
#

ok gotcha, last question if I use stripe payment intent then which ID need to save in database except customer Id for the card, so that we can manged card listing on our end.

dense sandal
#

Hi @floral gorge I will take over from here as alex will be offline soon

floral gorge
#

Sure

dense sandal
#

For the last question, it's totally up to you to design your database and system. You should think card is inside a PaymentMethod object (There could be payment methods other than card too). One Customer can have multiple PaymentMethod, but one PaymentMethod should only belongs to a Customer. It's like 1:n relationship

#

So, theorically yes, for one PaymentMethod you only need to store the Customer Id, but it could be null

#

like an optional field

floral gorge
#

I understand your answer but my question is that I have the customer Id, now want to add multiple cards into a customer Id and later we can pick up any card to make payment? for example, I added card A and Card B in the customer ID, now i want to make payment through the Card A, and after 1 days I want to make payment Carc B?

#

Is that possible?

dense sandal
#

Yes

#

You can save that relationship into your database, but you will need to sync with Stripe. You can just ... don't manage it and let Stripe manage it to you

floral gorge
#

Ok gotcha thanks for your help

#

One more question

#

If the customer added the same card again how we can detect it?

#

If they added the same card again then we don't want to create duplicate payment method ids.

dense sandal
#

Sorry I missed that message. You can check the card fingerprint when you create a new payment method, to avoid that