#mandalorianiv_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ 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/1220014463810535514
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- mandalorianiv_best-practices, 6 days ago, 33 messages
hello, are you there?
Hello
The deduplication isn't something Stripe handles automatically. It is something you'd want to handle.
For example, you can compare the fingerprint of each payment method and detach the matching one to remove duplicates
https://docs.stripe.com/api/payment_methods/object#payment_method_object-card-fingerprint
But stripe's native sdk confirms the payment
lemme explain
I create a payment intent via backend and returns me payment info and payment methods if available.
then if I want to save a card for future usage, I set save_future_payment parameter "off_session" and it attaches the payment method to customer
I can not check it cause there is no fingerprint when I want to compare
cause fingerprint is being created after payment is confirmed
@sly trench ?
Hanzo had to step out, I am catching up here
And right, unfortunately it isn't possible to prevent these duplicates before the payment but you can prune your saved payment methods to avoid duplicates after
hmm
so it's like I need to check after the payment and if it duplicates, I need to remove
and I have to compare with fingerprints
Yes, deleting duplicates after would be the way to go here
(I know you deleted that message but I am also not sure why I used that verb either)
so what happens if I check this in webhook events?
when I completed a payment, fingerprint must have created so I can compare?
Exactly
Webhook events would be a great way to do this. I forget if the fingerprint data is immediately available but you can look it up
Actually you can use payment_method.attached which will have the fingerprint in it
hmm got it
But I'm not sure that I can retrieve customer's attached cards in webhooks event
worst case, backend can check duplicates in create payment api request
you guys are trusting webhooks too much
You can, but you won't need to if you listen to the payment method event
so fingerprint are best way to do it
so I need to ask, this dublication is actually a bug for you or you have a specific reason for that
?
It is expected behavior. We create a new PM for whatever data is passed in to us, we don't check for preexisting payment methods with the same data, so it is expected that a new card would be created here