I have saved stripe customer id\'s in my db for later payments. A customer will have multiple cards and I would like to check/validate new customer cards with their existing
It sounds like you're caching the card data locally to be able to display it to the customer.
If that is correct, Stripe provides a fingerprint for each card/token which you can begin storing in the card records (if you're not already). Each fingerprint is unique to a card, so before storing additional cards for a customer, you can simply search the user's cards by fingerprint.
As a simple example, assuming a User has_many :cards:
token = Stripe::Token.retrieve("tok_a1b2c3d4")
unless current_user.cards.find_by(fingerprint: token.card.fingerprint)
current_user.cards.create( ... # data from token )
end
If you're not caching the card data locally, Stripe handles duplicates for you and you don't need to do anything.