@@ -60,12 +60,12 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | if (Str::endsWith($key, ['.crt', '.pem'])) { |
| 62 | 62 | return openssl_pkey_get_private( |
| 63 | - Str::startsWith($key, 'file://') ? $key : 'file://'.$key |
|
| 63 | + Str::startsWith($key, 'file://') ? $key : 'file://' . $key |
|
| 64 | 64 | ); |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - return "-----BEGIN RSA PRIVATE KEY-----\n". |
|
| 68 | - wordwrap($key, 64, "\n", true). |
|
| 67 | + return "-----BEGIN RSA PRIVATE KEY-----\n" . |
|
| 68 | + wordwrap($key, 64, "\n", true) . |
|
| 69 | 69 | "\n-----END RSA PRIVATE KEY-----"; |
| 70 | 70 | } |
| 71 | 71 | } |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | get_wechat_sign($params, $contents), |
| 162 | 162 | ); |
| 163 | 163 | |
| 164 | - return 'WECHATPAY2-SHA256-RSA2048 '.$auth; |
|
| 164 | + return 'WECHATPAY2-SHA256-RSA2048 ' . $auth; |
|
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 | |
@@ -215,8 +215,8 @@ discard block |
||
| 215 | 215 | $sign = $message->getHeaderLine('Wechatpay-Signature'); |
| 216 | 216 | $body = $message->getBody()->getContents(); |
| 217 | 217 | |
| 218 | - $content = $timestamp."\n".$random."\n".$body."\n"; |
|
| 219 | - $public = get_wechat_config($params)->get('wechat_public_cert_path.'.$wechatSerial); |
|
| 218 | + $content = $timestamp . "\n" . $random . "\n" . $body . "\n"; |
|
| 219 | + $public = get_wechat_config($params)->get('wechat_public_cert_path.' . $wechatSerial); |
|
| 220 | 220 | |
| 221 | 221 | if (empty($sign)) { |
| 222 | 222 | throw new InvalidResponseException(Exception::INVALID_RESPONSE_SIGN, '', ['headers' => $message->getHeaders(), 'body' => $body]); |
@@ -43,10 +43,10 @@ |
||
| 43 | 43 | { |
| 44 | 44 | $config = get_wechat_config($params); |
| 45 | 45 | |
| 46 | - $publicKey = $config->get('wechat_public_cert_path.'.$serialNo); |
|
| 46 | + $publicKey = $config->get('wechat_public_cert_path.' . $serialNo); |
|
| 47 | 47 | |
| 48 | 48 | if (empty($publicKey)) { |
| 49 | - throw new InvalidParamsException(Exception::WECHAT_SERIAL_NO_NOT_FOUND, 'Wechat serial no not found: '.$serialNo); |
|
| 49 | + throw new InvalidParamsException(Exception::WECHAT_SERIAL_NO_NOT_FOUND, 'Wechat serial no not found: ' . $serialNo); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | return $publicKey; |