@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | public function serialize($data, $options = array()) |
54 | 54 | { |
55 | - $options = $this->setDefaults((array) $options); |
|
55 | + $options = $this->setDefaults((array)$options); |
|
56 | 56 | return $this->createXML($options['root_name'], $data)->saveXml(); |
57 | 57 | } |
58 | 58 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | { |
102 | 102 | $xml = $this->getXMLRoot(); |
103 | 103 | $xml->appendChild($this->convert($node_name, $arr)); |
104 | - $this->xml = null; // clear the xml node in the class for 2nd time use. |
|
104 | + $this->xml = null; // clear the xml node in the class for 2nd time use. |
|
105 | 105 | return $xml; |
106 | 106 | } |
107 | 107 | |
@@ -127,8 +127,8 @@ discard block |
||
127 | 127 | foreach ($arr['@attributes'] as $key => $value) { |
128 | 128 | if (!$this->isValidTagName($key)) { |
129 | 129 | throw new Exception( |
130 | - '[Array2XML] Illegal character in attribute name. attribute: '. |
|
131 | - $key.' in node: '.$node_name |
|
130 | + '[Array2XML] Illegal character in attribute name. attribute: ' . |
|
131 | + $key . ' in node: ' . $node_name |
|
132 | 132 | ); |
133 | 133 | } |
134 | 134 | $node->setAttribute($key, $this->bool2str($value)); |
@@ -139,12 +139,12 @@ discard block |
||
139 | 139 | // else check if its directly stored as string |
140 | 140 | if (isset($arr['@value'])) { |
141 | 141 | $node->appendChild($xml->createTextNode($this->bool2str($arr['@value']))); |
142 | - unset($arr['@value']); //remove the key from the array once done. |
|
142 | + unset($arr['@value']); //remove the key from the array once done. |
|
143 | 143 | //return from recursion, as a note with value cannot have child nodes. |
144 | 144 | return $node; |
145 | 145 | } elseif (isset($arr['@cdata'])) { |
146 | 146 | $node->appendChild($xml->createCDATASection($this->bool2str($arr['@cdata']))); |
147 | - unset($arr['@cdata']); //remove the key from the array once done. |
|
147 | + unset($arr['@cdata']); //remove the key from the array once done. |
|
148 | 148 | //return from recursion, as a note with cdata cannot have child nodes. |
149 | 149 | return $node; |
150 | 150 | } |
@@ -155,8 +155,8 @@ discard block |
||
155 | 155 | foreach ($arr as $key => $value) { |
156 | 156 | if (!$this->isValidTagName($key)) { |
157 | 157 | throw new Exception( |
158 | - '[Array2XML] Illegal character in tag name. tag: '. |
|
159 | - $key.' in node: '.$node_name |
|
158 | + '[Array2XML] Illegal character in tag name. tag: ' . |
|
159 | + $key . ' in node: ' . $node_name |
|
160 | 160 | ); |
161 | 161 | } |
162 | 162 | if (is_array($value) && is_numeric(key($value))) { |
@@ -85,13 +85,13 @@ |
||
85 | 85 | */ |
86 | 86 | protected function buildRequest(Request $request, $requestBuilder) |
87 | 87 | { |
88 | - $rawRequest = call_user_func(array( $this, $requestBuilder ), $request); |
|
88 | + $rawRequest = call_user_func(array($this, $requestBuilder), $request); |
|
89 | 89 | $serializer = new Serializer(Serializer::XML); |
90 | 90 | $xml = $serializer->serialize( |
91 | 91 | array_merge($this->buildBaseRequest(), $rawRequest), |
92 | - array( 'root_name' => 'posnetRequest' ) |
|
92 | + array('root_name' => 'posnetRequest') |
|
93 | 93 | ); |
94 | - return array( 'xmldata' => $xml ); |
|
94 | + return array('xmldata' => $xml); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -144,10 +144,10 @@ |
||
144 | 144 | { |
145 | 145 | $client = new HttpClient(); |
146 | 146 | $client->setConfig(array( |
147 | - 'curl.options' => array( |
|
148 | - CURLOPT_SSL_VERIFYPEER => false, |
|
149 | - CURLOPT_SSL_VERIFYHOST => false, |
|
150 | - ) |
|
147 | + 'curl.options' => array( |
|
148 | + CURLOPT_SSL_VERIFYPEER => false, |
|
149 | + CURLOPT_SSL_VERIFYHOST => false, |
|
150 | + ) |
|
151 | 151 | )); |
152 | 152 | $request = $client->post($url, null, $data); |
153 | 153 | try { |
@@ -86,13 +86,13 @@ |
||
86 | 86 | */ |
87 | 87 | protected function buildRequest(Request $request, $requestBuilder) |
88 | 88 | { |
89 | - $rawRequest = call_user_func(array( $this, $requestBuilder ), $request); |
|
89 | + $rawRequest = call_user_func(array($this, $requestBuilder), $request); |
|
90 | 90 | $serializer = new Serializer(Serializer::XML); |
91 | 91 | $xml = $serializer->serialize( |
92 | 92 | array_merge($rawRequest, $this->buildBaseRequest()), |
93 | - array( 'root_name' => 'CC5Request' ) |
|
93 | + array('root_name' => 'CC5Request') |
|
94 | 94 | ); |
95 | - return array( 'DATA' => $xml ); |
|
95 | + return array('DATA' => $xml); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
@@ -313,13 +313,13 @@ discard block |
||
313 | 313 | */ |
314 | 314 | protected function buildRequest(Request $request, $requestBuilder) |
315 | 315 | { |
316 | - $rawRequest = call_user_func(array( $this, $requestBuilder ), $request); |
|
316 | + $rawRequest = call_user_func(array($this, $requestBuilder), $request); |
|
317 | 317 | $serializer = new Serializer(Serializer::XML); |
318 | 318 | $xml = $serializer->serialize( |
319 | 319 | $rawRequest, |
320 | - array( 'root_name' => 'GVPSRequest' ) |
|
320 | + array('root_name' => 'GVPSRequest') |
|
321 | 321 | ); |
322 | - return array( 'data' => $xml ); |
|
322 | + return array('data' => $xml); |
|
323 | 323 | } |
324 | 324 | |
325 | 325 | /** |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | */ |
329 | 329 | protected function buildPreAuthorizationRequest(Request $request) |
330 | 330 | { |
331 | - $requestData = array( 'Card' => $this->buildCard($request) ); |
|
331 | + $requestData = array('Card' => $this->buildCard($request)); |
|
332 | 332 | return array_merge($requestData, $this->buildBaseRequest($request, self::TRANSACTION_TYPE_PREAUTHORIZATION)); |
333 | 333 | } |
334 | 334 | |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | */ |
349 | 349 | protected function buildSaleRequest(Request $request) |
350 | 350 | { |
351 | - $requestData = array( 'Card' => $this->buildCard($request) ); |
|
351 | + $requestData = array('Card' => $this->buildCard($request)); |
|
352 | 352 | return array_merge($requestData, $this->buildBaseRequest($request, self::TRANSACTION_TYPE_SALE)); |
353 | 353 | } |
354 | 354 |