@@ -50,8 +50,8 @@ |
||
| 50 | 50 | ->setPayload(array_merge( |
| 51 | 51 | [ |
| 52 | 52 | '_method' => 'POST', |
| 53 | - '_url' => 'v3/pay/transactions/out-trade-no/'.$outTradeNo.'/close', |
|
| 54 | - '_service_url' => 'v3/pay/partner/transactions/out-trade-no/'.$outTradeNo.'/close', |
|
| 53 | + '_url' => 'v3/pay/transactions/out-trade-no/' . $outTradeNo . '/close', |
|
| 54 | + '_service_url' => 'v3/pay/partner/transactions/out-trade-no/' . $outTradeNo . '/close', |
|
| 55 | 55 | ], |
| 56 | 56 | $data ?? $this->normal($config) |
| 57 | 57 | )); |
@@ -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'); |
@@ -48,9 +48,9 @@ discard block |
||
| 48 | 48 | * @throws InvalidParamsException |
| 49 | 49 | * @throws ServiceNotFoundException |
| 50 | 50 | */ |
| 51 | - public function __call($name, $params): null|Collection|MessageInterface|Rocket |
|
| 51 | + public function __call($name, $params): null | Collection | MessageInterface | Rocket |
|
| 52 | 52 | { |
| 53 | - $plugin = '\Yansongda\Pay\Shortcut\Jsb\\'.Str::studly($name).'Shortcut'; |
|
| 53 | + $plugin = '\Yansongda\Pay\Shortcut\Jsb\\' . Str::studly($name) . 'Shortcut'; |
|
| 54 | 54 | |
| 55 | 55 | return Artful::shortcut($plugin, ...$params); |
| 56 | 56 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | * @throws ContainerException |
| 60 | 60 | * @throws InvalidParamsException |
| 61 | 61 | */ |
| 62 | - public function pay(array $plugins, array $params): null|Collection|MessageInterface|Rocket |
|
| 62 | + public function pay(array $plugins, array $params): null | Collection | MessageInterface | Rocket |
|
| 63 | 63 | { |
| 64 | 64 | return Artful::artful($plugins, $params); |
| 65 | 65 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | /** |
| 77 | 77 | * @throws InvalidParamsException |
| 78 | 78 | */ |
| 79 | - public function cancel(array $order): Collection|Rocket |
|
| 79 | + public function cancel(array $order): Collection | Rocket |
|
| 80 | 80 | { |
| 81 | 81 | throw new InvalidParamsException(Exception::PARAMS_METHOD_NOT_SUPPORTED, 'Jsb does not support cancel api'); |
| 82 | 82 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | /** |
| 85 | 85 | * @throws InvalidParamsException |
| 86 | 86 | */ |
| 87 | - public function close(array $order): Collection|Rocket |
|
| 87 | + public function close(array $order): Collection | Rocket |
|
| 88 | 88 | { |
| 89 | 89 | throw new InvalidParamsException(Exception::PARAMS_METHOD_NOT_SUPPORTED, 'Jsb does not support close api'); |
| 90 | 90 | } |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | * @throws InvalidParamsException |
| 95 | 95 | * @throws ServiceNotFoundException |
| 96 | 96 | */ |
| 97 | - public function refund(array $order): Collection|Rocket |
|
| 97 | + public function refund(array $order): Collection | Rocket |
|
| 98 | 98 | { |
| 99 | 99 | Event::dispatch(new MethodCalled('jsb', __METHOD__, $order, null)); |
| 100 | 100 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | * @throws ContainerException |
| 106 | 106 | * @throws InvalidParamsException |
| 107 | 107 | */ |
| 108 | - public function callback(null|array|ServerRequestInterface $contents = null, ?array $params = null): Collection|Rocket |
|
| 108 | + public function callback(null | array | ServerRequestInterface $contents = null, ?array $params = null): Collection | Rocket |
|
| 109 | 109 | { |
| 110 | 110 | $request = $this->getCallbackParams($contents); |
| 111 | 111 | |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | * @throws InvalidParamsException |
| 132 | 132 | * @throws ServiceNotFoundException |
| 133 | 133 | */ |
| 134 | - public function query(array $order): Collection|Rocket |
|
| 134 | + public function query(array $order): Collection | Rocket |
|
| 135 | 135 | { |
| 136 | 136 | Event::dispatch(new MethodCalled('jsb', __METHOD__, $order, null)); |
| 137 | 137 | |
@@ -51,8 +51,8 @@ |
||
| 51 | 51 | $rocket->setPayload(array_merge( |
| 52 | 52 | [ |
| 53 | 53 | '_method' => 'POST', |
| 54 | - '_url' => 'v3/pay/transactions/out-trade-no/'.$outTradeNo.'/reverse', |
|
| 55 | - '_service_url' => 'v3/pay/partner/transactions/out-trade-no/'.$outTradeNo.'/reverse', |
|
| 54 | + '_url' => 'v3/pay/transactions/out-trade-no/' . $outTradeNo . '/reverse', |
|
| 55 | + '_service_url' => 'v3/pay/partner/transactions/out-trade-no/' . $outTradeNo . '/reverse', |
|
| 56 | 56 | ], |
| 57 | 57 | $data ?? $this->normal($params, $config) |
| 58 | 58 | )); |
@@ -84,11 +84,11 @@ |
||
| 84 | 84 | foreach ($keys as $key) { |
| 85 | 85 | $val = $value[$key]; |
| 86 | 86 | |
| 87 | - $result[] = is_array($val) ? $this->arrayToString($val) : (($isJsonArray ? '' : $key.':').trim(strval($val))); |
|
| 87 | + $result[] = is_array($val) ? $this->arrayToString($val) : (($isJsonArray ? '' : $key . ':') . trim(strval($val))); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - $result = '['.implode(' ', $result ?? []).']'; |
|
| 90 | + $result = '[' . implode(' ', $result ?? []) . ']'; |
|
| 91 | 91 | |
| 92 | - return ($isJsonArray ? '' : 'map').$result; |
|
| 92 | + return ($isJsonArray ? '' : 'map') . $result; |
|
| 93 | 93 | } |
| 94 | 94 | } |
@@ -56,9 +56,9 @@ discard block |
||
| 56 | 56 | * @throws InvalidParamsException |
| 57 | 57 | * @throws ServiceNotFoundException |
| 58 | 58 | */ |
| 59 | - public function __call(string $shortcut, array $params): null|Collection|MessageInterface|Rocket |
|
| 59 | + public function __call(string $shortcut, array $params): null | Collection | MessageInterface | Rocket |
|
| 60 | 60 | { |
| 61 | - $plugin = '\Yansongda\Pay\Shortcut\Wechat\\'.Str::studly($shortcut).'Shortcut'; |
|
| 61 | + $plugin = '\Yansongda\Pay\Shortcut\Wechat\\' . Str::studly($shortcut) . 'Shortcut'; |
|
| 62 | 62 | |
| 63 | 63 | return Artful::shortcut($plugin, ...$params); |
| 64 | 64 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | * @throws ContainerException |
| 68 | 68 | * @throws InvalidParamsException |
| 69 | 69 | */ |
| 70 | - public function pay(array $plugins, array $params): null|Collection|MessageInterface|Rocket |
|
| 70 | + public function pay(array $plugins, array $params): null | Collection | MessageInterface | Rocket |
|
| 71 | 71 | { |
| 72 | 72 | return Artful::artful($plugins, $params); |
| 73 | 73 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | * @throws InvalidParamsException |
| 78 | 78 | * @throws ServiceNotFoundException |
| 79 | 79 | */ |
| 80 | - public function query(array $order): Collection|Rocket |
|
| 80 | + public function query(array $order): Collection | Rocket |
|
| 81 | 81 | { |
| 82 | 82 | Event::dispatch(new MethodCalled('wechat', __METHOD__, $order, null)); |
| 83 | 83 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | /** |
| 88 | 88 | * @throws InvalidParamsException |
| 89 | 89 | */ |
| 90 | - public function cancel(array $order): Collection|Rocket |
|
| 90 | + public function cancel(array $order): Collection | Rocket |
|
| 91 | 91 | { |
| 92 | 92 | throw new InvalidParamsException(Exception::PARAMS_METHOD_NOT_SUPPORTED, '参数异常: 微信不支持 cancel API'); |
| 93 | 93 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | * @throws InvalidParamsException |
| 98 | 98 | * @throws ServiceNotFoundException |
| 99 | 99 | */ |
| 100 | - public function close(array $order): Collection|Rocket |
|
| 100 | + public function close(array $order): Collection | Rocket |
|
| 101 | 101 | { |
| 102 | 102 | Event::dispatch(new MethodCalled('wechat', __METHOD__, $order, null)); |
| 103 | 103 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | * @throws InvalidParamsException |
| 112 | 112 | * @throws ServiceNotFoundException |
| 113 | 113 | */ |
| 114 | - public function refund(array $order): Collection|Rocket |
|
| 114 | + public function refund(array $order): Collection | Rocket |
|
| 115 | 115 | { |
| 116 | 116 | Event::dispatch(new MethodCalled('wechat', __METHOD__, $order, null)); |
| 117 | 117 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | * @throws ContainerException |
| 123 | 123 | * @throws InvalidParamsException |
| 124 | 124 | */ |
| 125 | - public function callback(null|array|ServerRequestInterface $contents = null, ?array $params = null): Collection|Rocket |
|
| 125 | + public function callback(null | array | ServerRequestInterface $contents = null, ?array $params = null): Collection | Rocket |
|
| 126 | 126 | { |
| 127 | 127 | $request = $this->getCallbackParams($contents); |
| 128 | 128 | |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | ); |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | - protected function getCallbackParams(null|array|ServerRequestInterface $contents = null): ServerRequestInterface |
|
| 155 | + protected function getCallbackParams(null | array | ServerRequestInterface $contents = null): ServerRequestInterface |
|
| 156 | 156 | { |
| 157 | 157 | if (is_array($contents) && isset($contents['body'], $contents['headers'])) { |
| 158 | 158 | return new ServerRequest('POST', 'http://localhost', $contents['headers'], $contents['body']); |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | if (0 !== $destination->get('err_no')) { |
| 48 | - throw new InvalidResponseException(Exception::RESPONSE_BUSINESS_CODE_WRONG, '抖音返回业务异常: '.$destination->get('err_tips'), $destination); |
|
| 48 | + throw new InvalidResponseException(Exception::RESPONSE_BUSINESS_CODE_WRONG, '抖音返回业务异常: ' . $destination->get('err_tips'), $destination); |
|
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | } |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | */ |
| 33 | 33 | public function getPlugins(array $params): array |
| 34 | 34 | { |
| 35 | - $method = Str::camel($params['_action'] ?? 'default').'Plugins'; |
|
| 35 | + $method = Str::camel($params['_action'] ?? 'default') . 'Plugins'; |
|
| 36 | 36 | |
| 37 | 37 | if (method_exists($this, $method)) { |
| 38 | 38 | return $this->{$method}(); |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | public function getPlugins(array $params): array |
| 30 | 30 | { |
| 31 | - $method = Str::camel($params['_action'] ?? 'default').'Plugins'; |
|
| 31 | + $method = Str::camel($params['_action'] ?? 'default') . 'Plugins'; |
|
| 32 | 32 | |
| 33 | 33 | if (method_exists($this, $method)) { |
| 34 | 34 | return $this->{$method}($params); |