@@ -8,9 +8,9 @@ |
||
| 8 | 8 | $config = include_once './Config/Config.php'; |
| 9 | 9 | |
| 10 | 10 | $data = [ |
| 11 | - 'requestTimestamp' => date("YmdHis", time()),//请求时间 |
|
| 12 | - 'merOrderId' => '101720220303143314904287',//商户订单号 |
|
| 13 | - 'instMid' => 'MINIDEFAULT',//业务类型 |
|
| 11 | + 'requestTimestamp' => date("YmdHis", time()), //请求时间 |
|
| 12 | + 'merOrderId' => '101720220303143314904287', //商户订单号 |
|
| 13 | + 'instMid' => 'MINIDEFAULT', //业务类型 |
|
| 14 | 14 | ]; |
| 15 | 15 | Factory::config($config); |
| 16 | 16 | $response = Factory::Wechat()->close($data); |
@@ -10,5 +10,5 @@ |
||
| 10 | 10 | $data = []; |
| 11 | 11 | Factory::config($config); |
| 12 | 12 | $response = Factory::Wechat()->callback($data); |
| 13 | -echo Factory::Wechat()->success().PHP_EOL; |
|
| 14 | -echo 'response:' . (int)$response . PHP_EOL; |
|
| 13 | +echo Factory::Wechat()->success() . PHP_EOL; |
|
| 14 | +echo 'response:' . (int) $response . PHP_EOL; |
|
@@ -23,14 +23,14 @@ discard block |
||
| 23 | 23 | * @param array $params |
| 24 | 24 | * @return mixed |
| 25 | 25 | */ |
| 26 | - public function __call(string $shortcut, array $params=[]) |
|
| 26 | + public function __call(string $shortcut, array $params = []) |
|
| 27 | 27 | { |
| 28 | - $class = str_replace('Provider','Service',static::class).'\\' . Str::studly($shortcut); |
|
| 29 | - if(!class_exists($class)){ |
|
| 28 | + $class = str_replace('Provider', 'Service', static::class) . '\\' . Str::studly($shortcut); |
|
| 29 | + if (!class_exists($class)) { |
|
| 30 | 30 | throw new TException("Chinaums:{$class}类不存在"); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - return new $class($this->config,$params[0]??[]); |
|
| 33 | + return new $class($this->config, $params[0] ?? []); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | */ |
| 40 | 40 | public function callback($contents) |
| 41 | 41 | { |
| 42 | - $params = array_map(function ($value) { |
|
| 42 | + $params = array_map(function($value) { |
|
| 43 | 43 | return urldecode($value); |
| 44 | 44 | }, $contents); |
| 45 | 45 | $md5Key = $this->config['md5key']; |