#richard_33032
1 messages · Page 1 of 1 (latest)
Hello, this guide will help you do that https://stripe.com/docs/payments/finalize-payments-on-the-server
The Stripe.js setup and calls are a bit different, basically you create a PaymentMethod object, sent its ID to the server and then confirm with that
I want to avoid making any JavaScript calls to Stripe's APIs, instead I want to pass Stripe's payment element form to my server and process the payment on the server
JS is required to instantiate Elements and collect payment info without having a higher PCI compliance requirement. To do the flow that you are describing, you will need to do the JS calls in that doc. Is there a reason that you are looking to avoid all JS calls?
I want to avoid as much JavaScript calls because in my order check-out process, there are a series of business logic that has to be completed and validated before collecting the actual payment.
I have not issues rendering the payment element form with JavaScript..\
To be clear, you can still do that. With the doc I linked, you would create the PaymentMethod and sent its ID to your server, you can do whatever amount of checks you want at that point before using the PaymentMethod to confirm a payment intent
I have skimmed over the article and it seems that most of the processing is still in JavaScript? I need to look into it a bit more to see exactly how the payment flow works in that article
Does that article make the api call to confirm the payment on the server side?
Yes
The creation and confirmation of the PaymentIntent is server side
So you can do your checks on the server before that step
Ok.. that might work. I will dig into the article and see what I can achieve with it.
In my order checkout process.. collecting the payment is one of the last processed that I do (besides sending out emails).
Gotcha, and do you see that conflicting with what is in that doc?