I'm building Stripe based checkout and I want to create new order by using Woocommerce functions whenever 'payment_intent.succeeded' event happens. Problem is that global $woocommerce returns null. How do I import global $woocommerce successfully so that I can create orders programmatically?
I have tried importing wp-load.php file as mentioned in other threads with similar question, but that didn't seem to work.