@@ -149,7 +149,9 @@ |
||
| 149 | 149 | $params .= "&color=" . $this->getConfigSettings()->getEnvConfig('VIVA_SMARTCHECKOUT_COLOR'); |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - if ($color) $params .= "&color=" . $color; |
|
| 152 | + if ($color) { |
|
| 153 | + $params .= "&color=" . $color; |
|
| 154 | + } |
|
| 153 | 155 | |
| 154 | 156 | |
| 155 | 157 | if ($lang instanceof RequestLang) { |
@@ -30,7 +30,9 @@ discard block |
||
| 30 | 30 | public function getByTransaction($vivaTransaction) |
| 31 | 31 | { |
| 32 | 32 | // https://demo.vivapayments.com/api/transactions/:transaction_id |
| 33 | - if (!$vivaTransaction) throw new \Exception('Invalid transaction code'); |
|
| 33 | + if (!$vivaTransaction) { |
|
| 34 | + throw new \Exception('Invalid transaction code'); |
|
| 35 | + } |
|
| 34 | 36 | $url = $this->getConfigSettings()->getEnvConfig('VIVA_URL'); |
| 35 | 37 | $curl = new CurlWrapper($url . '/api/transactions/' . $vivaTransaction); |
| 36 | 38 | $curl->addHeader('Content-Type: application/json'); |
@@ -61,7 +63,9 @@ discard block |
||
| 61 | 63 | public function getByTransactionV2($vivaTransaction) |
| 62 | 64 | { |
| 63 | 65 | // https://demo.vivapayments.com/checkout/v2/transactions/:transaction_id |
| 64 | - if (!$vivaTransaction) throw new \Exception('Invalid transaction code'); |
|
| 66 | + if (!$vivaTransaction) { |
|
| 67 | + throw new \Exception('Invalid transaction code'); |
|
| 68 | + } |
|
| 65 | 69 | $token = $this->accessToken->getToken(); |
| 66 | 70 | $url = $this->getConfigSettings()->getEnvConfig('VIVA_API_URL') . '/checkout/v2/transactions/' . $vivaTransaction; |
| 67 | 71 | $curl = new CurlWrapper($url); |
@@ -79,7 +83,9 @@ discard block |
||
| 79 | 83 | public function getByOrderCode($orderCode) |
| 80 | 84 | { |
| 81 | 85 | // https://demo.vivapayments.com/api/orders/:orderCode |
| 82 | - if (!$orderCode) throw new \Exception('Invalid transaction code'); |
|
| 86 | + if (!$orderCode) { |
|
| 87 | + throw new \Exception('Invalid transaction code'); |
|
| 88 | + } |
|
| 83 | 89 | $url = $this->getConfigSettings()->getEnvConfig('VIVA_URL'); |
| 84 | 90 | $curl = new CurlWrapper($url . '/api/orders/' . $orderCode); |
| 85 | 91 | $curl->addHeader('Content-Type: application/json'); |