Passed
Pull Request — master (#127)
by
unknown
02:33
created
src/Drivers/Fanavacard/Fanavacard.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     public function __construct(Invoice $invoice, $settings)
46 46
     {
47 47
         $this->invoice($invoice);
48
-        $this->settings = (object)$settings;
48
+        $this->settings = (object) $settings;
49 49
         $this->httpClientInit();
50 50
     }
51 51
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     public function purchase()
60 60
     {
61 61
         $this->invoice->uuid(crc32($this->invoice->getUuid()));
62
-        $token  = $this->getToken();
62
+        $token = $this->getToken();
63 63
         $this->invoice->transactionId($token['Token']);
64 64
 
65 65
         return $this->invoice->getTransactionId();
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     {
93 93
         $transaction_amount = Request::input('transactionAmount');
94 94
 
95
-        if($this->invoice->getAmount()*10 == $transaction_amount) {
95
+        if ($this->invoice->getAmount() * 10 == $transaction_amount) {
96 96
 
97 97
             $param = ['Token'=>Request::input('token'), 'RefNum'=>Request::input('RefNum')];
98 98
             $response = $this->client->post($this->settings->apiVerificationUrl, [
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             $response_data = json_decode($response->getBody()->getContents());
105 105
             if ($response_data->Result != 'erSucceed') {
106 106
                 return throw new InvalidPaymentException($response_data->Result);
107
-            } elseif ($this->invoice->getAmount()*10 != $response_data->Amount) {
107
+            } elseif ($this->invoice->getAmount() * 10 != $response_data->Amount) {
108 108
                 $this->client->post(
109 109
                     $this->settings->apiReverseAmountUrl,
110 110
                     [
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
                 'RedirectUrl'=>$this->settings->callbackUrl,
165 165
             ]]);
166 166
 
167
-        if($response->getStatusCode() != 200) {
167
+        if ($response->getStatusCode() != 200) {
168 168
             return throw new PurchaseFailedException(
169 169
                 "cant get token |  {$response->getBody()->getContents()}",
170 170
                 $response->getStatusCode()
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
         }
173 173
 
174 174
         $response_data = json_decode($response->getBody()->getContents());
175
-        if($response_data->Result != 'erSucceed') {
175
+        if ($response_data->Result != 'erSucceed') {
176 176
             return throw new PurchaseFailedException(
177 177
                 "cant get token |  {$response->getBody()->getContents()}",
178 178
                 $response->getStatusCode()
@@ -185,10 +185,10 @@  discard block
 block discarded – undo
185 185
     private function httpClientInit(): void
186 186
     {
187 187
         $this->client = new Client([
188
-                                       'curl'=>[\CURLOPT_SSL_CIPHER_LIST=>'DEFAULT@SECLEVEL=1',],
188
+                                       'curl'=>[\CURLOPT_SSL_CIPHER_LIST=>'DEFAULT@SECLEVEL=1', ],
189 189
                                        'verify' => false,
190 190
                                        'base_uri' => $this->settings->baseUri,
191
-                                       'headers' => ['Content-Type' => 'application/json',],
191
+                                       'headers' => ['Content-Type' => 'application/json', ],
192 192
                                    ]);
193 193
     }
194 194
 
Please login to merge, or discard this patch.