#jess_docs
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/1280978593706545173
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- jess_paymentelement-googlepay, 5 days ago, 22 messages
Hello
Is there a reason you are following the "finalize payments on the server" flow?
As opposed to the normal deferred-intent flow: https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=setup ?
We are following the finalize payments on the server flow mainly because another department handles the creation of payment intent and business logic of our payment flow
Is that the difference between the two flows?
Unless you have a good reason to use the "finalize on the server" then you shouldn't -- it is just more complicated. The docs I provided you above will save the PaymentMethod to the Customer to be charged later without needing to use a Confirmation Token at all
From the doc you provided, we are charging the customer off session but in our payment flow, the customer is present in the session.
Ah thought you said you were saving to charge later
But you are charging and saving to charge later
So you want https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=payment and when you create your PaymentIntent you pass setup_future_usage: https://docs.stripe.com/api/payment_intents/create#create_payment_intent-setup_future_usage
Upon successfully confirming the PaymentIntent client-side the PM will be saved to the Customer
(You also need to pass in a Customer ID to the PaymentIntent creation)
so the server will have to create a payment intent and return the clientsecret and then we will have to call confirmPayment on client side?
The flow we want to maintain tho is to have the sever confirm payments with stripe
Okay then yeah you want to use createConfirmationToken() instead
So I'm a bit confused on the issue you are having overall
In order to display saved payment methods it doesn't matter whether you use createPaymentMethod() (which is legacy and you shouldn't use) or createConfirmationToken() (which is what you should use
And in order to actually save the PaymentMethod for future use you should just pass the necessary parameters that I mentioned above to your PaymentIntent
Sorry let me explain more clearly. I am trying to implement the payment element for our frontend. Our previous flow would call the createPaymentMethod and pass in the paymentMethod Id to the server who then confirms the payment. In using the payment element, I tried to call createPaymentMethod and pass in the payment element. However I am experiencing an integration error from stripe when I do this that says I need to call createConfirmationToken instead in order to save payment details.
I am wondering if I could save payment details using the createPaymentMethod call without having to migrate to the createConfirmationToken
Hi there ๐ taking over, as my colleague needs to step away
Sorry, this is really vague. I believe bismarck already mentioned how to setup and create a new Payment Method object and set it up for future usage so that you can use it to create payments. You create the Payment Intent with the parameters mentioned above (without using Confirmation Token), then you pass the client secret of the Payment Intent into your Payment Element, which creates a new Payment Method and charges it once a customer enters their payment credentials.
Where are you getting blocked?
Hello! We dont pass in a payment intent client secret when creating the payment element though. We instead create the payment element without the payment intent client secret. I am getting blocked because I am creating the payment method manually and its not allowing me to save the payment details in the element in that createPaymentMethod call
You don't call createPaymentMethod(), in any of the Payment Element integration pathways. I'd recommend following this guide to get started, as it describes in detail exactly what you're trying to do: https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=payment
So this documentation https://docs.stripe.com/payments/finalize-payments-on-the-server-legacy is not something I should follow
Unless you have a good reason to be finalizing the payments on the server, no.
That's legacy anyway, which means Stripe has deprecated that workflow
That is the way we have our payment flow setup, if we do finalize the payment on the server, I will have to follow this documentation?https://docs.stripe.com/payments/finalize-payments-on-the-server?platform=web&type=payment
That's the updated way to finalize payments on the server, but (again) I would only use that if you have a good reason to. If you're building net-new functionality, then use the docs I sent you instead
hmm, I understand. Thank you!