@@ -33,9 +33,9 @@ |
||
| 33 | 33 | |
| 34 | 34 | protected function buildHtml(string $endpoint, Collection $payload): Response |
| 35 | 35 | { |
| 36 | - $sHtml = "<form id='pay_form' name='pay_form' action='".$endpoint."' method='POST'>"; |
|
| 36 | + $sHtml = "<form id='pay_form' name='pay_form' action='" . $endpoint . "' method='POST'>"; |
|
| 37 | 37 | foreach ($payload->all() as $key => $val) { |
| 38 | - $sHtml .= "<input type='hidden' name='".$key."' value='".$val."'/>"; |
|
| 38 | + $sHtml .= "<input type='hidden' name='" . $key . "' value='" . $val . "'/>"; |
|
| 39 | 39 | } |
| 40 | 40 | $sHtml .= "<input type='submit' value='ok' style='display:none;'></form>"; |
| 41 | 41 | $sHtml .= "<script>document.forms['pay_form'].submit();</script>"; |
@@ -40,8 +40,8 @@ |
||
| 40 | 40 | */ |
| 41 | 41 | public function __call(string $shortcut, array $params) |
| 42 | 42 | { |
| 43 | - $plugin = '\\Yansongda\\Pay\\Plugin\\Unipay\\Shortcut\\'. |
|
| 44 | - Str::studly($shortcut).'Shortcut'; |
|
| 43 | + $plugin = '\\Yansongda\\Pay\\Plugin\\Unipay\\Shortcut\\' . |
|
| 44 | + Str::studly($shortcut) . 'Shortcut'; |
|
| 45 | 45 | |
| 46 | 46 | return $this->call($plugin, ...$params); |
| 47 | 47 | } |
@@ -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 | } |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | get_wechat_sign($params, $contents), |
| 150 | 150 | ); |
| 151 | 151 | |
| 152 | - return 'WECHATPAY2-SHA256-RSA2048 '.$auth; |
|
| 152 | + return 'WECHATPAY2-SHA256-RSA2048 ' . $auth; |
|
| 153 | 153 | } |
| 154 | 154 | } |
| 155 | 155 | |
@@ -197,8 +197,8 @@ discard block |
||
| 197 | 197 | $sign = $message->getHeaderLine('Wechatpay-Signature'); |
| 198 | 198 | $body = (string) $message->getBody(); |
| 199 | 199 | |
| 200 | - $content = $timestamp."\n".$random."\n".$body."\n"; |
|
| 201 | - $public = get_wechat_config($params)->get('wechat_public_cert_path.'.$wechatSerial); |
|
| 200 | + $content = $timestamp . "\n" . $random . "\n" . $body . "\n"; |
|
| 201 | + $public = get_wechat_config($params)->get('wechat_public_cert_path.' . $wechatSerial); |
|
| 202 | 202 | |
| 203 | 203 | if (empty($sign)) { |
| 204 | 204 | throw new InvalidResponseException(Exception::INVALID_RESPONSE_SIGN, '', ['headers' => $message->getHeaders(), 'body' => $body]); |
@@ -337,6 +337,6 @@ discard block |
||
| 337 | 337 | { |
| 338 | 338 | $config = Pay::get(ConfigInterface::class); |
| 339 | 339 | |
| 340 | - return $config->get('unipay.'.($params['_config'] ?? 'default')); |
|
| 340 | + return $config->get('unipay.' . ($params['_config'] ?? 'default')); |
|
| 341 | 341 | } |
| 342 | 342 | } |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | |
| 64 | 64 | $config = get_unipay_config($rocket->getParams()); |
| 65 | 65 | |
| 66 | - return Unipay::URL[$config['mode'] ?? Pay::MODE_NORMAL].$url; |
|
| 66 | + return Unipay::URL[$config['mode'] ?? Pay::MODE_NORMAL] . $url; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | protected function getHeaders(): array |