@@ -69,9 +69,9 @@ |
||
69 | 69 | { |
70 | 70 | $invokeConfig = new Config([ |
71 | 71 | 'appId' => $this->getAppId($payload, $config), |
72 | - 'timeStamp' => time().'', |
|
72 | + 'timeStamp' => time() . '', |
|
73 | 73 | 'nonceStr' => Str::random(32), |
74 | - 'package' => 'prepay_id='.$prepayId, |
|
74 | + 'package' => 'prepay_id=' . $prepayId, |
|
75 | 75 | 'signType' => 'MD5', |
76 | 76 | ]); |
77 | 77 |
@@ -73,7 +73,7 @@ |
||
73 | 73 | 'prepayid' => $prepayId, |
74 | 74 | 'package' => 'Sign=WXPay', |
75 | 75 | 'noncestr' => Str::random(32), |
76 | - 'timestamp' => time().'', |
|
76 | + 'timestamp' => time() . '', |
|
77 | 77 | ]); |
78 | 78 | |
79 | 79 | $invokeConfig->set('sign', get_wechat_sign_v2($config, $invokeConfig->all())); |
@@ -27,7 +27,7 @@ |
||
27 | 27 | */ |
28 | 28 | public function getPlugins(array $params): array |
29 | 29 | { |
30 | - $action = Str::camel($params['_action'] ?? 'default').'Plugins'; |
|
30 | + $action = Str::camel($params['_action'] ?? 'default') . 'Plugins'; |
|
31 | 31 | |
32 | 32 | if (method_exists($this, $action)) { |
33 | 33 | return $this->{$action}($params); |
@@ -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 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | /** |
61 | 61 | * @throws ContainerException |
62 | 62 | */ |
63 | - public static function config(array $config = [], Closure|ContainerInterface $container = null): bool |
|
63 | + public static function config(array $config = [], Closure | ContainerInterface $container = null): bool |
|
64 | 64 | { |
65 | 65 | $result = Artful::config($config, $container); |
66 | 66 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | return Artful::get($service); |
89 | 89 | } |
90 | 90 | |
91 | - public static function setContainer(null|Closure|ContainerInterface $container): void |
|
91 | + public static function setContainer(null | Closure | ContainerInterface $container): void |
|
92 | 92 | { |
93 | 93 | Artful::setContainer($container); |
94 | 94 | } |
@@ -12,17 +12,17 @@ |
||
12 | 12 | |
13 | 13 | interface ProviderInterface |
14 | 14 | { |
15 | - public function pay(array $plugins, array $params): null|Collection|MessageInterface|Rocket; |
|
15 | + public function pay(array $plugins, array $params): null | Collection | MessageInterface | Rocket; |
|
16 | 16 | |
17 | - public function query(array $order): Collection|Rocket; |
|
17 | + public function query(array $order): Collection | Rocket; |
|
18 | 18 | |
19 | - public function cancel(array $order): Collection|Rocket; |
|
19 | + public function cancel(array $order): Collection | Rocket; |
|
20 | 20 | |
21 | - public function close(array $order): Collection|Rocket; |
|
21 | + public function close(array $order): Collection | Rocket; |
|
22 | 22 | |
23 | - public function refund(array $order): Collection|Rocket; |
|
23 | + public function refund(array $order): Collection | Rocket; |
|
24 | 24 | |
25 | - public function callback(null|array|ServerRequestInterface $contents = null, ?array $params = null): Collection|Rocket; |
|
25 | + public function callback(null | array | ServerRequestInterface $contents = null, ?array $params = null): Collection | Rocket; |
|
26 | 26 | |
27 | 27 | public function success(): ResponseInterface; |
28 | 28 | } |
@@ -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>"; |
@@ -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 |
|
59 | + public function __call(string $shortcut, array $params): null | Collection | MessageInterface |
|
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']); |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | * @throws InvalidParamsException |
50 | 50 | * @throws ServiceNotFoundException |
51 | 51 | */ |
52 | - public function __call(string $shortcut, array $params): null|Collection|MessageInterface|Rocket |
|
52 | + public function __call(string $shortcut, array $params): null | Collection | MessageInterface | Rocket |
|
53 | 53 | { |
54 | - $plugin = '\\Yansongda\\Pay\\Shortcut\\Unipay\\'.Str::studly($shortcut).'Shortcut'; |
|
54 | + $plugin = '\\Yansongda\\Pay\\Shortcut\\Unipay\\' . Str::studly($shortcut) . 'Shortcut'; |
|
55 | 55 | |
56 | 56 | return Artful::shortcut($plugin, ...$params); |
57 | 57 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * @throws ContainerException |
61 | 61 | * @throws InvalidParamsException |
62 | 62 | */ |
63 | - public function pay(array $plugins, array $params): null|Collection|MessageInterface|Rocket |
|
63 | + public function pay(array $plugins, array $params): null | Collection | MessageInterface | Rocket |
|
64 | 64 | { |
65 | 65 | return Artful::artful($plugins, $params); |
66 | 66 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * @throws InvalidParamsException |
71 | 71 | * @throws ServiceNotFoundException |
72 | 72 | */ |
73 | - public function query(array $order): Collection|Rocket |
|
73 | + public function query(array $order): Collection | Rocket |
|
74 | 74 | { |
75 | 75 | Event::dispatch(new MethodCalled('unipay', __METHOD__, $order, null)); |
76 | 76 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @throws InvalidParamsException |
83 | 83 | * @throws ServiceNotFoundException |
84 | 84 | */ |
85 | - public function cancel(array $order): Collection|Rocket |
|
85 | + public function cancel(array $order): Collection | Rocket |
|
86 | 86 | { |
87 | 87 | Event::dispatch(new MethodCalled('unipay', __METHOD__, $order, null)); |
88 | 88 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | /** |
93 | 93 | * @throws InvalidParamsException |
94 | 94 | */ |
95 | - public function close(array $order): Collection|Rocket |
|
95 | + public function close(array $order): Collection | Rocket |
|
96 | 96 | { |
97 | 97 | throw new InvalidParamsException(Exception::PARAMS_METHOD_NOT_SUPPORTED, '参数异常: 银联不支持 close API'); |
98 | 98 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * @throws InvalidParamsException |
103 | 103 | * @throws ServiceNotFoundException |
104 | 104 | */ |
105 | - public function refund(array $order): Collection|Rocket |
|
105 | + public function refund(array $order): Collection | Rocket |
|
106 | 106 | { |
107 | 107 | Event::dispatch(new MethodCalled('unipay', __METHOD__, $order, null)); |
108 | 108 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | * @throws ContainerException |
114 | 114 | * @throws InvalidParamsException |
115 | 115 | */ |
116 | - public function callback(null|array|ServerRequestInterface $contents = null, ?array $params = null): Collection|Rocket |
|
116 | + public function callback(null | array | ServerRequestInterface $contents = null, ?array $params = null): Collection | Rocket |
|
117 | 117 | { |
118 | 118 | $request = $this->getCallbackParams($contents); |
119 | 119 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | ); |
140 | 140 | } |
141 | 141 | |
142 | - protected function getCallbackParams(null|array|ServerRequestInterface $contents = null): Collection |
|
142 | + protected function getCallbackParams(null | array | ServerRequestInterface $contents = null): Collection |
|
143 | 143 | { |
144 | 144 | if (is_array($contents)) { |
145 | 145 | return Collection::wrap($contents); |