Passed
Push — master ( b63130...d7115d )
by mahdi
02:32
created
src/Drivers/Irankish/Irankish.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
     private function generateAuthenticationEnvelope($pubKey, $terminalID, $password, $amount)
44 44
     {
45
-        $data = $terminalID . $password . str_pad($amount, 12, '0', STR_PAD_LEFT) . '00';
45
+        $data = $terminalID.$password.str_pad($amount, 12, '0', STR_PAD_LEFT).'00';
46 46
         $data = hex2bin($data);
47 47
         $AESSecretKey = openssl_random_pseudo_bytes(16);
48 48
         $ivlen = openssl_cipher_iv_length($cipher = "AES-128-CBC");
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         $hmac = hash('sha256', $ciphertext_raw, true);
52 52
         $crypttext = '';
53 53
 
54
-        openssl_public_encrypt($AESSecretKey . $hmac, $crypttext, $pubKey);
54
+        openssl_public_encrypt($AESSecretKey.$hmac, $crypttext, $pubKey);
55 55
 
56 56
         return array(
57 57
             "data" => bin2hex($crypttext),
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
104 104
         curl_setopt($ch, CURLOPT_HTTPHEADER, array(
105 105
             'Content-Type: application/json',
106
-            'Content-Length: ' . strlen($dataString)
106
+            'Content-Length: '.strlen($dataString)
107 107
         ));
108 108
 
109 109
         $result = curl_exec($ch);
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
171 171
         curl_setopt($ch, CURLOPT_HTTPHEADER, array(
172 172
             'Content-Type: application/json',
173
-            'Content-Length: ' . strlen($dataString)
173
+            'Content-Length: '.strlen($dataString)
174 174
         ));
175 175
 
176 176
         $result = curl_exec($ch);
@@ -264,9 +264,9 @@  discard block
 block discarded – undo
264 264
             930 => 'کد ملی ارائه شده نا معتبر می باشد)Tokenization('
265 265
         ];
266 266
         if (array_key_exists($status, $translations)) {
267
-            throw new InvalidPaymentException($translations[$status], (int)$status);
267
+            throw new InvalidPaymentException($translations[$status], (int) $status);
268 268
         } else {
269
-            throw new InvalidPaymentException('خطای ناشناخته ای رخ داده است.', (int)$status);
269
+            throw new InvalidPaymentException('خطای ناشناخته ای رخ داده است.', (int) $status);
270 270
         }
271 271
     }
272 272
 }
Please login to merge, or discard this patch.
src/Drivers/Yekpay/Yekpay.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -166,9 +166,9 @@
 block discarded – undo
166 166
     private function notVerified($message, $status)
167 167
     {
168 168
         if ($message) {
169
-            throw new InvalidPaymentException($message, (int)$status);
169
+            throw new InvalidPaymentException($message, (int) $status);
170 170
         } else {
171
-            throw new InvalidPaymentException('payment failed', (int)$status);
171
+            throw new InvalidPaymentException('payment failed', (int) $status);
172 172
         }
173 173
     }
174 174
 }
Please login to merge, or discard this patch.
src/Drivers/Payping/Payping.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -200,7 +200,7 @@
 block discarded – undo
200 200
      */
201 201
     private function notVerified($message, $status)
202 202
     {
203
-        throw new InvalidPaymentException($message, (int)$status);
203
+        throw new InvalidPaymentException($message, (int) $status);
204 204
     }
205 205
 
206 206
     /**
Please login to merge, or discard this patch.
src/Drivers/Poolam/Poolam.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -155,9 +155,9 @@
 block discarded – undo
155 155
     private function notVerified($message, $status)
156 156
     {
157 157
         if (empty($message)) {
158
-            throw new InvalidPaymentException('خطای ناشناخته ای رخ داده است.', (int)$status);
158
+            throw new InvalidPaymentException('خطای ناشناخته ای رخ داده است.', (int) $status);
159 159
         } else {
160
-            throw new InvalidPaymentException($message, (int)$status);
160
+            throw new InvalidPaymentException($message, (int) $status);
161 161
         }
162 162
     }
163 163
 }
Please login to merge, or discard this patch.
src/Drivers/Idpay/Idpay.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -233,9 +233,9 @@
 block discarded – undo
233 233
             "54" => "مدت زمان تایید پرداخت سپری شده است.",
234 234
         );
235 235
         if (array_key_exists($status, $translations)) {
236
-            throw new InvalidPaymentException($translations[$status], (int)$status);
236
+            throw new InvalidPaymentException($translations[$status], (int) $status);
237 237
         } else {
238
-            throw new InvalidPaymentException('خطای ناشناخته ای رخ داده است.', (int)$status);
238
+            throw new InvalidPaymentException('خطای ناشناخته ای رخ داده است.', (int) $status);
239 239
         }
240 240
     }
241 241
 }
Please login to merge, or discard this patch.
src/Drivers/SEP/SEP.php 1 patch
Spacing   +4 added lines, -4 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->client = new Client([
50 50
             'curl' => [CURLOPT_SSL_CIPHER_LIST => 'DEFAULT@SECLEVEL=1'],
51 51
         ]);
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      */
131 131
     public function verify(): ReceiptInterface
132 132
     {
133
-        $status = (int)Request::input('Status');
133
+        $status = (int) Request::input('Status');
134 134
         if ($status != 2) {
135 135
             $this->purchaseFailed($status);
136 136
         }
@@ -233,9 +233,9 @@  discard block
 block discarded – undo
233 233
         );
234 234
 
235 235
         if (array_key_exists($status, $translations)) {
236
-            throw new InvalidPaymentException($translations[$status], (int)$status);
236
+            throw new InvalidPaymentException($translations[$status], (int) $status);
237 237
         } else {
238
-            throw new InvalidPaymentException('خطای ناشناخته ای رخ داده است.', (int)$status);
238
+            throw new InvalidPaymentException('خطای ناشناخته ای رخ داده است.', (int) $status);
239 239
         }
240 240
     }
241 241
 }
Please login to merge, or discard this patch.
src/Drivers/Rayanpay/Rayanpay.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     public function __construct(Invoice $invoice, $settings)
50 50
     {
51 51
         $this->invoice($invoice);
52
-        $this->settings = (object)$settings;
52
+        $this->settings = (object) $settings;
53 53
         $this->client = new Client(
54 54
             [
55 55
                 'base_uri' => $this->settings->apiPurchaseUrl,
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
         $referenceId = hexdec(uniqid());
115 115
 
116
-        $callback = $this->settings->callbackUrl . "?referenceId=" . $referenceId . "&price=" . $amount . "&mobile=" . $mobile;
116
+        $callback = $this->settings->callbackUrl."?referenceId=".$referenceId."&price=".$amount."&mobile=".$mobile;
117 117
 
118 118
         $data = [
119 119
             'referenceId' => $referenceId,
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
     public function verify(): ReceiptInterface
170 170
     {
171 171
         $data = [
172
-            'referenceId' => (int)$this->getInvoice()->getTransactionId(),
172
+            'referenceId' => (int) $this->getInvoice()->getTransactionId(),
173 173
             'header' => '',
174 174
             'content' => http_build_query($_POST),
175 175
         ];
@@ -295,9 +295,9 @@  discard block
 block discarded – undo
295 295
             }
296 296
         }
297 297
         if ($message) {
298
-            throw new InvalidPaymentException($message, (int)$status);
298
+            throw new InvalidPaymentException($message, (int) $status);
299 299
         } else {
300
-            throw new InvalidPaymentException('خطای ناشناخته ای رخ داده است.', (int)$status);
300
+            throw new InvalidPaymentException('خطای ناشناخته ای رخ داده است.', (int) $status);
301 301
         }
302 302
     }
303 303
 
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
     {
306 306
         $header[] = 'Content-Type: application/json';
307 307
         if ($forAuth) {
308
-            $header[] = 'Authorization: Bearer ' . $this->auth();
308
+            $header[] = 'Authorization: Bearer '.$this->auth();
309 309
         }
310 310
         $ch = curl_init($url);
311 311
         curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
Please login to merge, or discard this patch.
src/Drivers/Local/Local.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
     {
157 157
         $urlWithQuery = $url;
158 158
         foreach ($params as $key => $value) {
159
-            $urlWithQuery .= (parse_url($urlWithQuery, PHP_URL_QUERY) ? '&' : '?') . "{$key}={$value}";
159
+            $urlWithQuery .= (parse_url($urlWithQuery, PHP_URL_QUERY) ? '&' : '?')."{$key}={$value}";
160 160
         }
161 161
         return $urlWithQuery;
162 162
     }
@@ -176,9 +176,9 @@  discard block
 block discarded – undo
176 176
         );
177 177
 
178 178
         if (array_key_exists($status, $translations)) {
179
-            throw new InvalidPaymentException($translations[$status], (int)$status);
179
+            throw new InvalidPaymentException($translations[$status], (int) $status);
180 180
         } else {
181
-            throw new InvalidPaymentException('تراکنش با خطا مواجه شد.', (int)$status);
181
+            throw new InvalidPaymentException('تراکنش با خطا مواجه شد.', (int) $status);
182 182
         }
183 183
     }
184 184
 }
Please login to merge, or discard this patch.
src/Drivers/Sepehr/Sepehr.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     public function __construct(Invoice $invoice, $settings)
39 39
     {
40 40
         $this->invoice($invoice);
41
-        $this->settings = (object)$settings;
41
+        $this->settings = (object) $settings;
42 42
     }
43 43
 
44 44
     /**
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
         $mobile = '';
56 56
         //set CellNumber for get user cards
57 57
         if (!empty($this->invoice->getDetails()['mobile'])) {
58
-            $mobile = '&CellNumber=' . $this->invoice->getDetails()['mobile'];
58
+            $mobile = '&CellNumber='.$this->invoice->getDetails()['mobile'];
59 59
         }
60 60
 
61
-        $data_query = 'Amount=' . $this->test_input($amount) . '&callbackURL=' . $this->test_input($this->settings->callbackUrl) . '&InvoiceID=' . $this->test_input($this->invoice->getUuid()) . '&TerminalID=' . $this->test_input($this->settings->terminalId) . '&Payload=' . $this->test_input("") . $mobile;
61
+        $data_query = 'Amount='.$this->test_input($amount).'&callbackURL='.$this->test_input($this->settings->callbackUrl).'&InvoiceID='.$this->test_input($this->invoice->getUuid()).'&TerminalID='.$this->test_input($this->settings->terminalId).'&Payload='.$this->test_input("").$mobile;
62 62
         $address_service_token = $this->settings->apiGetToken;
63 63
 
64 64
         $token_array = $this->makeHttpChargeRequest('POST', $data_query, $address_service_token);
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             $this->notVerified($resp_code);
112 112
         }
113 113
 
114
-        $data_query = 'digitalreceipt=' . Request::input('digitalreceipt') . '&Tid=' . $this->settings->terminalId;
114
+        $data_query = 'digitalreceipt='.Request::input('digitalreceipt').'&Tid='.$this->settings->terminalId;
115 115
         $advice_array = $this->makeHttpChargeRequest('POST', $data_query, $this->settings->apiVerificationUrl);
116 116
         $decode_advice_array = json_decode($advice_array);
117 117
 
@@ -187,9 +187,9 @@  discard block
 block discarded – undo
187 187
         );
188 188
 
189 189
         if (array_key_exists($status, $translations)) {
190
-            throw new InvalidPaymentException($translations[$status], (int)$status);
190
+            throw new InvalidPaymentException($translations[$status], (int) $status);
191 191
         } else {
192
-            throw new InvalidPaymentException('خطای ناشناخته ای رخ داده است.', (int)$status);
192
+            throw new InvalidPaymentException('خطای ناشناخته ای رخ داده است.', (int) $status);
193 193
         }
194 194
     }
195 195
 
Please login to merge, or discard this patch.