#priya_code
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. 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/1214573510459133982
📝 Have more to share? You can add more detail below, including code, screenshots, videos, etc.
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, 15 hours ago, 13 messages
- priya_code, 6 days ago, 5 messages
I think the stripe element should be creating a payment method on submission, is that not the case?
Hi 👋 where in your payment process are you hoping to get that Payment Method ID, and which part of your system do you need to receive it (is this for your backend code)?
yes
I need to send it to the backend code for purchase completion.
So our logic of creating payment intent and calling confirmpayment is in backend. We want to send PM ID to the backend.
Gotcha, so you're building a server-side confirmation flow. With that flow you have to explicitly create the Payment Method from your frontend code via stripe.createPaymentMethod():
https://docs.stripe.com/js/payment_methods/create_payment_method_elements
The response to that will include the ID of the created Payment Method.
This guide helps walk through the structure of that flow:
https://docs.stripe.com/payments/finalize-payments-on-the-server
We also have a newer version of that flow that is being built:
https://docs.stripe.com/payments/finalize-payments-on-the-server-confirmation-tokens
And our teams are actively seeking feedback regarding that flow:
#🔊announcements message
I am aware of this flow. I ant to understand that isn't stripe element creating the payment method by default if I don't explicitly create it?
No
Or if it is, I'm not sure how to get it. In the guide we show that you should use preventDefault to prevent the default form submission behavior as well, as that would lead to a page reload.
hmm I just wanted a confirmation that either payment method doesn't get generated or if it is we cannot access it's id in any way.
Only option is to create a payment method manually.
is that correct?
Yup, that's right
PM is not generated at all or it does but no way to fetch the PM id?
I'm not sure offhand, and either way it wouldn't work for your flow.
I would need a confirmation to get back to my team. Can you please confirm it from someone?
After you perform the default form submission in your test flow. Are you then able to find any new Payment Methods being listed?
https://docs.stripe.com/api/payment_methods/list
I really don't think it matters either way if you don't see it there, because no matter what's actually happening behind the scenes you don't have a Payment Method ID to work with. I'll try to test, but it'll take time.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok