From 1f59d0055f9ce11cadaa8f99d6eac76d19302bf0 Mon Sep 17 00:00:00 2001 From: Yiannis Miliaresis Date: Sat, 30 Jan 2016 19:51:36 +0200 Subject: [PATCH] Update create_order.php use JSON_BIGINT_AS_STRING , some versions convert bigint to float --- CreateOrder/PHP/create_order.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/CreateOrder/PHP/create_order.php b/CreateOrder/PHP/create_order.php index 3d004d7d..06afbbe4 100644 --- a/CreateOrder/PHP/create_order.php +++ b/CreateOrder/PHP/create_order.php @@ -42,12 +42,16 @@ // Parse the JSON response try { - if(is_object(json_decode($resBody))){ - $resultObj=json_decode($resBody); - }else{ - preg_match('#^HTTP/1.(?:0|1) [\d]{3} (.*)$#m', $resHeader, $match); - throw new Exception("API Call failed! The error was: ".trim($match[1])); - } + // JSON_BIGINT_AS_STRING + $resultObj = json_decode($resBody, FALSE, 512, JSON_BIGINT_AS_STRING); + + if ( ! is_object($resultObj) ) { + + preg_match('#^HTTP/1.(?:0|1) [\d]{3} (.*)$#m', $resHeader, $match); + throw new \Exception("API Call failed! The error was: " . trim($match[1])); + + } + } catch( Exception $e ) { echo $e->getMessage(); }