I have made a script that parses a functioning WooCommerce Webhook or sample JSON WooCommerce Documentation just fine. Everything works in the script with a self-hosted, json file literally copy/pasted from WooCommerce documentation and viewable by any browser (order.json)
However, upon using a functioning WooCommerce Payload, the script does not receive the data from the nested “Shipping” JSON object in the payload. It does successfully receive JSON keys and values from the non-nested section of the payload.
I repeat: when I use my script to parse JSON from a file of WooCommerce Sample JSON data, it works fine.
When I use payload data, the script gets “number” & “date_created_gmt”, but does not get “first_name” etc… from the nested element “shipping”.
On the payload and the sample data from file this syntax works: $order->date_created_gmt
On the sample data file this syntax works: $order->shipping->address_1
On the payload it does not return “address_1”
Can somebody help me understand why I can parse WooCommerce Sample Data but not the same syntax on live WooCommerce Payload data, and get my script up and running?
The page I need help with: [log in to see the link]
- The topic ‘Webhook script parses sample data fine but not payload’ is closed to new replies.