scottyzen / woonuxt

Static e-commerce powered by WooCommerce & Nuxt
https://woonuxt.com
GNU General Public License v3.0
574 stars 140 forks source link

fix: fixed 3D Secure payment popup not showing #132

Closed softwaredevzestgeek closed 3 months ago

netlify[bot] commented 4 months ago

Deploy request for sleepy-chandrasekhar-717c3d rejected.

Name Link
Latest commit a3db6ca7c1e16a610c13033b348b401f2cdbbf37
scottyzen commented 4 months ago

Hi @softwaredevzestgeek, what do you have set as the 'API_HOST'? Also, have you added your own custom functions to your WordPress site?

amcolex commented 4 months ago

@scottyzen i reached out to softwaredevzestgeek for help in getting the 3ds to work. This PR was the work in progress of that effort. Since then I've made some more progress.

I created a plugin which extends the graphql library to expose a createPaymentIntent method:

https://github.com/Amcolex/wc-stripe-headless-graphql

and the corresponding frontend checkout flow:

https://github.com/Amcolex/woonuxt/tree/feature/stripe-payment-intent-flow

The trick I'm using is triggering the checkout at the start (which fails), in order to create an order+orderKey, and then use that to generate the proper Payment Intent from the backend. Its a bit hacky, but I don't know of a better solution.

Once the payment is completed the stripe webhook automatically sets the order status to 'Processing'.

This is all very new to me, so i have no idea if this is actually any good. If it makes sense, I'd be happy to see these merged into woonuxt-settings and woonuxt