@@ -121,7 +121,7 @@ |
||
121 | 121 | * @author yansongda <[email protected]> |
122 | 122 | * |
123 | 123 | * @param string $gateway |
124 | - * @param array $params |
|
124 | + * @param string $params |
|
125 | 125 | * |
126 | 126 | * @throws InvalidGatewayException |
127 | 127 | * |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | |
148 | 148 | $this->payload = array_merge($this->payload, $params); |
149 | 149 | |
150 | - $gateway = get_class($this).'\\'.Str::studly($gateway).'Gateway'; |
|
150 | + $gateway = get_class($this) . '\\' . Str::studly($gateway) . 'Gateway'; |
|
151 | 151 | |
152 | 152 | if (class_exists($gateway)) { |
153 | 153 | return $this->makePay($gateway); |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | unset($this->payload['spbill_create_ip']); |
227 | 227 | } |
228 | 228 | |
229 | - $gateway = get_class($this).'\\'.Str::studly($type).'Gateway'; |
|
229 | + $gateway = get_class($this) . '\\' . Str::studly($type) . 'Gateway'; |
|
230 | 230 | |
231 | 231 | if (!class_exists($gateway) || !is_callable([new $gateway(), 'find'])) { |
232 | 232 | throw new GatewayException("{$gateway} Done Not Exist Or Done Not Has FIND Method"); |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | ); |
370 | 370 | |
371 | 371 | if (is_array($result)) { |
372 | - throw new GatewayException('Get Wechat API Error: '.$result['return_msg'], $result); |
|
372 | + throw new GatewayException('Get Wechat API Error: ' . $result['return_msg'], $result); |
|
373 | 373 | } |
374 | 374 | |
375 | 375 | return $result; |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | $app = new $gateway(); |
392 | 392 | |
393 | 393 | if ($app instanceof GatewayInterface) { |
394 | - return $app->pay($this->gateway, array_filter($this->payload, function ($value) { |
|
394 | + return $app->pay($this->gateway, array_filter($this->payload, function($value) { |
|
395 | 395 | return $value !== '' && !is_null($value); |
396 | 396 | })); |
397 | 397 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | unset($payload['appid'], $payload['trade_type'], |
39 | - $payload['notify_url'], $payload['spbill_create_ip']); |
|
39 | + $payload['notify_url'], $payload['spbill_create_ip']); |
|
40 | 40 | |
41 | 41 | $payload['sign'] = Support::generateSign($payload); |
42 | 42 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | unset($payload['appid'], $payload['trade_type'], |
39 | - $payload['notify_url'], $payload['spbill_create_ip']); |
|
39 | + $payload['notify_url'], $payload['spbill_create_ip']); |
|
40 | 40 | |
41 | 41 | $payload['sign'] = Support::generateSign($payload); |
42 | 42 |
@@ -73,7 +73,7 @@ |
||
73 | 73 | */ |
74 | 74 | protected function create($method): GatewayApplicationInterface |
75 | 75 | { |
76 | - $gateway = __NAMESPACE__.'\\Gateways\\'.Str::studly($method); |
|
76 | + $gateway = __NAMESPACE__ . '\\Gateways\\' . Str::studly($method); |
|
77 | 77 | |
78 | 78 | if (class_exists($gateway)) { |
79 | 79 | return self::make($gateway); |
@@ -29,8 +29,8 @@ |
||
29 | 29 | |
30 | 30 | $mweb_url = $this->preOrder($payload)->get('mweb_url'); |
31 | 31 | |
32 | - $url = is_null(Support::getInstance()->return_url) ? $mweb_url : $mweb_url. |
|
33 | - '&redirect_url='.urlencode(Support::getInstance()->return_url); |
|
32 | + $url = is_null(Support::getInstance()->return_url) ? $mweb_url : $mweb_url . |
|
33 | + '&redirect_url=' . urlencode(Support::getInstance()->return_url); |
|
34 | 34 | |
35 | 35 | return RedirectResponse::create($url); |
36 | 36 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | 'appId' => !$this->payRequestUseSubAppId ? $payload['appid'] : $payload['sub_appid'], |
37 | 37 | 'timeStamp' => strval(time()), |
38 | 38 | 'nonceStr' => Str::random(), |
39 | - 'package' => 'prepay_id='.$this->preOrder($payload)->get('prepay_id'), |
|
39 | + 'package' => 'prepay_id=' . $this->preOrder($payload)->get('prepay_id'), |
|
40 | 40 | 'signType' => 'MD5', |
41 | 41 | ]; |
42 | 42 | $pay_request['paySign'] = Support::generateSign($pay_request); |
@@ -14,6 +14,6 @@ |
||
14 | 14 | */ |
15 | 15 | public function __construct($message, $raw = []) |
16 | 16 | { |
17 | - parent::__construct('INVALID_GATEWAY: '.$message, $raw, self::INVALID_GATEWAY); |
|
17 | + parent::__construct('INVALID_GATEWAY: ' . $message, $raw, self::INVALID_GATEWAY); |
|
18 | 18 | } |
19 | 19 | } |
@@ -14,6 +14,6 @@ |
||
14 | 14 | */ |
15 | 15 | public function __construct($message, $raw = []) |
16 | 16 | { |
17 | - parent::__construct('INVALID_SIGN: '.$message, $raw, self::INVALID_SIGN); |
|
17 | + parent::__construct('INVALID_SIGN: ' . $message, $raw, self::INVALID_SIGN); |
|
18 | 18 | } |
19 | 19 | } |
@@ -14,6 +14,6 @@ |
||
14 | 14 | */ |
15 | 15 | public function __construct($message, $raw = []) |
16 | 16 | { |
17 | - parent::__construct('ERROR_BUSINESS: '.$message, $raw, self::ERROR_BUSINESS); |
|
17 | + parent::__construct('ERROR_BUSINESS: ' . $message, $raw, self::ERROR_BUSINESS); |
|
18 | 18 | } |
19 | 19 | } |