Get the order id on Woocommerce checkout when order is already created but payment is pending

Question

I’m finding out how WC get the order details when an order already created is attempting to be paid again (may be due a failure or when user cancels the payment and try to pay later). The current methods to get the order_id seems not work here. On web developers tools I noticed that the checkout page generates a GET response like this:

https://{domain_name}/checkout/order-pay/{order_id}/?pay_for_order=true&key=wc_order_aoM9FKSNpJ

This data is showing up within the “File” columns on web developers tools.

… but I’m unable to “get” the order_id from that URL, isn’t like params that you can retrieve using GET methods. In fact, the real URL looks like https://{domain_name}/checkout/

I’m just need only that order_id… any ideas?

0
Diego Moreno 2 months 2022-09-27T16:38:02-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse