There is no option to restrict a user on adding duplicate card, can I validate a card by the following steps -
- Fetch all the added cards
- Save card on customer profile
- Compare the recent added card’s fingerprint, last4 digit, expiry month, expiry year with already added cards
- If any matched card found, we can delete the latest card and throw the error
Will this work?
Your right, we won’t restrict a customer from saving the card multiple times with your application. You can definitely validate a card with the information from a customer with the Cards API.
Thanks Bryan. So shall we consider the below mentioned steps as a solution :
- Fetch all the added cards associated to the customer profile
- Save card on the customer profile
- Compare the recent added card’s fingerprint, last4 digit, expiry month, expiry year with already added cards
- If any matched card found, we can delete the latest card and throw the error
This might be helpful for other solution providers.
Yeah however I don’t think you need to fetch all added cards. You’ll just need to fetch all the cards associated to the customer profile.
Oops, I forgot to mention that we need to fetch the cards of a particular customer. I will update my last post and thanks man for your quick and accurate responses.