#jainnikesh
1 messages · Page 1 of 1 (latest)
Hi there, so you want to check if there's an existing payment_method that matches the card number of a newly created card payment method?
Hi, thanks for waiting, discord is busy today
- You can call Paymentmethod list API (https://stripe.com/docs/api/payment_methods/customer_list?lang=node#list_customer_payment_methods) to retrieve the payment methods that are already attached to a customer
- When you create a new payment method, you should check its
card.fingerprint(https://stripe.com/docs/api/payment_methods/object?lang=node#payment_method_object-card-fingerprint) and see if it matches the fingerprints of any existing payment methods - If there's no match, attach the new payment_method, abort otherwise.