This is the JSON data that I received from a 3rd party app:
"{\"transactionTime\":\"2016-04-14T08:03:20-07:00\",\"receipt\":\"X7MLAFBV\",\"transactionType\":\"TEST_SALE\",\"vendor\":\"wpreelpro\",\"role\":\"VENDOR\",\"totalAccountAmount\":40.62,\"paymentMethod\":\"TEST\",\"totalOrderAmount\":3194.58,\"totalTaxAmount\":0.00,\"totalShippingAmount\":0.00,\"currency\":\"INR\",\"orderLanguage\":\"EN\",\"lineItems\":[{\"itemNo\":\"1\",\"productTitle\":\"WPReelPro (Single Site License)\",\"shippable\":false,\"recurring\":false,\"accountAmount\":40.62,\"quantity\":1,\"downloadUrl\":\"http:\/\/ventture.com\/crm\/index.php\/socket\/receipt\/process\/127\/Clickbank\/?utm_nooverride=1&item=1&cbreceipt=X7MLAFBV&time=1460646200&cbpop=43292B5E&cbaffi=0&cname=Krishna+Ghodke&cemail=krishna%40invanto.com&ccountry=IN&czip=411045&userid=2&product_id=1&gateway_id=37\"}],\"customer\":{\"shipping\":{\"firstName\":\"KRISHNA\",\"lastName\":\"GHODKE\",\"fullName\":\"Krishna Ghodke\",\"email\":\"krishna@invanto.com\",\"address\":{\"postalCode\":\"411045\",\"country\":\"IN\"}},\"billing\":{\"firstName\":\"KRISHNA\",\"lastName\":\"GHODKE\",\"fullName\":\"Krishna Ghodke\",\"email\":\"krishna@invanto.com\",\"address\":{\"postalCode\":\"411045\",\"country\":\"IN\"}}},\"version\":6.0,\"attemptCount\":1,\"vendorVariables\":{\"gateway_id\":\"37\",\"product_id\":\"1\",\"userid\":\"2\",\"utm_nooverride\":\"1\"}}”
Then I ran the following code on this JSON:
$order = json_decode($decrypted, TRUE);
This gave:
{"transactionTime":"2016-04-14T08:03:20-07:00","receipt":"X7MLAFBV","transactionType":"TEST_SALE","vendor":"wpreelpro","role":"VENDOR","totalAccountAmount":40.62,"paymentMethod":"TEST","totalOrderAmount":3194.58,"totalTaxAmount":0,"totalShippingAmount":0,"currency":"INR","orderLanguage":"EN","lineItems":[{"itemNo":"1","productTitle":"WPReelPro (Single Site License)","shippable":false,"recurring":false,"accountAmount":40.62,"quantity":1,"downloadUrl":"http:\/\/ventture.com\/crm\/index.php\/socket\/receipt\/process\/127\/Clickbank\/?utm_nooverride=1&item=1&cbreceipt=X7MLAFBV&time=1460646200&cbpop=43292B5E&cbaffi=0&cname=Krishna+Ghodke&cemail=krishna%40invanto.com&ccountry=IN&czip=411045&userid=2&product_id=1&gateway_id=37"}],"customer":{"shipping":{"firstName":"KRISHNA","lastName":"GHODKE","fullName":"Krishna Ghodke","email":"krishna@invanto.com","address":{"postalCode":"411045","country":"IN"}},"billing":{"firstName":"KRISHNA","lastName":"GHODKE","fullName":"Krishna Ghodke","email":"krishna@invanto.com","address":{"postalCode":"411045","country":"IN"}}},"version":6,"attemptCount":1,"vendorVariables":{"gateway_id":"37","product_id":"1","userid":"2","utm_nooverride":"1”}}
Now, I wish to extract the values as $order[0]->transactionTime (which is first variable in array above). But it doesn’t work. What am I missing?