@@ -56,8 +56,8 @@ discard block |
||
| 56 | 56 | return file_get_contents($key); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - return "-----BEGIN RSA PRIVATE KEY-----\n". |
|
| 60 | - wordwrap($key, 64, "\n", true). |
|
| 59 | + return "-----BEGIN RSA PRIVATE KEY-----\n" . |
|
| 60 | + wordwrap($key, 64, "\n", true) . |
|
| 61 | 61 | "\n-----END RSA PRIVATE KEY-----"; |
| 62 | 62 | } |
| 63 | 63 | } |
@@ -163,8 +163,8 @@ discard block |
||
| 163 | 163 | $sign = $message->getHeaderLine('Wechatpay-Signature'); |
| 164 | 164 | $body = (string) $message->getBody(); |
| 165 | 165 | |
| 166 | - $content = $timestamp."\n".$random."\n".$body."\n"; |
|
| 167 | - $public = get_wechat_config($params)->get('wechat_public_cert_path.'.$wechatSerial); |
|
| 166 | + $content = $timestamp . "\n" . $random . "\n" . $body . "\n"; |
|
| 167 | + $public = get_wechat_config($params)->get('wechat_public_cert_path.' . $wechatSerial); |
|
| 168 | 168 | |
| 169 | 169 | if (empty($sign)) { |
| 170 | 170 | throw new InvalidResponseException(Exception::INVALID_RESPONSE_SIGN, '', ['headers' => $message->getHeaders(), 'body' => $body]); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | get_wechat_sign($params, $contents), |
| 80 | 80 | ); |
| 81 | 81 | |
| 82 | - return 'WECHATPAY2-SHA256-RSA2048 '.$auth; |
|
| 82 | + return 'WECHATPAY2-SHA256-RSA2048 ' . $auth; |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /** |
@@ -95,11 +95,11 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | $uri = $request->getUri(); |
| 97 | 97 | |
| 98 | - return $request->getMethod()."\n". |
|
| 99 | - $uri->getPath().(empty($uri->getQuery()) ? '' : '?'.$uri->getQuery())."\n". |
|
| 100 | - $timestamp."\n". |
|
| 101 | - $random."\n". |
|
| 102 | - $this->payloadToString($rocket->getPayload())."\n"; |
|
| 98 | + return $request->getMethod() . "\n" . |
|
| 99 | + $uri->getPath() . (empty($uri->getQuery()) ? '' : '?' . $uri->getQuery()) . "\n" . |
|
| 100 | + $timestamp . "\n" . |
|
| 101 | + $random . "\n" . |
|
| 102 | + $this->payloadToString($rocket->getPayload()) . "\n"; |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | protected function payloadToString(?Collection $payload): string |