#shaitan1126
1 messages · Page 1 of 1 (latest)
hello @floral gorge, when creating / confirming the payment intent, pass in the specific payment_method_id of the customer
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?
you really shouldn't be using card tokens anymore and should switch to using PaymentIntents and PaymentMethods
tokens don't support 3DS
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.
Hi @floral gorge I will take over from here as alex will be offline soon
Sure
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
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?
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
Here is the API to see all PaymentMethods attached to a customer: https://stripe.com/docs/api/payment_methods/list
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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.
Sorry I missed that message. You can check the card fingerprint when you create a new payment method, to avoid that