@@ -43,10 +43,10 @@ |
||
43 | 43 | $xml = new SimpleXMLElement($response->getBody()->getContents()); |
44 | 44 | |
45 | 45 | if ($xml->xpath('error/error_msg')) { |
46 | - throw SkrillResponseException::fromSkillError(((string)$xml->error->error_msg)); |
|
46 | + throw SkrillResponseException::fromSkillError(((string) $xml->error->error_msg)); |
|
47 | 47 | } |
48 | 48 | |
49 | - return self::createFromString((string)$xml->sid); |
|
49 | + return self::createFromString((string) $xml->sid); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | } |
40 | 40 | |
41 | 41 | if ($this->validateAlpha($lastName)) { |
42 | - $this->lastName = $lastName; |
|
42 | + $this->lastName = $lastName; |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | |
@@ -68,6 +68,6 @@ discard block |
||
68 | 68 | */ |
69 | 69 | private function validateAlpha($value): bool |
70 | 70 | { |
71 | - return (bool)preg_match('/^([a-z])+$/i', $value); |
|
71 | + return (bool) preg_match('/^([a-z])+$/i', $value); |
|
72 | 72 | } |
73 | 73 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | private function validateAddress($value): bool |
107 | 107 | { |
108 | - return (bool)preg_match("/^([a-z0-9\'\.\-\s\,])+$/i", $value); |
|
108 | + return (bool) preg_match("/^([a-z0-9\'\.\-\s\,])+$/i", $value); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
@@ -143,6 +143,6 @@ discard block |
||
143 | 143 | */ |
144 | 144 | private function validateAlphaNum($value): bool |
145 | 145 | { |
146 | - return (bool)preg_match('/^([a-z0-9])+$/i', $value); |
|
146 | + return (bool) preg_match('/^([a-z0-9])+$/i', $value); |
|
147 | 147 | } |
148 | 148 | } |
@@ -37,10 +37,10 @@ |
||
37 | 37 | CustomerId $customerId = null |
38 | 38 | ) { |
39 | 39 | $this->payload = [ |
40 | - 'email' => (string)$email, |
|
40 | + 'email' => (string) $email, |
|
41 | 41 | 'firstName' => $customer->getFirstName(), |
42 | 42 | 'lastName' => $customer->getLastName(), |
43 | - 'dateOfBirth' => (string)$dateOfBirth, |
|
43 | + 'dateOfBirth' => (string) $dateOfBirth, |
|
44 | 44 | 'postCode' => $address->getPostCode(), |
45 | 45 | 'country' => $address->getCountry(), |
46 | 46 | 'houseNumber' => $address->getHouseNumber(), |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $this->companyName = $companyName; |
110 | 110 | $this->merchantEmail = $merchantEmail; |
111 | 111 | $this->logoUrl = $logoUrl; |
112 | - $this->password = md5((string)$password); |
|
112 | + $this->password = md5((string) $password); |
|
113 | 113 | $this->secretWord = $secretWord; |
114 | 114 | } |
115 | 115 | |
@@ -137,14 +137,14 @@ discard block |
||
137 | 137 | { |
138 | 138 | $params = $request->getPayload(); |
139 | 139 | $params['prepare_only'] = 1; // Forces only the SID to be returned without the actual page. |
140 | - $params['pay_to_email'] = (string)$this->merchantEmail; |
|
140 | + $params['pay_to_email'] = (string) $this->merchantEmail; |
|
141 | 141 | |
142 | 142 | if (null != $this->logoUrl) { |
143 | - $params['logo_url'] = (string)$this->logoUrl; |
|
143 | + $params['logo_url'] = (string) $this->logoUrl; |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | if (null != $this->companyName) { |
147 | - $params['recipient_description'] = (string)$this->companyName; |
|
147 | + $params['recipient_description'] = (string) $this->companyName; |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | return SidFactory::createFromSaleResponse( |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | { |
162 | 162 | $params = $request->getPayload(); |
163 | 163 | $params['action'] = 'prepare'; |
164 | - $params['email'] = (string)$this->merchantEmail; |
|
164 | + $params['email'] = (string) $this->merchantEmail; |
|
165 | 165 | $params['password'] = $this->password; |
166 | 166 | |
167 | 167 | return SidFactory::createFromXMLResponse( |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | { |
179 | 179 | $params = $request->getPayload(); |
180 | 180 | $params['action'] = 'prepare'; |
181 | - $params['email'] = (string)$this->merchantEmail; |
|
181 | + $params['email'] = (string) $this->merchantEmail; |
|
182 | 182 | $params['password'] = $this->password; |
183 | 183 | |
184 | 184 | return SidFactory::createFromXMLResponse( |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | { |
196 | 196 | $params = $request->getPayload(); |
197 | 197 | $params['action'] = 'prepare'; |
198 | - $params['email'] = (string)$this->merchantEmail; |
|
198 | + $params['email'] = (string) $this->merchantEmail; |
|
199 | 199 | $params['password'] = $this->password; |
200 | 200 | |
201 | 201 | return SidFactory::createFromXMLResponse( |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | public function executeTransfer(Sid $sid): Response |
212 | 212 | { |
213 | 213 | return ResponseFactory::createFromTransferResponse( |
214 | - $this->request(['action' => 'transfer', 'sid' => (string)$sid], 'https://www.skrill.com/app/pay.pl') |
|
214 | + $this->request(['action' => 'transfer', 'sid' => (string) $sid], 'https://www.skrill.com/app/pay.pl') |
|
215 | 215 | ); |
216 | 216 | } |
217 | 217 | |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | public function executePayout(Sid $sid): Response |
224 | 224 | { |
225 | 225 | return ResponseFactory::createFromTransferResponse( |
226 | - $this->request(['action' => 'transfer', 'sid' => (string)$sid], 'https://www.skrill.com/app/pay.pl') |
|
226 | + $this->request(['action' => 'transfer', 'sid' => (string) $sid], 'https://www.skrill.com/app/pay.pl') |
|
227 | 227 | ); |
228 | 228 | } |
229 | 229 | |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | public function executeRefund(Sid $sid): Response |
236 | 236 | { |
237 | 237 | return ResponseFactory::createFromRefundResponse( |
238 | - $this->request(['action' => 'refund', 'sid' => (string)$sid], 'https://www.skrill.com/app/refund.pl') |
|
238 | + $this->request(['action' => 'refund', 'sid' => (string) $sid], 'https://www.skrill.com/app/refund.pl') |
|
239 | 239 | ); |
240 | 240 | } |
241 | 241 | |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | { |
249 | 249 | $params = $request->getPayload(); |
250 | 250 | $params['action'] = 'prepare'; |
251 | - $params['email'] = (string)$this->merchantEmail; |
|
251 | + $params['email'] = (string) $this->merchantEmail; |
|
252 | 252 | $params['password'] = $this->password; |
253 | 253 | |
254 | 254 | return SidFactory::createFromXMLResponse( |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | { |
266 | 266 | return ResponseFactory::createFromTransferResponse( |
267 | 267 | $this->request( |
268 | - ['action' => 'request', 'sid' => (string)$sid], |
|
268 | + ['action' => 'request', 'sid' => (string) $sid], |
|
269 | 269 | 'https://www.skrill.com/app/ondemand_request.pl' |
270 | 270 | ) |
271 | 271 | ); |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | public function viewHistory(DateTimeInterface $startDate, DateTimeInterface $endDate = null): ArrayObject |
280 | 280 | { |
281 | 281 | $params = [ |
282 | - 'email' => (string)$this->merchantEmail, |
|
282 | + 'email' => (string) $this->merchantEmail, |
|
283 | 283 | 'password' => $this->password, |
284 | 284 | 'action' => 'history', |
285 | 285 | 'start_date' => $startDate->format('d-m-Y'), |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | $params['end_date'] = $endDate->format('d-m-y'); |
290 | 290 | } |
291 | 291 | |
292 | - $tmpFile = new SplFileObject(tempnam(sys_get_temp_dir(), (string)mt_rand()), 'w+'); |
|
292 | + $tmpFile = new SplFileObject(tempnam(sys_get_temp_dir(), (string) mt_rand()), 'w+'); |
|
293 | 293 | $this->client->request( |
294 | 294 | 'POST', |
295 | 295 | 'https://www.skrill.com/app/query.pl', |