@@ -39,7 +39,7 @@ |
||
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | foreach ($this->detectApplication as $framework => $application) { |
| 42 | - $method = $framework.'Application'; |
|
| 42 | + $method = $framework . 'Application'; |
|
| 43 | 43 | |
| 44 | 44 | if (class_exists($application) && method_exists($this, $method) && $this->{$method}()) { |
| 45 | 45 | return; |
@@ -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>"; |
@@ -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 |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | |
| 32 | 32 | $certs['cert_id'] = $ssl['serialNumber'] ?? ''; |
| 33 | 33 | |
| 34 | - Pay::get(ConfigInterface::class)->set('unipay.'.$tenant.'.certs', $certs); |
|
| 34 | + Pay::get(ConfigInterface::class)->set('unipay.' . $tenant . '.certs', $certs); |
|
| 35 | 35 | |
| 36 | 36 | return $certs['cert_id']; |
| 37 | 37 | } |
@@ -13,8 +13,7 @@ |
||
| 13 | 13 | $xml = '<xml>'; |
| 14 | 14 | |
| 15 | 15 | foreach ($payload as $key => $val) { |
| 16 | - $xml .= is_numeric($val) ? '<'.$key.'>'.$val.'</'.$key.'>' : |
|
| 17 | - '<'.$key.'><![CDATA['.$val.']]></'.$key.'>'; |
|
| 16 | + $xml .= is_numeric($val) ? '<' . $key . '>' . $val . '</' . $key . '>' : '<' . $key . '><![CDATA[' . $val . ']]></' . $key . '>'; |
|
| 18 | 17 | } |
| 19 | 18 | |
| 20 | 19 | $xml .= '</xml>'; |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | |
| 62 | 62 | protected function getDefaultHandler(): AbstractProcessingHandler |
| 63 | 63 | { |
| 64 | - $file = $this->config['file'] ?? (sys_get_temp_dir().'/logs/'.$this->config['identify'].'.log'); |
|
| 64 | + $file = $this->config['file'] ?? (sys_get_temp_dir() . '/logs/' . $this->config['identify'] . '.log'); |
|
| 65 | 65 | |
| 66 | 66 | return match ($this->config['type']) { |
| 67 | 67 | 'single' => new StreamHandler($file, $this->config['level']), |
@@ -13,9 +13,9 @@ |
||
| 13 | 13 | |
| 14 | 14 | public ?array $params = null; |
| 15 | 15 | |
| 16 | - public null|array|ServerRequestInterface $contents; |
|
| 16 | + public null | array | ServerRequestInterface $contents; |
|
| 17 | 17 | |
| 18 | - public function __construct(string $provider, null|array|ServerRequestInterface $contents, ?array $params = null, ?Rocket $rocket = null) |
|
| 18 | + public function __construct(string $provider, null | array | ServerRequestInterface $contents, ?array $params = null, ?Rocket $rocket = null) |
|
| 19 | 19 | { |
| 20 | 20 | $this->provider = $provider; |
| 21 | 21 | $this->contents = $contents; |
@@ -23,8 +23,7 @@ discard block |
||
| 23 | 23 | $radar = $rocket->getRadar(); |
| 24 | 24 | |
| 25 | 25 | $response = 'GET' === $radar->getMethod() ? |
| 26 | - $this->buildRedirect($radar->getUri()->__toString(), $rocket->getPayload()) : |
|
| 27 | - $this->buildHtml($radar->getUri()->__toString(), $rocket->getPayload()); |
|
| 26 | + $this->buildRedirect($radar->getUri()->__toString(), $rocket->getPayload()) : $this->buildHtml($radar->getUri()->__toString(), $rocket->getPayload()); |
|
| 28 | 27 | |
| 29 | 28 | $rocket->setDestination($response); |
| 30 | 29 | |
@@ -35,7 +34,7 @@ discard block |
||
| 35 | 34 | |
| 36 | 35 | protected function buildRedirect(string $endpoint, Collection $payload): Response |
| 37 | 36 | { |
| 38 | - $url = $endpoint.(!str_contains($endpoint, '?') ? '?' : '&').$payload->query(); |
|
| 37 | + $url = $endpoint . (!str_contains($endpoint, '?') ? '?' : '&') . $payload->query(); |
|
| 39 | 38 | |
| 40 | 39 | $content = sprintf( |
| 41 | 40 | '<!DOCTYPE html> |
@@ -58,10 +57,10 @@ discard block |
||
| 58 | 57 | |
| 59 | 58 | protected function buildHtml(string $endpoint, Collection $payload): Response |
| 60 | 59 | { |
| 61 | - $sHtml = "<form id='alipay_submit' name='alipay_submit' action='".$endpoint."' method='POST'>"; |
|
| 60 | + $sHtml = "<form id='alipay_submit' name='alipay_submit' action='" . $endpoint . "' method='POST'>"; |
|
| 62 | 61 | foreach ($payload->all() as $key => $val) { |
| 63 | 62 | $val = str_replace("'", ''', $val); |
| 64 | - $sHtml .= "<input type='hidden' name='".$key."' value='".$val."'/>"; |
|
| 63 | + $sHtml .= "<input type='hidden' name='" . $key . "' value='" . $val . "'/>"; |
|
| 65 | 64 | } |
| 66 | 65 | $sHtml .= "<input type='submit' value='ok' style='display:none;'></form>"; |
| 67 | 66 | $sHtml .= "<script>document.forms['alipay_submit'].submit();</script>"; |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | |
| 24 | 24 | $destination = $rocket->getDestination(); |
| 25 | 25 | $payload = $rocket->getPayload(); |
| 26 | - $resultKey = str_replace('.', '_', $payload->get('method')).'_response'; |
|
| 26 | + $resultKey = str_replace('.', '_', $payload->get('method')) . '_response'; |
|
| 27 | 27 | |
| 28 | 28 | if (should_do_http_request($rocket->getDirection()) && $destination instanceof Collection) { |
| 29 | 29 | $rocket->setDestination(new Collection(array_merge( |