@@ -13,7 +13,7 @@ |
||
| 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 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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; |
@@ -19,13 +19,13 @@ discard block |
||
| 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 |
||
| 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);
|
@@ -23,12 +23,12 @@ |
||
| 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'); |