@@ -36,7 +36,7 @@ |
||
| 36 | 36 | ->send((new Rocket())->setParams($params)->setPayload(new Collection())) |
| 37 | 37 | ->through($plugins) |
| 38 | 38 | ->via('assembly') |
| 39 | - ->then(function ($rocket) { |
|
| 39 | + ->then(function($rocket) { |
|
| 40 | 40 | return $this->ignite($rocket); |
| 41 | 41 | }); |
| 42 | 42 | |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | { |
| 17 | 17 | Pay::set(ParserInterface::class, CollectionParser::class); |
| 18 | 18 | |
| 19 | - $service = function () { |
|
| 19 | + $service = function() { |
|
| 20 | 20 | return new Alipay(); |
| 21 | 21 | }; |
| 22 | 22 | |
@@ -80,6 +80,6 @@ |
||
| 80 | 80 | { |
| 81 | 81 | $method = $rocket->getPayload()->get('method'); |
| 82 | 82 | |
| 83 | - return str_replace('.', '_', $method).'_response'; |
|
| 83 | + return str_replace('.', '_', $method) . '_response'; |
|
| 84 | 84 | } |
| 85 | 85 | } |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | public function register(Pay $pay, ?array $data = null): void |
| 17 | 17 | { |
| 18 | - $service = function () { |
|
| 18 | + $service = function() { |
|
| 19 | 19 | return new Wechat(); |
| 20 | 20 | }; |
| 21 | 21 | |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | public function getPlugins(array $params): array |
| 19 | 19 | { |
| 20 | - $typeMethod = ($params['_type'] ?? 'default').'Plugins'; |
|
| 20 | + $typeMethod = ($params['_type'] ?? 'default') . 'Plugins'; |
|
| 21 | 21 | |
| 22 | 22 | if (isset($params['out_request_no'])) { |
| 23 | 23 | return $this->refundPlugins(); |
@@ -24,8 +24,7 @@ discard block |
||
| 24 | 24 | $radar = $rocket->getRadar(); |
| 25 | 25 | |
| 26 | 26 | $response = 'GET' === $radar->getMethod() ? |
| 27 | - $this->buildRedirect($radar->getUri()->__toString(), $rocket->getPayload()) : |
|
| 28 | - $this->buildHtml($radar->getUri()->__toString(), $rocket->getPayload()); |
|
| 27 | + $this->buildRedirect($radar->getUri()->__toString(), $rocket->getPayload()) : $this->buildHtml($radar->getUri()->__toString(), $rocket->getPayload()); |
|
| 29 | 28 | |
| 30 | 29 | $rocket->setDestination($response); |
| 31 | 30 | |
@@ -36,7 +35,7 @@ discard block |
||
| 36 | 35 | |
| 37 | 36 | protected function buildRedirect(string $endpoint, Collection $payload): Response |
| 38 | 37 | { |
| 39 | - $url = $endpoint.'?'.Arr::query($payload->all()); |
|
| 38 | + $url = $endpoint . '?' . Arr::query($payload->all()); |
|
| 40 | 39 | |
| 41 | 40 | $content = sprintf('<!DOCTYPE html> |
| 42 | 41 | <html lang="en"> |
@@ -57,10 +56,10 @@ discard block |
||
| 57 | 56 | |
| 58 | 57 | protected function buildHtml(string $endpoint, Collection $payload): Response |
| 59 | 58 | { |
| 60 | - $sHtml = "<form id='alipay_submit' name='alipay_submit' action='".$endpoint."' method='POST'>"; |
|
| 59 | + $sHtml = "<form id='alipay_submit' name='alipay_submit' action='" . $endpoint . "' method='POST'>"; |
|
| 61 | 60 | foreach ($payload->all() as $key => $val) { |
| 62 | 61 | $val = str_replace("'", ''', $val); |
| 63 | - $sHtml .= "<input type='hidden' name='".$key."' value='".$val."'/>"; |
|
| 62 | + $sHtml .= "<input type='hidden' name='" . $key . "' value='" . $val . "'/>"; |
|
| 64 | 63 | } |
| 65 | 64 | $sHtml .= "<input type='submit' value='ok' style='display:none;'></form>"; |
| 66 | 65 | $sHtml .= "<script>document.forms['alipay_submit'].submit();</script>"; |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | public function getPlugins(array $params): array |
| 17 | 17 | { |
| 18 | - $typeMethod = ($params['_type'] ?? 'default').'Plugins'; |
|
| 18 | + $typeMethod = ($params['_type'] ?? 'default') . 'Plugins'; |
|
| 19 | 19 | |
| 20 | 20 | if (isset($params['combine_out_trade_no']) || isset($params['sub_orders'])) { |
| 21 | 21 | return $this->combinePlugins(); |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | public function getPlugins(array $params): array |
| 17 | 17 | { |
| 18 | - $typeMethod = ($params['_type'] ?? 'default').'Plugins'; |
|
| 18 | + $typeMethod = ($params['_type'] ?? 'default') . 'Plugins'; |
|
| 19 | 19 | |
| 20 | 20 | if (isset($params['combine_out_trade_no'])) { |
| 21 | 21 | return $this->combinePlugins(); |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | { |
| 12 | 12 | protected function getUri(Rocket $rocket): string |
| 13 | 13 | { |
| 14 | - return 'v3/bill/tradebill?'.http_build_query($rocket->getParams()); |
|
| 14 | + return 'v3/bill/tradebill?' . http_build_query($rocket->getParams()); |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | protected function getMethod(): string |