woocommerce / woocommerce-gateway-stripe

The official Stripe Payment Gateway for WooCommerce
https://wordpress.org/plugins/woocommerce-gateway-stripe/
237 stars 207 forks source link

Question/Help: Checkout with Store API and payment flow #2725

Open TheAggressive opened 1 year ago

TheAggressive commented 1 year ago

Hello,

Im working on a headless woocommerce store using the Store API. Im having some trouble with the checkout process. In their documentation it says to use { "key": "stripe_source", "value": "src_xxxxxxxxxxxxx" },

My question is, does it have to be src_xxxxxxxxxxxx as stripe documentation says the source has been deprecated. Can this accept a pm_xxxxxxxxxxxxx or does it have to be source?

Im guessing from a high level that the payment is made using stripes elements component and once the payment has been made, the order is attached with this src_xxxxxxxxx id to check on the status of the payment and continues the flow based on that response?

Any help would be greatly appreaciated!!

derpoho commented 1 year ago

Have you had any progress implementing this?

PS: you can use the new payments api too... the plugin accepts pm_xxxxxxxxxxxxx too.

I am hanging on the stripe elements stuff.

TheAggressive commented 1 year ago

Not as far with the plug-in.

What I ended up doing as I'm using a headless approach:

As my approach is headless, I don't really need this plugin to process the payment is ultimately what I came to realize. I can collect the payment using stripe elements and any supported payment methods stripe elements offers and create the order through Woocommerce Rest API. Your situation might be different.

leetcoder314 commented 11 months ago

Not as far with the plug-in.

What I ended up doing as I'm using a headless approach:

  • Use the Store API to show products and Cart functionality.
  • Use Stripe Elements to generate a payment intent with the totals and save customer info (address, email, order items) to payment intent meta.
  • Use Stripes webhook on successful payment to create the order using Woocommerce API and populate the customer info with the saved payment intent meta.

As my approach is headless, I don't really need this plugin to process the payment is ultimately what I came to realize. I can collect the payment using stripe elements and any supported payment methods stripe elements offers and create the order through Woocommerce Rest API. Your situation might be different.

Can you do it without using the Stripe secret key? I am trying to avoid embedding the secret key in a mobile app using store api

TheAggressive commented 11 months ago

Secret key is stored in an eviroment variable as its a website. Not sure if the same can applied in mobile apps.

github-actions[bot] commented 2 months ago

Hi, This issue has gone 150 days (5 months) without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest version, you can help the project by responding to confirm the problem and by providing any updated reproduction steps. Thanks for helping out.

github-actions[bot] commented 1 month ago

This issue has gone 180 days (6 months) without any activity.