#Don Dachi - duplicate cards
1 messages ยท Page 1 of 1 (latest)
I would focus on why you are getting duplicates in the first place and try to fix that
I was thinking about that but I cant find a solution there, flow is like this customer has a added cards list and also "Add a new card" button
card adding happens on frontend, back is generating setup intent and fron is creating a payment method
on this flow if customer will add the same card 10 times, he will get 10 cards on his cards view because stripe doesn't care about duplicates as I understand (and honestly I dont know if stripe should care or not about this)
on frontend side then entering card I cant restrict the user because I dont know all the cards he/she has at the time, because card data is protected and its not a plain text
so how I can know if customer is adding a duplicated cards? but after adding I can check for fingerprints, but I dont like this solution
Ah so the issue is the customer can just add multiple cards
Do you want them/need for them to have multiple cards?
You could restrict (on your end) for them to only add 1 card
Yes, they may have multiple visa/mastercard cards so they are adding everything and during the checkout picking which one to use
no I cant restrict them to use only one card
Oh ok. I wouldn't worry about duplicates then
Are users frequently entering the same card multiple times?
It shouldn't effect anything
Well during the testing yes ๐ this issue come from the client after they saw same cards multiple times in their profile
I was not thinking about this as a problem at first but now it became my problem ๐
Ah ok
This is the workaround I found: https://github.com/stripe/stripe-payments-demo/commit/dffb17f7d6bbbf40268c181d399423c2567ed693
So are they saying they entered it only once yet they see multiple?
No, they entered card multiple times
Got it
but they want to only see one
Other option is you can give them the option to delete cards in the UI
So if they eneter a duplicate they can delete the old one
They have that option to delete
But you know, customer is lazy want the application to do everything
detach
Gotcha one sec
Yeah if you have to do this for the user, then the workaround you shared is the best option
ok thank you, have a nice day
You too!