@@ -19,12 +19,12 @@ discard block |
||
19 | 19 | * @return mixed |
20 | 20 | * @throws Exception |
21 | 21 | */ |
22 | - public static function init($gateway, $config=[]) |
|
22 | + public static function init($gateway, $config = []) |
|
23 | 23 | { |
24 | 24 | $gateway = StringTool::uFirst($gateway); |
25 | 25 | $class = __NAMESPACE__ . '\\Provider\\' . $gateway; |
26 | 26 | if (class_exists($class)) { |
27 | - if(empty(self::$config)) self::config($config); |
|
27 | + if (empty(self::$config)) self::config($config); |
|
28 | 28 | $objcet = new $class(self::$config); |
29 | 29 | return $objcet; |
30 | 30 | } else { |
@@ -38,12 +38,12 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public static function config($config) |
40 | 40 | { |
41 | - $configFile = CHINAUMS_ROOT_PATH."/config/chinaums.php"; |
|
41 | + $configFile = CHINAUMS_ROOT_PATH . "/config/chinaums.php"; |
|
42 | 42 | if (!file_exists($configFile)) { |
43 | 43 | return false; |
44 | 44 | } |
45 | 45 | $baseConfig = require $configFile; |
46 | - self::$config = array_replace_recursive($baseConfig,$config); |
|
46 | + self::$config = array_replace_recursive($baseConfig, $config); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * @return mixed |
53 | 53 | * @throws Exception |
54 | 54 | */ |
55 | - public static function __callStatic($gateway, $config=[]) |
|
55 | + public static function __callStatic($gateway, $config = []) |
|
56 | 56 | { |
57 | 57 | return self::init($gateway, ...$config); |
58 | 58 | } |
@@ -24,7 +24,9 @@ |
||
24 | 24 | $gateway = StringTool::uFirst($gateway); |
25 | 25 | $class = __NAMESPACE__ . '\\Provider\\' . $gateway; |
26 | 26 | if (class_exists($class)) { |
27 | - if(empty(self::$config)) self::config($config); |
|
27 | + if(empty(self::$config)) { |
|
28 | + self::config($config); |
|
29 | + } |
|
28 | 30 | $objcet = new $class(self::$config); |
29 | 31 | return $objcet; |
30 | 32 | } else { |
@@ -46,7 +46,7 @@ |
||
46 | 46 | |
47 | 47 | public function callback($contents) |
48 | 48 | { |
49 | - $params = array_map(function ($value) { |
|
49 | + $params = array_map(function($value) { |
|
50 | 50 | return urldecode($value); |
51 | 51 | }, $contents); |
52 | 52 | $md5Key = $this->config['md5key']; |
@@ -26,7 +26,7 @@ |
||
26 | 26 | |
27 | 27 | public function __call(string $shortcut, array $params) |
28 | 28 | { |
29 | - $class = '\\tinymeng\\Chinaums\\Service\\'.__CLASS__.'\\' . Str::studly($shortcut); |
|
29 | + $class = '\\tinymeng\\Chinaums\\Service\\' . __CLASS__ . '\\' . Str::studly($shortcut); |
|
30 | 30 | $objcet = new $class(); |
31 | 31 | $objcet->setConfig($this->config); |
32 | 32 | return $objcet; |
@@ -24,6 +24,6 @@ |
||
24 | 24 | * 必传的值 |
25 | 25 | * @var array |
26 | 26 | */ |
27 | - protected $require = ['service', 'accesser_id', 'sign_type', 'request_date', 'request_seq','merNo','pic_list']; |
|
27 | + protected $require = ['service', 'accesser_id', 'sign_type', 'request_date', 'request_seq', 'merNo', 'pic_list']; |
|
28 | 28 | |
29 | 29 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | try { |
39 | 39 | $this->validate(); |
40 | 40 | $data = $this->body; |
41 | - $gateway = $this->config['gateway'] . $this->api; |
|
41 | + $gateway = $this->config['gateway'] . $this->api; |
|
42 | 42 | $data = json_encode($data); |
43 | 43 | $sign = hash('sha256', $data); |
44 | 44 | $method = $this->method; |
@@ -24,6 +24,6 @@ |
||
24 | 24 | * 必传的值 |
25 | 25 | * @var array |
26 | 26 | */ |
27 | - protected $require = ['service', 'accesser_id', 'sign_type', 'request_date', 'request_seq','ums_reg_id']; |
|
27 | + protected $require = ['service', 'accesser_id', 'sign_type', 'request_date', 'request_seq', 'ums_reg_id']; |
|
28 | 28 | |
29 | 29 | } |
@@ -24,5 +24,5 @@ |
||
24 | 24 | * 必传的值 |
25 | 25 | * @var array |
26 | 26 | */ |
27 | - protected $require = ['service', 'accesser_id', 'sign_type', 'request_date','request_seq','mer_no','alter_bank_acct_no','alter_bank_no','pic_list']; |
|
27 | + protected $require = ['service', 'accesser_id', 'sign_type', 'request_date', 'request_seq', 'mer_no', 'alter_bank_acct_no', 'alter_bank_no', 'pic_list']; |
|
28 | 28 | } |
@@ -24,6 +24,6 @@ |
||
24 | 24 | * 必传的值 |
25 | 25 | * @var array |
26 | 26 | */ |
27 | - protected $require = ['service', 'accesser_id', 'sign_type', 'request_date', 'request_seq','ums_reg_id']; |
|
27 | + protected $require = ['service', 'accesser_id', 'sign_type', 'request_date', 'request_seq', 'ums_reg_id']; |
|
28 | 28 | |
29 | 29 | } |
@@ -43,7 +43,7 @@ |
||
43 | 43 | try { |
44 | 44 | $this->validate(); |
45 | 45 | $data = $this->body; |
46 | - $gateway = $this->config['gateway'] . $this->api; |
|
46 | + $gateway = $this->config['gateway'] . $this->api; |
|
47 | 47 | $data = json_encode($data); |
48 | 48 | $sign = hash('sha256', $data); |
49 | 49 | $method = $this->method; |