@@ -23,7 +23,7 @@ |
||
23 | 23 | { |
24 | 24 | $required = ['out_trade_no', 'total_amount', 'subject']; |
25 | 25 | foreach ($required as $key => $item) { |
26 | - if (! array_key_exists($item, $order)) { |
|
26 | + if (!array_key_exists($item, $order)) { |
|
27 | 27 | throw new \InvalidArgumentException("The {$item} field is required"); |
28 | 28 | } |
29 | 29 | } |
@@ -27,14 +27,14 @@ |
||
27 | 27 | public function send(array $array, string $key) : Collection |
28 | 28 | { |
29 | 29 | $method = Arr::get($array, 'method'); |
30 | - $method = str_replace('.', '_', $method) . '_response'; |
|
30 | + $method = str_replace('.', '_', $method).'_response'; |
|
31 | 31 | $result = $this->post('', $array); |
32 | 32 | $result = mb_convert_encoding($result, 'UTF-8', 'GB2312'); |
33 | 33 | $result = json_decode($result, true); |
34 | 34 | |
35 | 35 | $data = Arr::get($result, $method); |
36 | 36 | $sign = Arr::get($result, 'sign'); |
37 | - if (! self::verifySign($data, $key, true, $sign)) { |
|
37 | + if (!self::verifySign($data, $key, true, $sign)) { |
|
38 | 38 | throw new InvalidSignException( |
39 | 39 | 'Invalid Alipay [signature] verify.', |
40 | 40 | 3 |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | $string = ''; |
59 | 59 | foreach ($array as $key => $val) { |
60 | 60 | if ($isVerify && $key !== 'sign' && $key !== 'sign_type') { |
61 | - $string .= $key . '=' . $val . '&'; |
|
61 | + $string .= $key.'='.$val.'&'; |
|
62 | 62 | } |
63 | - if (! $isVerify |
|
63 | + if (!$isVerify |
|
64 | 64 | && $val !== '' |
65 | 65 | && null !== $val |
66 | 66 | && $key !== 'sign' |
67 | 67 | && 0 !== strpos($val, '@') |
68 | 68 | ) { |
69 | - $string .= $key . '=' . $val . '&'; |
|
69 | + $string .= $key.'='.$val.'&'; |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $data = []; |
135 | 135 | foreach ($array as $key => $val) { |
136 | 136 | if (\is_array($val)) { |
137 | - $data[$key] = self::toEncoding((array)$val, $to, $from); |
|
137 | + $data[$key] = self::toEncoding((array) $val, $to, $from); |
|
138 | 138 | } else { |
139 | 139 | $data[$key] = mb_convert_encoding($val, $to, $from); |
140 | 140 | } |