@@ -40,7 +40,7 @@ |
||
40 | 40 | return $this->combinePlugins(); |
41 | 41 | } |
42 | 42 | |
43 | - $action = Str::camel($params['_action'] ?? 'default').'Plugins'; |
|
43 | + $action = Str::camel($params['_action'] ?? 'default') . 'Plugins'; |
|
44 | 44 | |
45 | 45 | if (method_exists($this, $action)) { |
46 | 46 | return $this->{$action}(); |
@@ -29,7 +29,7 @@ |
||
29 | 29 | */ |
30 | 30 | public function getPlugins(array $params): array |
31 | 31 | { |
32 | - $action = Str::camel($params['_action'] ?? 'default').'Plugins'; |
|
32 | + $action = Str::camel($params['_action'] ?? 'default') . 'Plugins'; |
|
33 | 33 | |
34 | 34 | if (method_exists($this, $action)) { |
35 | 35 | return $this->{$action}(); |
@@ -40,7 +40,7 @@ |
||
40 | 40 | return $this->combinePlugins(); |
41 | 41 | } |
42 | 42 | |
43 | - $action = Str::camel($params['_action'] ?? 'default').'Plugins'; |
|
43 | + $action = Str::camel($params['_action'] ?? 'default') . 'Plugins'; |
|
44 | 44 | |
45 | 45 | if (method_exists($this, $action)) { |
46 | 46 | return $this->{$action}(); |
@@ -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( |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | |
118 | 118 | $result = $this->getCertSn($ssl['issuer'] ?? [], $ssl['serialNumber'] ?? ''); |
119 | 119 | |
120 | - Pay::get(ConfigInterface::class)->set('alipay.'.$tenant.'.app_public_cert_sn', $result); |
|
120 | + Pay::get(ConfigInterface::class)->set('alipay.' . $tenant . '.app_public_cert_sn', $result); |
|
121 | 121 | |
122 | 122 | return $result; |
123 | 123 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | continue; |
148 | 148 | } |
149 | 149 | |
150 | - $ssl = openssl_x509_parse($cert.'-----END CERTIFICATE-----'); |
|
150 | + $ssl = openssl_x509_parse($cert . '-----END CERTIFICATE-----'); |
|
151 | 151 | |
152 | 152 | if (false === $ssl) { |
153 | 153 | throw new InvalidConfigException(Exception::CONFIG_ALIPAY_INVALID, 'Invalid alipay_root_cert'); |
@@ -156,20 +156,20 @@ discard block |
||
156 | 156 | $detail = $this->formatCert($ssl); |
157 | 157 | |
158 | 158 | if ('sha1WithRSAEncryption' == $detail['signatureTypeLN'] || 'sha256WithRSAEncryption' == $detail['signatureTypeLN']) { |
159 | - $sn .= $this->getCertSn($detail['issuer'], $detail['serialNumber']).'_'; |
|
159 | + $sn .= $this->getCertSn($detail['issuer'], $detail['serialNumber']) . '_'; |
|
160 | 160 | } |
161 | 161 | } |
162 | 162 | |
163 | 163 | $result = substr($sn, 0, -1); |
164 | 164 | |
165 | - Pay::get(ConfigInterface::class)->set('alipay.'.$tenant.'.alipay_root_cert_sn', $result); |
|
165 | + Pay::get(ConfigInterface::class)->set('alipay.' . $tenant . '.alipay_root_cert_sn', $result); |
|
166 | 166 | |
167 | 167 | return $result; |
168 | 168 | } |
169 | 169 | |
170 | 170 | protected function getCertSn(array $issuer, string $serialNumber): string |
171 | 171 | { |
172 | - return md5($this->array2string(array_reverse($issuer)).$serialNumber); |
|
172 | + return md5($this->array2string(array_reverse($issuer)) . $serialNumber); |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | protected function array2string(array $array): string |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $string = []; |
178 | 178 | |
179 | 179 | foreach ($array as $key => $value) { |
180 | - $string[] = $key.'='.$value; |
|
180 | + $string[] = $key . '=' . $value; |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | return implode(',', $string); |
@@ -32,8 +32,8 @@ |
||
32 | 32 | |
33 | 33 | $rocket->setPayload([ |
34 | 34 | '_method' => 'GET', |
35 | - '_url' => 'v3/merchant-service/images/'.$mediaId, |
|
36 | - '_service_url' => 'v3/merchant-service/images/'.$mediaId, |
|
35 | + '_url' => 'v3/merchant-service/images/' . $mediaId, |
|
36 | + '_service_url' => 'v3/merchant-service/images/' . $mediaId, |
|
37 | 37 | ]); |
38 | 38 | |
39 | 39 | Logger::info('[Wechat][Extend][Complaints][QueryImagePlugin] 插件装载完毕', ['rocket' => $rocket]); |
@@ -32,8 +32,8 @@ |
||
32 | 32 | |
33 | 33 | $rocket->mergePayload([ |
34 | 34 | '_method' => 'POST', |
35 | - '_url' => 'v3/merchant-service/complaints-v2/'.$complaintId.'/update-refund-progress', |
|
36 | - '_service_url' => 'v3/merchant-service/complaints-v2/'.$complaintId.'/update-refund-progress', |
|
35 | + '_url' => 'v3/merchant-service/complaints-v2/' . $complaintId . '/update-refund-progress', |
|
36 | + '_service_url' => 'v3/merchant-service/complaints-v2/' . $complaintId . '/update-refund-progress', |
|
37 | 37 | ])->exceptPayload('complaint_id'); |
38 | 38 | |
39 | 39 | Logger::info('[Wechat][Extend][Complaints][UpdateRefundPlugin] 插件装载完毕', ['rocket' => $rocket]); |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | |
37 | 37 | $rocket->setPayload([ |
38 | 38 | '_method' => 'GET', |
39 | - '_url' => 'v3/merchant-service/complaints-v2/'.$complaintId.'/negotiation-historys'.$query, |
|
40 | - '_service_url' => 'v3/merchant-service/complaints-v2/'.$complaintId.'/negotiation-historys'.$query, |
|
39 | + '_url' => 'v3/merchant-service/complaints-v2/' . $complaintId . '/negotiation-historys' . $query, |
|
40 | + '_service_url' => 'v3/merchant-service/complaints-v2/' . $complaintId . '/negotiation-historys' . $query, |
|
41 | 41 | ]); |
42 | 42 | |
43 | 43 | Logger::info('[Wechat][Extend][Complaints][QueryNegotiationPlugin] 插件装载完毕', ['rocket' => $rocket]); |
@@ -49,6 +49,6 @@ discard block |
||
49 | 49 | { |
50 | 50 | $query = $payload->except('complaint_id')->query(); |
51 | 51 | |
52 | - return empty($query) ? '' : '?'.$query; |
|
52 | + return empty($query) ? '' : '?' . $query; |
|
53 | 53 | } |
54 | 54 | } |