#priya_code

1 messages ยท Page 1 of 1 (latest)

delicate zephyrBOT
stiff lagoonBOT
#

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.

delicate zephyrBOT
#

๐Ÿ‘‹ 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.

stiff lagoonBOT
thorn thorn
#

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?

delicate zephyrBOT
forest swallow
#

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

thorn thorn
forest swallow
#

isn't it possible to get the id of the created method directly? instead of creating it manually?

unique urchin
#

๐Ÿ‘‹ Stepping in for my teammate. What do you mean by getting the ID of the PM directly vs. creating it manually?

forest swallow
#

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: '',
}
}
});

unique urchin
#

I recommend trying this out using the guide linked above by Pompey. The point is to call createPaymentMethod when your customer submits the form.