#markus-bielaszka_api
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/1350076913523359754
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, let me help you with this.
payment id does not get reattached again
What do you mean by this?
I mean that I would like to make so that the customer cannot add a new "payment method" if they use the same credit card or other payment methods. for example when I check the customer that I created and I make a new subscription it will add the same card again in the payment method section
and a new payment method id is being created every time I use the same card in test mode
By the "same card" you mean the same card number, right?
Yes for example the visa test card number
It's normal to have multiple different PaymentMethod objects for cards with the same number. You can check if they have the same fingerprint: https://docs.stripe.com/api/payment_methods/object#payment_method_object-card-fingerprint
If you want to avoid this, present the saved PaymentMethods to the customer before allowing them to add a new one. Maybe limit the number of saved PaymentMethods, i.e. "if you want to add a new card, delete one of the old ones".
Payment Element supports displaying saved cards: https://docs.stripe.com/payments/existing-customers?platform=web&ui=elements
Ok thanks you so much, that helps a lot! I will have a look at that ๐