@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | { |
144 | 144 | Events::dispatch(new Events\ApiRequesting('Alipay', '', self::$instance->getBaseUri(), $data)); |
145 | 145 | |
146 | - $data = array_filter($data, function ($value) { |
|
146 | + $data = array_filter($data, function($value) { |
|
147 | 147 | return ('' == $value || is_null($value)) ? false : true; |
148 | 148 | }); |
149 | 149 | |
@@ -175,11 +175,11 @@ discard block |
||
175 | 175 | |
176 | 176 | if (Str::endsWith($privateKey, '.pem')) { |
177 | 177 | $privateKey = openssl_pkey_get_private( |
178 | - Str::startsWith($privateKey, 'file://') ? $privateKey : 'file://'.$privateKey |
|
178 | + Str::startsWith($privateKey, 'file://') ? $privateKey : 'file://' . $privateKey |
|
179 | 179 | ); |
180 | - } else { |
|
181 | - $privateKey = "-----BEGIN RSA PRIVATE KEY-----\n". |
|
182 | - wordwrap($privateKey, 64, "\n", true). |
|
180 | + }else { |
|
181 | + $privateKey = "-----BEGIN RSA PRIVATE KEY-----\n" . |
|
182 | + wordwrap($privateKey, 64, "\n", true) . |
|
183 | 183 | "\n-----END RSA PRIVATE KEY-----"; |
184 | 184 | } |
185 | 185 | |
@@ -221,11 +221,11 @@ discard block |
||
221 | 221 | $publicKey = file_get_contents($publicKey); |
222 | 222 | } elseif (Str::endsWith($publicKey, '.pem')) { |
223 | 223 | $publicKey = openssl_pkey_get_public( |
224 | - Str::startsWith($publicKey, 'file://') ? $publicKey : 'file://'.$publicKey |
|
224 | + Str::startsWith($publicKey, 'file://') ? $publicKey : 'file://' . $publicKey |
|
225 | 225 | ); |
226 | - } else { |
|
227 | - $publicKey = "-----BEGIN PUBLIC KEY-----\n". |
|
228 | - wordwrap($publicKey, 64, "\n", true). |
|
226 | + }else { |
|
227 | + $publicKey = "-----BEGIN PUBLIC KEY-----\n" . |
|
228 | + wordwrap($publicKey, 64, "\n", true) . |
|
229 | 229 | "\n-----END PUBLIC KEY-----"; |
230 | 230 | } |
231 | 231 | |
@@ -259,10 +259,10 @@ discard block |
||
259 | 259 | $stringToBeSigned = ''; |
260 | 260 | foreach ($data as $k => $v) { |
261 | 261 | if ($verify && 'sign' != $k && 'sign_type' != $k) { |
262 | - $stringToBeSigned .= $k.'='.$v.'&'; |
|
262 | + $stringToBeSigned .= $k . '=' . $v . '&'; |
|
263 | 263 | } |
264 | 264 | if (!$verify && '' !== $v && !is_null($v) && 'sign' != $k && '@' != substr($v, 0, 1)) { |
265 | - $stringToBeSigned .= $k.'='.$v.'&'; |
|
265 | + $stringToBeSigned .= $k . '=' . $v . '&'; |
|
266 | 266 | } |
267 | 267 | } |
268 | 268 | |
@@ -338,12 +338,12 @@ discard block |
||
338 | 338 | */ |
339 | 339 | protected static function processingApiResult($data, $result): Collection |
340 | 340 | { |
341 | - $method = str_replace('.', '_', $data['method']).'_response'; |
|
341 | + $method = str_replace('.', '_', $data['method']) . '_response'; |
|
342 | 342 | |
343 | 343 | if (!isset($result['sign']) || '10000' != $result[$method]['code']) { |
344 | 344 | throw new GatewayException( |
345 | - 'Get Alipay API Error:'.$result[$method]['msg']. |
|
346 | - (isset($result[$method]['sub_code']) ? (' - '.$result[$method]['sub_code']) : ''), |
|
345 | + 'Get Alipay API Error:' . $result[$method]['msg'] . |
|
346 | + (isset($result[$method]['sub_code']) ? (' - ' . $result[$method]['sub_code']) : ''), |
|
347 | 347 | $result |
348 | 348 | ); |
349 | 349 | } |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | $_issuer = implode(',', array_reverse($issuer_arr)); |
459 | 459 | if (strpos($_certdata['serialNumber'], '0x') === 0) { |
460 | 460 | $serialNumber = self::bchexdec($_certdata['serialNumber']); |
461 | - } else { |
|
461 | + }else { |
|
462 | 462 | $serialNumber = $_certdata['serialNumber']; |
463 | 463 | } |
464 | 464 | $md5_arr[] = md5($_issuer . $serialNumber); |