Passed
Push — master ( 4ced86...7a5056 )
by mahdi
16:48 queued 13:43
created
src/Drivers/Atipay/Atipay.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@
 block discarded – undo
139 139
                 $error_message = $r['errorMessage'];
140 140
                 throw new InvalidPaymentException($error_message);
141 141
             } else { //success
142
-                $receipt =  $this->createReceipt($params['referenceNumber']);
142
+                $receipt = $this->createReceipt($params['referenceNumber']);
143 143
                 $receipt->detail([
144 144
                     'referenceNo' => $params['referenceNumber'],
145 145
                     'rrn' => Request::input('rrn'),
Please login to merge, or discard this patch.
src/Drivers/Sizpay/Sizpay.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         ))->GetToken2Result;
78 78
         $result = json_decode($response);
79 79
 
80
-        if (! isset($result->ResCod) || ! in_array($result->ResCod, ['0', '00'])) {
80
+        if (!isset($result->ResCod) || !in_array($result->ResCod, ['0', '00'])) {
81 81
             // error has happened
82 82
             $message = $result->Message ?? 'خطای ناشناخته رخ داده';
83 83
             throw new PurchaseFailedException($message);
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
     public function verify() : ReceiptInterface
122 122
     {
123 123
         $resCode = Request::input('ResCod');
124
-        if (! in_array($resCode, array('0', '00'))) {
124
+        if (!in_array($resCode, array('0', '00'))) {
125 125
             $message = 'پرداخت توسط کاربر لغو شد';
126 126
             throw new InvalidPaymentException($message);
127 127
         }
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
         $response = $client->Confirm2($data)->Confirm2Result;
140 140
         $result = json_decode($response);
141 141
 
142
-        if (! isset($result->ResCod) || ! in_array($result->ResCod, array('0', '00'))) {
142
+        if (!isset($result->ResCod) || !in_array($result->ResCod, array('0', '00'))) {
143 143
             $message = $result->Message ?? 'خطا در انجام عملیات رخ داده است';
144 144
             throw new InvalidPaymentException($message);
145 145
         }
Please login to merge, or discard this patch.
src/Drivers/Vandar/Vandar.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
      */
91 91
     public function pay(): RedirectionForm
92 92
     {
93
-        $url = $this->settings->apiPaymentUrl . $this->invoice->getTransactionId();
93
+        $url = $this->settings->apiPaymentUrl.$this->invoice->getTransactionId();
94 94
 
95 95
         return $this->redirectWithForm($url, [], 'GET');
96 96
     }
Please login to merge, or discard this patch.
src/Drivers/Saman/Saman.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     public function __construct(Invoice $invoice, $settings)
38 38
     {
39 39
         $this->invoice($invoice);
40
-        $this->settings = (object)$settings;
40
+        $this->settings = (object) $settings;
41 41
     }
42 42
 
43 43
     /**
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
         $response = $soap->RequestToken($data['MID'], $data['ResNum'], $data['Amount'], $data['CellNumber']);
79 79
 
80
-        $status = (int)$response;
80
+        $status = (int) $response;
81 81
 
82 82
         if ($status < 0) { // if something has done in a wrong way
83 83
             $this->purchaseFailed($response);
@@ -136,13 +136,13 @@  discard block
 block discarded – undo
136 136
                 ]),
137 137
             ]
138 138
         );
139
-        $status = (int)$soap->VerifyTransaction($data['RefNum'], $data['merchantId']);
139
+        $status = (int) $soap->VerifyTransaction($data['RefNum'], $data['merchantId']);
140 140
 
141 141
         if ($status < 0) {
142 142
             $this->notVerified($status);
143 143
         }
144 144
 
145
-        $receipt =  $this->createReceipt($data['RefNum']);
145
+        $receipt = $this->createReceipt($data['RefNum']);
146 146
         $receipt->detail([
147 147
             'traceNo' => Request::input('TraceNo'),
148 148
             'referenceNo' => Request::input('RRN'),
Please login to merge, or discard this patch.
src/Drivers/Aqayepardakht/Aqayepardakht.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     public function pay(): RedirectionForm
92 92
     {
93 93
         $url = $this->settings->mode === "normal" ? $this->settings->apiPaymentUrl : $this->settings->apiPaymentUrlSandbox;
94
-        $url = $url . $this->invoice->getTransactionId();
94
+        $url = $url.$this->invoice->getTransactionId();
95 95
 
96 96
         return $this->redirectWithForm($url, [], 'GET');
97 97
     }
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
     {
107 107
         $tracking_number = Request::post("tracking_number");
108 108
         $transid = Request::post("transid");
109
-        if ($tracking_number === null || $tracking_number === ""|| $transid === ""|| $transid === null) {
109
+        if ($tracking_number === null || $tracking_number === "" || $transid === "" || $transid === null) {
110 110
             $this->notVerified('پرداخت ناموفق.');
111 111
         }
112 112
         $data = [
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
      */
173 173
     protected function getErrorMessage($code)
174 174
     {
175
-        $code = (int)$code;
175
+        $code = (int) $code;
176 176
         switch ($code) {
177 177
             case -1: return "مبلغ نباید خالی باشد.";
178 178
             case -2: return "کد پین درگاه نمیتواند خالی باشد.";
Please login to merge, or discard this patch.
src/Drivers/SEP/SEP.php 1 patch
Spacing   +2 added lines, -2 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
         }
Please login to merge, or discard this patch.
src/Drivers/Azki/Azki.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     public function __construct(Invoice $invoice, $settings)
65 65
     {
66 66
         $this->invoice($invoice);
67
-        $this->settings = (object)$settings;
67
+        $this->settings = (object) $settings;
68 68
         $this->client   = new Client();
69 69
         $this->convertAmountItems();
70 70
     }
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         if (empty($details['phone']) && empty($details['mobile'])) {
78 78
             throw new PurchaseFailedException('Phone number is required');
79 79
         }
80
-        if (!isset($details['items']) ||  count($details['items']) == 0) {
80
+        if (!isset($details['items']) || count($details['items']) == 0) {
81 81
             throw new PurchaseFailedException('Items is required for this driver');
82 82
         }
83 83
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
                 ? $this->settings->fallbackUrl
89 89
                 : $callback;
90 90
         $sub_url     = self::subUrls['purchase'];
91
-        $url         = $this->settings->apiPaymentUrl . $sub_url;
91
+        $url         = $this->settings->apiPaymentUrl.$sub_url;
92 92
 
93 93
         $signature = $this->makeSignature(
94 94
             $sub_url,
@@ -180,8 +180,8 @@  discard block
 block discarded – undo
180 180
          */
181 181
 
182 182
         $new_items = array_map(
183
-            function ($item) {
184
-                $item['amount'] *= 10;  // convert toman to rial
183
+            function($item) {
184
+                $item['amount'] *= 10; // convert toman to rial
185 185
                 return $item;
186 186
             },
187 187
             $this->invoice->getDetails()['items'] ?? []
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
     private function getPaymentStatus()
267 267
     {
268 268
         $sub_url = self::subUrls['paymentStatus'];
269
-        $url     = $this->settings->apiPaymentUrl . $sub_url;
269
+        $url     = $this->settings->apiPaymentUrl.$sub_url;
270 270
 
271 271
         $signature = $this->makeSignature(
272 272
             $sub_url,
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
         ];
304 304
 
305 305
         if (array_key_exists($status, $translations)) {
306
-            throw new PurchaseFailedException("تراکنش در وضعیت " . $translations[$status] . " است.");
306
+            throw new PurchaseFailedException("تراکنش در وضعیت ".$translations[$status]." است.");
307 307
         } else {
308 308
             throw new PurchaseFailedException('خطای ناشناخته ای رخ داده است.');
309 309
         }
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
     private function VerifyTransaction()
327 327
     {
328 328
         $sub_url = self::subUrls['verify'];
329
-        $url     = $this->settings->apiPaymentUrl . $sub_url;
329
+        $url     = $this->settings->apiPaymentUrl.$sub_url;
330 330
 
331 331
         $signature = $this->makeSignature(
332 332
             $sub_url,
Please login to merge, or discard this patch.
src/Drivers/Payfa/Payfa.php 1 patch
Spacing   +3 added lines, -3 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); // Set the invoice.
48
-        $this->settings = (object)$settings; // Set settings.
48
+        $this->settings = (object) $settings; // Set settings.
49 49
         $this->client = new Client();
50 50
     }
51 51
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
      */
105 105
     public function pay(): RedirectionForm
106 106
     {
107
-        $payUrl = $this->settings->apiPaymentUrl . $this->invoice->getTransactionId();
107
+        $payUrl = $this->settings->apiPaymentUrl.$this->invoice->getTransactionId();
108 108
 
109 109
         return $this->redirectWithForm($payUrl, [], 'GET');
110 110
     }
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 
126 126
         $response = $this->client->request(
127 127
             'POST',
128
-            $this->settings->apiVerificationUrl . $paymentId,
128
+            $this->settings->apiVerificationUrl.$paymentId,
129 129
             [
130 130
                 "http_errors" => false,
131 131
                 "headers" => [
Please login to merge, or discard this patch.
src/Drivers/Irankish/Irankish.php 1 patch
Spacing   +4 added lines, -4 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);
Please login to merge, or discard this patch.