#dev_code

1 messages ¡ Page 1 of 1 (latest)

silver bayBOT
#

👋 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/1338377971215503362

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

rain vine
#

You can call this API to retrieve the list of payment methods that are already saved to a customer https://docs.stripe.com/api/payment_methods/customer_list, and compare the newly collected payment method's fingerprint (https://docs.stripe.com/api/payment_methods/object?lang=cli#payment_method_object-card-fingerprint) against existing ones

versed wyvern
#

In order to get the fingerprint, fitst i have to create the payment method and then need to check with the existing ones right

rain vine
#

Yes you are right

versed wyvern
#

const paymentMethod = await stripe?.createPaymentMethod({
type: "card",
card: cardElement as StripeCardElement,
billing_details: {
name,
address: {
line1: addressLine || null,
country: country || null,
state: state || null,
city: city || null
}
}
});

above will returns below response, where i can't find the fingerprint

{
"paymentMethod": {
"id": "pm_1QqrVx2Mr6ZO8JPRjBg3wmsF",
"object": "payment_method",
"allow_redisplay": "unspecified",
"billing_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": "22222",
"state": null
},
"email": null,
"name": null,
"phone": null
},
"card": {
"brand": "visa",
"checks": {
"address_line1_check": null,
"address_postal_code_check": null,
"cvc_check": null
},
"country": "US",
"display_brand": "visa",
"exp_month": 12,
"exp_year": 2028,
"funding": "credit",
"generated_from": null,
"last4": "4242",
"networks": {
"available": [
"visa"
],
"preferred": null
},
"regulated_status": "unregulated",
"three_d_secure_usage": {
"supported": true
},
"wallet": null
},
"created": 1739172886,
"customer": null,
"livemode": false,
"radar_options": {},
"type": "card"
}
}