#shahriyar_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/1263449430040772672
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Sure, you'd use a Setup Intent: https://docs.stripe.com/payments/save-and-reuse?platform=web&ui=elements
Here is the card. Now what if the card has 3D Secure enabled? I need some guides
Should I create the payment method inside client or server
To be clear you can't use custom form fields like that. You need to be using our PCI compliant Elements forms
await stripe.paymentMethods.create({
type: "card",
card: {
number: input.card.card_number,
exp_month: Number(input.card.expiration_month),
exp_year: Number(input.card.expiration_year),
cvc: input.card.cvv,
},
})
Cant do this?
I saw this on stripe docs
I can use Card Element but with my theme that does not look good and customizing that is hard so I made this form
Not without necessary PCI compliance, no. You can't handle credit card data on your pages/server: https://docs.stripe.com/security/guide
OK if I use the stripe's provided CardElement, how can I attach the card to a existing customer. so his future invoices use the latest card
This guide explains that if you just want to save the card
Otherwise, if there's a payment and you want to save it, use this guide: https://docs.stripe.com/payments/save-during-payment?platform=web&ui=elements
The customer is already created and has already a payment method attached, I want to be able to add another payment method to him
without any payment intent creation
Yes, then you'd use a Setup Intent as outlined here: https://docs.stripe.com/payments/save-and-reuse?platform=web&ui=elements
You can pass the existing cus_xxx ID to the customer parameter when creating the Setup Intent and it'll save/attach to the customer on confirmation
can I also create a session where they can just click the button and redirected to stripe where they can add card, Also make sure they dont need to authenticate using email because we already have their customer id