@@ -81,11 +81,11 @@ |
||
| 81 | 81 | if (Str::contains($body, '&-&')) { |
| 82 | 82 | $beginIndex = strpos($body, '&signType='); |
| 83 | 83 | $endIndex = strpos($body, '&-&'); |
| 84 | - $data = substr($body, 0, $beginIndex).substr($body, $endIndex); |
|
| 84 | + $data = substr($body, 0, $beginIndex) . substr($body, $endIndex); |
|
| 85 | 85 | |
| 86 | 86 | $signIndex = strpos($body, '&sign='); |
| 87 | 87 | $signature = substr($body, $signIndex + strlen('&sign='), $endIndex - ($signIndex + strlen('&sign='))); |
| 88 | - } else { |
|
| 88 | + }else { |
|
| 89 | 89 | $result = Arr::wrapQuery($body, true); |
| 90 | 90 | $result = Collection::wrap($result); |
| 91 | 91 | $signature = $result->get('sign'); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | public function __call($name, $params) |
| 43 | 43 | { |
| 44 | - $plugin = '\\Yansongda\\Pay\\Shortcut\\Epay\\'.Str::studly($name).'Shortcut'; |
|
| 44 | + $plugin = '\\Yansongda\\Pay\\Shortcut\\Epay\\' . Str::studly($name) . 'Shortcut'; |
|
| 45 | 45 | |
| 46 | 46 | return Artful::shortcut($plugin, ...$params); |
| 47 | 47 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | * @throws ContainerException |
| 51 | 51 | * @throws InvalidParamsException |
| 52 | 52 | */ |
| 53 | - public function pay(array $plugins, array $params): null|Collection|MessageInterface|Rocket |
|
| 53 | + public function pay(array $plugins, array $params): null | Collection | MessageInterface | Rocket |
|
| 54 | 54 | { |
| 55 | 55 | return Artful::artful($plugins, $params); |
| 56 | 56 | } |
@@ -64,24 +64,24 @@ discard block |
||
| 64 | 64 | ); |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - public function cancel($order): Collection|Rocket |
|
| 67 | + public function cancel($order): Collection | Rocket |
|
| 68 | 68 | { |
| 69 | 69 | throw new InvalidParamsException(Exception::PARAMS_METHOD_NOT_SUPPORTED, 'Epay does not support cancel api'); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - public function close($order): Collection|Rocket |
|
| 72 | + public function close($order): Collection | Rocket |
|
| 73 | 73 | { |
| 74 | 74 | throw new InvalidParamsException(Exception::PARAMS_METHOD_NOT_SUPPORTED, 'Epay does not support close api'); |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - public function refund(array $order): Collection|Rocket |
|
| 77 | + public function refund(array $order): Collection | Rocket |
|
| 78 | 78 | { |
| 79 | 79 | Event::dispatch(new MethodCalled('epay', __METHOD__, $order, null)); |
| 80 | 80 | |
| 81 | 81 | return $this->__call('refund', [$order]); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - public function callback(null|array|ServerRequestInterface $contents = null, ?array $params = null): Collection|Rocket |
|
| 84 | + public function callback(null | array | ServerRequestInterface $contents = null, ?array $params = null): Collection | Rocket |
|
| 85 | 85 | { |
| 86 | 86 | $request = $this->getCallbackParams($contents); |
| 87 | 87 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | ); |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | - public function query(array $order): Collection|Rocket |
|
| 105 | + public function query(array $order): Collection | Rocket |
|
| 106 | 106 | { |
| 107 | 107 | $order = is_array($order) ? $order : ['outTradeNo' => $order]; |
| 108 | 108 | |