@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | $statusPhrase = $this->status[$statusCode]; |
| 67 | 67 | } |
| 68 | 68 | parent::__construct($statusPhrase, $statusCode); |
| 69 | - $header = sprintf('HTTP/1.1 %d %s', $statusCode, $statusPhrase); |
|
| 69 | + $header = sprintf('HTTP/1.1 %d %s', $statusCode, $statusPhrase); |
|
| 70 | 70 | $this->addHeader($header); |
| 71 | 71 | $this->addHeaders($headers); |
| 72 | 72 | } |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | { |
| 103 | 103 | foreach ($headers as $key => $header) { |
| 104 | 104 | if (!is_int($key)) { |
| 105 | - $header = $key.': '.$header; |
|
| 105 | + $header = $key . ': ' . $header; |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | $this->addHeader($header); |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | /** |
| 31 | 31 | * @var array $allowedCountries |
| 32 | 32 | */ |
| 33 | - private $allowedCountries = array('IT', 'ES', 'PT', 'FR'); |
|
| 33 | + private $allowedCountries = array('IT', 'ES', 'PT', 'FR'); |
|
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * Configuration constructor. |
@@ -438,7 +438,7 @@ |
||
| 438 | 438 | function get_GetMethod() |
| 439 | 439 | { |
| 440 | 440 | if (!isGetActionValid()) { |
| 441 | - return 'createOrder'; |
|
| 441 | + return 'createOrder'; |
|
| 442 | 442 | |
| 443 | 443 | }; |
| 444 | 444 | $method = json_decode(json_encode($_GET)); |
@@ -23,10 +23,10 @@ discard block |
||
| 23 | 23 | try { |
| 24 | 24 | $fileName = basename(__FILE__); |
| 25 | 25 | $withDate = true; |
| 26 | - writeLog('Creating Client', $fileName,$withDate); |
|
| 26 | + writeLog('Creating Client', $fileName, $withDate); |
|
| 27 | 27 | $orderApiClient = getClient(); |
| 28 | - writeLog('Client Created', $fileName,$withDate); |
|
| 29 | - writeLog('Fetching Authorized Orders', $fileName,$withDate); |
|
| 28 | + writeLog('Client Created', $fileName, $withDate); |
|
| 29 | + writeLog('Fetching Authorized Orders', $fileName, $withDate); |
|
| 30 | 30 | $authorizedOrders = $orderApiClient->listOrders(array( |
| 31 | 31 | 'status' => \Pagantis\OrdersApiClient\Model\Order::STATUS_AUTHORIZED |
| 32 | 32 | )); |
@@ -34,16 +34,16 @@ discard block |
||
| 34 | 34 | if (!isAuthorizedOrderCountAboveZero($authorizedOrders)) { |
| 35 | 35 | $createdOrders = $orderApiClient->listOrders(array( |
| 36 | 36 | 'status' => \Pagantis\OrdersApiClient\Model\Order::STATUS_CREATED)); |
| 37 | - print("<pre>" . print_r("Number of Created Orders: ". count($createdOrders)."\n"."Number of Authorized Orders: " . count($authorizedOrders)."\n"."", true) . "</pre>"); |
|
| 37 | + print("<pre>" . print_r("Number of Created Orders: " . count($createdOrders) . "\n" . "Number of Authorized Orders: " . count($authorizedOrders) . "\n" . "", true) . "</pre>"); |
|
| 38 | 38 | exit(); |
| 39 | 39 | } |
| 40 | - writeLog('Confirming all Authorized Orders', $fileName,$withDate); |
|
| 40 | + writeLog('Confirming all Authorized Orders', $fileName, $withDate); |
|
| 41 | 41 | |
| 42 | - $confirmedOrders = getConfirmedOrdersRecursively($authorizedOrders,$orderApiClient); |
|
| 42 | + $confirmedOrders = getConfirmedOrdersRecursively($authorizedOrders, $orderApiClient); |
|
| 43 | 43 | |
| 44 | 44 | |
| 45 | - writeLog('Orders Confirmed', $fileName,$withDate); |
|
| 46 | - writeLog(jsonEncoded($confirmedOrders), $fileName,$withDate); |
|
| 45 | + writeLog('Orders Confirmed', $fileName, $withDate); |
|
| 46 | + writeLog(jsonEncoded($confirmedOrders), $fileName, $withDate); |
|
| 47 | 47 | /** WARNING: orders must be confirmed on your back office or you will get a empty object */ |
| 48 | 48 | print("<pre>" . print_r($confirmedOrders, true) . "</pre>"); |
| 49 | 49 | |
@@ -26,17 +26,17 @@ |
||
| 26 | 26 | $refundTotalAmount = $_POST['refundOrderAmount']; |
| 27 | 27 | $refundOrderID = $_POST['refundOrderID']; |
| 28 | 28 | try { |
| 29 | - writeLog('Creating Client', $fileName,$withDate); |
|
| 29 | + writeLog('Creating Client', $fileName, $withDate); |
|
| 30 | 30 | $orderApiClient = getClient(); |
| 31 | - writeLog('Client Created', $fileName,$withDate); |
|
| 32 | - writeLog('Setting Refund', $fileName,$withDate); |
|
| 31 | + writeLog('Client Created', $fileName, $withDate); |
|
| 32 | + writeLog('Setting Refund', $fileName, $withDate); |
|
| 33 | 33 | $refund = new \Pagantis\OrdersApiClient\Model\Order\Refund(); |
| 34 | 34 | $refund |
| 35 | 35 | ->setPromotedAmount(0) |
| 36 | 36 | ->setTotalAmount($refundTotalAmount); |
| 37 | - writeLog('Refund Set', $fileName,$withDate); |
|
| 37 | + writeLog('Refund Set', $fileName, $withDate); |
|
| 38 | 38 | $refundCreated = $orderApiClient->refundOrder($refundOrderID, $refund); |
| 39 | - writeLog(jsonEncoded($refundCreated), $fileName,$withDate); |
|
| 39 | + writeLog(jsonEncoded($refundCreated), $fileName, $withDate); |
|
| 40 | 40 | |
| 41 | 41 | $refundedOrder = $orderApiClient->getOrder($refundOrderID, $asJson); |
| 42 | 42 | $refundsArray = jsonToArray($refundedOrder); |
@@ -32,18 +32,18 @@ |
||
| 32 | 32 | try { |
| 33 | 33 | $withDate = true; |
| 34 | 34 | $fileName = basename(__FILE__); |
| 35 | - writeLog('Creating Client', $fileName,$withDate); |
|
| 35 | + writeLog('Creating Client', $fileName, $withDate); |
|
| 36 | 36 | $orderApiClient = new \Pagantis\OrdersApiClient\Client( |
| 37 | 37 | PUBLIC_KEY, |
| 38 | 38 | PRIVATE_KEY |
| 39 | 39 | ); |
| 40 | - writeLog('Client Created', $fileName,$withDate); |
|
| 41 | - writeLog('Fetching Orders', $fileName,$withDate); |
|
| 40 | + writeLog('Client Created', $fileName, $withDate); |
|
| 41 | + writeLog('Fetching Orders', $fileName, $withDate); |
|
| 42 | 42 | /** WARNING: orders must be confirmed on your back office or you will get a empty object */ |
| 43 | 43 | $orders = $orderApiClient->listOrders($queryString); |
| 44 | - writeLog('Orders Fetched', $fileName,$withDate); |
|
| 44 | + writeLog('Orders Fetched', $fileName, $withDate); |
|
| 45 | 45 | |
| 46 | - writeLog(jsonEncoded($orders), $fileName,$withDate); |
|
| 46 | + writeLog(jsonEncoded($orders), $fileName, $withDate); |
|
| 47 | 47 | print("<pre>" . print_r($orders, true) . "</pre>"); |
| 48 | 48 | |
| 49 | 49 | } catch (\Exception $exception) { |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | const PUBLIC_KEY = ''; //Set your public key |
| 9 | 9 | const PRIVATE_KEY = ''; //Set your public key |
| 10 | 10 | |
| 11 | -if (!isset($_POST['getOrderID'])){ |
|
| 11 | +if (!isset($_POST['getOrderID'])) { |
|
| 12 | 12 | throw new \Exception('You need to input the Order ID'); |
| 13 | 13 | } |
| 14 | 14 | try { |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | $orderApiClient = new Client(PUBLIC_KEY, PRIVATE_KEY); |
| 18 | 18 | $order = $orderApiClient->getOrder($orderID); |
| 19 | 19 | $fileName = basename(__FILE__); |
| 20 | - writeLog("Order ID: ".$order->getId(),$fileName, true); |
|
| 20 | + writeLog("Order ID: " . $order->getId(), $fileName, true); |
|
| 21 | 21 | print("<pre>" . print_r($order, true) . "</pre>"); |
| 22 | 22 | |
| 23 | 23 | } catch (Exception $e) { |