#jess_docs

1 messages ยท Page 1 of 1 (latest)

glass cliffBOT
#

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

trail venture
#

Hello

#

Is there a reason you are following the "finalize payments on the server" flow?

scenic axle
#

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?

trail venture
#

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

scenic axle
#

From the doc you provided, we are charging the customer off session but in our payment flow, the customer is present in the session.

trail venture
#

Ah thought you said you were saving to charge later

#

But you are charging and saving to charge later

#

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)

scenic axle
#

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

trail venture
#

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

glass cliffBOT
scenic axle
#

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

heavy wraith
#

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?

scenic axle
#

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

heavy wraith
scenic axle
heavy wraith
#

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

scenic axle
heavy wraith
#

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

scenic axle
#

hmm, I understand. Thank you!