@@ -33,7 +33,7 @@ |
||
| 33 | 33 | 'appid' => $payload['appid'], |
| 34 | 34 | 'partnerid' => $payload['mch_id'], |
| 35 | 35 | 'prepayid' => $object->get('prepay_id'), |
| 36 | - 'timestamp' => (string)time(), |
|
| 36 | + 'timestamp' => (string) time(), |
|
| 37 | 37 | 'noncestr' => Str::random(), |
| 38 | 38 | 'package' => 'Sign=WXPay', |
| 39 | 39 | ]; |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | || Arr::get($result, 'result_code') !== 'SUCCESS' |
| 47 | 47 | ) { |
| 48 | 48 | throw new GatewayException( |
| 49 | - 'Wxpay API Error: ' . $result['return_msg'], |
|
| 49 | + 'Wxpay API Error: '.$result['return_msg'], |
|
| 50 | 50 | 20000 |
| 51 | 51 | ); |
| 52 | 52 | } |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | */ |
| 156 | 156 | public static function fromXml(string $xml) : array |
| 157 | 157 | { |
| 158 | - if (! $xml) { |
|
| 158 | + if (!$xml) { |
|
| 159 | 159 | throw new \InvalidArgumentException('Invalid [xml] argument.', 3); |
| 160 | 160 | } |
| 161 | 161 | libxml_disable_entity_loader(true); |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | ksort($array); |
| 32 | - $string = md5(self::getSignContent($array) . '&key=' . $key); |
|
| 32 | + $string = md5(self::getSignContent($array).'&key='.$key); |
|
| 33 | 33 | $string = strtoupper($string); |
| 34 | 34 | |
| 35 | 35 | return $string; |
@@ -46,8 +46,8 @@ discard block |
||
| 46 | 46 | { |
| 47 | 47 | $string = ''; |
| 48 | 48 | foreach ($array as $key => $val) { |
| 49 | - if ($key !== 'sign' && $val !== '' && ! \is_array($val)) { |
|
| 50 | - $string .= $key . '=' . $val . '&'; |
|
| 49 | + if ($key !== 'sign' && $val !== '' && !\is_array($val)) { |
|
| 50 | + $string .= $key.'='.$val.'&'; |
|
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | $data = []; |
| 117 | 117 | foreach ($array as $key => $val) { |
| 118 | 118 | if (\is_array($val)) { |
| 119 | - $data[$key] = self::toEncoding((array)$val, $to, $from); |
|
| 119 | + $data[$key] = self::toEncoding((array) $val, $to, $from); |
|
| 120 | 120 | } else { |
| 121 | 121 | $data[$key] = mb_convert_encoding($val, $to, $from); |
| 122 | 122 | } |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | if (null === $returnUrl) { |
| 33 | 33 | $url = $mwebUrl; |
| 34 | 34 | } else { |
| 35 | - $url = $mwebUrl . '&redirect_url=' . urlencode($returnUrl); |
|
| 35 | + $url = $mwebUrl.'&redirect_url='.urlencode($returnUrl); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | return RedirectResponse::create($url); |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | public function toPay(string $gateway, array $payload) : Collection |
| 26 | 26 | { |
| 27 | 27 | if (isset($payload['type'])) { |
| 28 | - $type = $payload['type'] . ($payload['type'] === 'app' ?: '_') |
|
| 28 | + $type = $payload['type'].($payload['type'] === 'app' ?: '_') |
|
| 29 | 29 | . 'id'; |
| 30 | 30 | } else { |
| 31 | 31 | $type = 'app_id'; |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | private function dispatcher(string $gateway, array $array = []) |
| 211 | 211 | { |
| 212 | 212 | $this->payload['biz_content'] = $array; |
| 213 | - $class = \get_class($this) . '\\' . Str::studly($gateway) . 'Payment'; |
|
| 213 | + $class = \get_class($this).'\\'.Str::studly($gateway).'Payment'; |
|
| 214 | 214 | |
| 215 | 215 | if (class_exists($class)) { |
| 216 | 216 | return $this->toPay($class); |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | $this->payload, |
| 256 | 256 | $this->config->get('private_key') |
| 257 | 257 | ); |
| 258 | - Log::debug(ucfirst($type) . ' an order:', [ |
|
| 258 | + Log::debug(ucfirst($type).' an order:', [ |
|
| 259 | 259 | $this->gateway, |
| 260 | 260 | $this->payload, |
| 261 | 261 | ]); |