#priya_code
1 messages ยท Page 1 of 1 (latest)
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.
- priya_code, 5 days ago, 5 messages
๐ 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. Thank you for your patience!
โฑ๏ธ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime! If this thread is closed and you have another question you'll need to start a new thread.
๐ 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/1214326941587607652
๐ Have more to share? You can add more detail below, including code, screenshots, videos, etc.
Hello, are you saying that you want your frontend to create the PaymentMethod, send the ID to your server, and have your server create and confirm a PaymentIntent with the newly created payment method? Or something else?
yes
this is what I am looking for.
while calling web api I am sending a token to it as a payload which is payment method id
This doc will show you how to do that https://docs.stripe.com/payments/finalize-payments-on-the-server?platform=web&type=payment
isn't it possible to get the id of the created method directly? instead of creating it manually?
๐ Stepping in for my teammate. What do you mean by getting the ID of the PM directly vs. creating it manually?
Instead of doing the below code, is it possible to get the id of the PM while submitting the form?
const {error, paymentMethod} = await stripe.createPaymentMethod({
elements,
params: {
billing_details: {
name: '',
}
}
});
I recommend trying this out using the guide linked above by Pompey. The point is to call createPaymentMethod when your customer submits the form.