Passed
Branch master (a59706)
by Burak
03:28
created
src/Message/StatusRequest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
     public function getData()
14 14
     {
15 15
         $data = parent::getData();
16
-        $data['QAResultStatus']='000';
16
+        $data['QAResultStatus'] = '000';
17 17
         $data['TransactionId'] = $this->getTransactionReference();
18 18
         return $data;
19 19
     }
Please login to merge, or discard this patch.
src/Message/Response.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
             //The parameter name in the confirmation JSON is UniqueKey because in case there is no UserKey (was not sent in the initial JSON) you can perform confirmation using TransactionId instead.
27 27
             $request = [
28 28
                 "ConfirmationKey" => $this->data['ResultData']['ConfirmationKey'],
29
-                "UniqueKey" => $this->request->getTransactionId()?$this->request->getTransactionId():$this->data['ResultData']['TransactionId'],
29
+                "UniqueKey" => $this->request->getTransactionId() ? $this->request->getTransactionId() : $this->data['ResultData']['TransactionId'],
30 30
                 "TotalX100" => $this->data['ResultData']['DebitTotal']
31 31
             ];
32 32
             $httpClient = new HttpClient('', array(
@@ -60,11 +60,11 @@  discard block
 block discarded – undo
60 60
 
61 61
     public function getTransactionReference()
62 62
     {
63
-        if (isset($this->data['URL']) && ! empty($this->data['URL'])) {
63
+        if (isset($this->data['URL']) && !empty($this->data['URL'])) {
64 64
             $url = parse_url($this->data['URL']);
65
-            if (! empty($url['query'])) {
65
+            if (!empty($url['query'])) {
66 66
                 parse_str($url['query'], $query);
67
-                if (! empty($query['transactionId'])) {
67
+                if (!empty($query['transactionId'])) {
68 68
                     return $query['transactionId'];
69 69
                 }
70 70
             }
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
     public function isRedirect()
83 83
     {
84
-        if (isset($this->data['URL']) && ! empty($this->data['URL'])) {
84
+        if (isset($this->data['URL']) && !empty($this->data['URL'])) {
85 85
             return true;
86 86
         }
87 87
         return false;
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,8 +41,9 @@
 block discarded – undo
41 41
             ], json_encode($request));
42 42
             $httpResponse = $httpRequest->send();
43 43
             return $httpResponse->json() == 1;
44
-        } else
45
-            return false;
44
+        } else {
45
+                    return false;
46
+        }
46 47
     }
47 48
 
48 49
     public function isCancelled()
Please login to merge, or discard this patch.
src/Message/AuthorizeRequest.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,13 +19,13 @@  discard block
 block discarded – undo
19 19
         $data['ErrorURL'] = $this->getReturnUrl();
20 20
         $data['CancelURL'] = $this->getCancelUrl();
21 21
         $data['CardHolderName'] = $this->getCard()->getName();
22
-        $data['CustomerAddressField'] = implode(' ',[$this->getCard()->getAddress1(),$this->getCard()->getAddress2()]);
22
+        $data['CustomerAddressField'] = implode(' ', [$this->getCard()->getAddress1(), $this->getCard()->getAddress2()]);
23 23
         $data['CustomerCityField'] = $this->getCard()->getCity();
24 24
         $data['CustomerIndexField'] = $this->getCard()->getPostcode();
25 25
         $data['CustomerCountryField'] = $this->getCard()->getCountry();
26 26
         $data['EmailField'] = $this->getCard()->getEmail();
27
-        if($this->getParameter('Language')) $data['Language'] = $this->getParameter('Language');
28
-        if($this->getParameter('QAResultStatus')) $data['QAResultStatus'] = $this->getParameter('QAResultStatus');
27
+        if ($this->getParameter('Language')) $data['Language'] = $this->getParameter('Language');
28
+        if ($this->getParameter('QAResultStatus')) $data['QAResultStatus'] = $this->getParameter('QAResultStatus');
29 29
         return $data;
30 30
     }
31 31
     
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         if ($value !== null) {
63 63
             $value = strtoupper($value);
64 64
         }
65
-        if(!in_array($value, ['HE','EN','RU'])) {
65
+        if (!in_array($value, ['HE', 'EN', 'RU'])) {
66 66
             throw new RuntimeException('Unknown language');
67 67
         }
68 68
         return $this->setParameter('Language', $value);
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,12 @@
 block discarded – undo
24 24
         $data['CustomerIndexField'] = $this->getCard()->getPostcode();
25 25
         $data['CustomerCountryField'] = $this->getCard()->getCountry();
26 26
         $data['EmailField'] = $this->getCard()->getEmail();
27
-        if($this->getParameter('Language')) $data['Language'] = $this->getParameter('Language');
28
-        if($this->getParameter('QAResultStatus')) $data['QAResultStatus'] = $this->getParameter('QAResultStatus');
27
+        if($this->getParameter('Language')) {
28
+            $data['Language'] = $this->getParameter('Language');
29
+        }
30
+        if($this->getParameter('QAResultStatus')) {
31
+            $data['QAResultStatus'] = $this->getParameter('QAResultStatus');
32
+        }
29 33
         return $data;
30 34
     }
31 35
     
Please login to merge, or discard this patch.
src/Message/AbstractRequest.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,12 +23,12 @@
 block discarded – undo
23 23
     public function getData()
24 24
     {
25 25
         $this->request = array();
26
-        if($this->getTestMode()){
26
+        if ($this->getTestMode()) {
27 27
             $this->request['user'] = 'testpelecard3';
28 28
             $this->request['password'] = 'Q3EJB8Ah';
29 29
             $this->request['terminal'] = '0962210';
30 30
         }
31
-        else{
31
+        else {
32 32
             $this->request['user'] = $this->getParameter('user');
33 33
             $this->request['password'] = $this->getParameter('password');
34 34
             $this->request['terminal'] = $this->getParameter('terminal');
Please login to merge, or discard this patch.
Braces   +10 added lines, -8 removed lines patch added patch discarded remove patch
@@ -27,8 +27,7 @@  discard block
 block discarded – undo
27 27
             $this->request['user'] = 'testpelecard3';
28 28
             $this->request['password'] = 'Q3EJB8Ah';
29 29
             $this->request['terminal'] = '0962210';
30
-        }
31
-        else{
30
+        } else{
32 31
             $this->request['user'] = $this->getParameter('user');
33 32
             $this->request['password'] = $this->getParameter('password');
34 33
             $this->request['terminal'] = $this->getParameter('terminal');
@@ -141,12 +140,15 @@  discard block
 block discarded – undo
141 140
         if ($value !== null) {
142 141
             $value = strtoupper($value);
143 142
         }
144
-        if ($value == 'NIS')
145
-            return $this->setParameter('currency', 1);
146
-        if ($value == 'USD')
147
-            return $this->setParameter('currency', 2);
148
-        if ($value == 'EUR')
149
-            return $this->setParameter('currency', 978);
143
+        if ($value == 'NIS') {
144
+                    return $this->setParameter('currency', 1);
145
+        }
146
+        if ($value == 'USD') {
147
+                    return $this->setParameter('currency', 2);
148
+        }
149
+        if ($value == 'EUR') {
150
+                    return $this->setParameter('currency', 978);
151
+        }
150 152
         throw new RuntimeException('Unknown currency');
151 153
     }
152 154
 
Please login to merge, or discard this patch.