@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $direction = Pay::get($direction); |
| 45 | 45 | |
| 46 | 46 | $direction = is_string($direction) ? Pay::get($direction) : $direction; |
| 47 | - } catch (ContainerException|ServiceNotFoundException $e) { |
|
| 47 | + } catch (ContainerException | ServiceNotFoundException $e) { |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | if (!$direction instanceof DirectionInterface) { |
@@ -76,8 +76,8 @@ discard block |
||
| 76 | 76 | return file_get_contents($key); |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - return "-----BEGIN RSA PRIVATE KEY-----\n". |
|
| 80 | - wordwrap($key, 64, "\n", true). |
|
| 79 | + return "-----BEGIN RSA PRIVATE KEY-----\n" . |
|
| 80 | + wordwrap($key, 64, "\n", true) . |
|
| 81 | 81 | "\n-----END RSA PRIVATE KEY-----"; |
| 82 | 82 | } |
| 83 | 83 | |
@@ -167,10 +167,10 @@ discard block |
||
| 167 | 167 | $buff = ''; |
| 168 | 168 | |
| 169 | 169 | foreach ($payload as $k => $v) { |
| 170 | - $buff .= ('sign' != $k && '' != $v && !is_array($v)) ? $k.'='.$v.'&' : ''; |
|
| 170 | + $buff .= ('sign' != $k && '' != $v && !is_array($v)) ? $k . '=' . $v . '&' : ''; |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | - $sign = md5($buff.'key='.$key); |
|
| 173 | + $sign = md5($buff . 'key=' . $key); |
|
| 174 | 174 | |
| 175 | 175 | return $upper ? strtoupper($sign) : $sign; |
| 176 | 176 | } |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | $sign = $message->getHeaderLine('Wechatpay-Signature'); |
| 195 | 195 | $body = (string) $message->getBody(); |
| 196 | 196 | |
| 197 | - $content = $timestamp."\n".$random."\n".$body."\n"; |
|
| 197 | + $content = $timestamp . "\n" . $random . "\n" . $body . "\n"; |
|
| 198 | 198 | $public = get_wechat_config($params)['wechat_public_cert_path'][$wechatSerial] ?? null; |
| 199 | 199 | |
| 200 | 200 | if (empty($sign)) { |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | $wechatConfig = get_wechat_config($params); |
| 248 | 248 | |
| 249 | 249 | Pay::get(ConfigInterface::class)->set( |
| 250 | - 'wechat.'.get_tenant($params).'.wechat_public_cert_path', |
|
| 250 | + 'wechat.' . get_tenant($params) . '.wechat_public_cert_path', |
|
| 251 | 251 | ((array) ($wechatConfig['wechat_public_cert_path'] ?? [])) + ($certs ?? []), |
| 252 | 252 | ); |
| 253 | 253 | |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | foreach ($config['wechat_public_cert_path'] as $serialNo => $cert) { |
| 281 | - file_put_contents($path.'/'.$serialNo.'.crt', $cert); |
|
| 281 | + file_put_contents($path . '/' . $serialNo . '.crt', $cert); |
|
| 282 | 282 | } |
| 283 | 283 | } |
| 284 | 284 | |