#salim-bt_docs

1 messages · Page 1 of 1 (latest)

acoustic spireBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1286725341968338955

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

shell quartz
#

Here, i create new payment method, then attach it to user. inside 'confirm' event, i need check if selected payment card already has been attached and create new payment method only if card NOT attached to user yet

distant willow
#

Are you just trying to de-duplicate cards?

shell quartz
#

no, i want create new payment only if card not exists yet. I just want to remove the duplication of cards

distant willow
#

You can look at the fingerprint of the card: https://docs.stripe.com/api/payment_methods/object#payment_method_object-card-fingerprint and ensure that these do not match. If there is not match, you can attach the payment method as this is a new payment method. If it matched, it means it is a duplicate card.

Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.

shell quartz
#

in old paymentRequest 'paymentmethod' event, i could get current card

distant willow
#

Can you reword the latest ask please?

shell quartz
#

sec

#

in old stripe.paymentRequest 'paymentmethod' event, i could get selected user's card. So Q is there similar way to get selected payment card in expressCheckoutElement without sending separated requests

distant willow
#

No. You could store that data in your database, and when collect the payment method, you can inpect the fingeprint data and decide to attach it to the customer or not.

shell quartz
#

ok thanks