@@ -24,5 +24,5 @@ |
||
| 24 | 24 | * 必传的值 |
| 25 | 25 | * @var array |
| 26 | 26 | */ |
| 27 | - protected $require = ['service', 'accesser_id', 'sign_type', 'request_date','request_seq','ums_reg_id','company_account']; |
|
| 27 | + protected $require = ['service', 'accesser_id', 'sign_type', 'request_date', 'request_seq', 'ums_reg_id', 'company_account']; |
|
| 28 | 28 | } |
@@ -52,9 +52,9 @@ |
||
| 52 | 52 | try { |
| 53 | 53 | $this->validate(); |
| 54 | 54 | $data = $this->body; |
| 55 | - $gateway = $this->config['gateway'] . $this->api; |
|
| 55 | + $gateway = $this->config['gateway'] . $this->api; |
|
| 56 | 56 | if (strtoupper($this->platform) == 'PC') { |
| 57 | - $gateway = $this->config['gateway'] . $this->PCapi; |
|
| 57 | + $gateway = $this->config['gateway'] . $this->PCapi; |
|
| 58 | 58 | } |
| 59 | 59 | $data = json_encode($data); |
| 60 | 60 | $sign = hash('sha256', $data); |
@@ -22,5 +22,5 @@ |
||
| 22 | 22 | * 必传的值 |
| 23 | 23 | * @var array |
| 24 | 24 | */ |
| 25 | - protected $require = ['requestTimestamp', 'merOrderId', 'mid', 'tid','instMid','platformAmount']; |
|
| 25 | + protected $require = ['requestTimestamp', 'merOrderId', 'mid', 'tid', 'instMid', 'platformAmount']; |
|
| 26 | 26 | } |
@@ -22,5 +22,5 @@ |
||
| 22 | 22 | * 必传的值 |
| 23 | 23 | * @var array |
| 24 | 24 | */ |
| 25 | - protected $require = ['requestTimestamp', 'merOrderId', 'mid', 'tid','instMid','completedAmount']; |
|
| 25 | + protected $require = ['requestTimestamp', 'merOrderId', 'mid', 'tid', 'instMid', 'completedAmount']; |
|
| 26 | 26 | } |
@@ -22,5 +22,5 @@ |
||
| 22 | 22 | * 必传的值 |
| 23 | 23 | * @var array |
| 24 | 24 | */ |
| 25 | - protected $require = ['requestTimestamp', 'merOrderId', 'mid', 'tid','instMid']; |
|
| 25 | + protected $require = ['requestTimestamp', 'merOrderId', 'mid', 'tid', 'instMid']; |
|
| 26 | 26 | } |
@@ -22,5 +22,5 @@ |
||
| 22 | 22 | * 必传的值 |
| 23 | 23 | * @var array |
| 24 | 24 | */ |
| 25 | - protected $require = ['requestTimestamp', 'merOrderId', 'mid', 'tid','instMid']; |
|
| 25 | + protected $require = ['requestTimestamp', 'merOrderId', 'mid', 'tid', 'instMid']; |
|
| 26 | 26 | } |
@@ -20,5 +20,5 @@ |
||
| 20 | 20 | * 必传的值 |
| 21 | 21 | * @var array |
| 22 | 22 | */ |
| 23 | - protected $require = ['requestTimestamp', 'merOrderId', 'mid', 'tid','instMid']; |
|
| 23 | + protected $require = ['requestTimestamp', 'merOrderId', 'mid', 'tid', 'instMid']; |
|
| 24 | 24 | } |
@@ -32,9 +32,9 @@ discard block |
||
| 32 | 32 | /** |
| 33 | 33 | * @param $config |
| 34 | 34 | */ |
| 35 | - public function __construct($config=[]) |
|
| 35 | + public function __construct($config = []) |
|
| 36 | 36 | { |
| 37 | - if(!empty($config)){ |
|
| 37 | + if (!empty($config)) { |
|
| 38 | 38 | $this->config = $config; |
| 39 | 39 | $this->loadConfigGateway(); |
| 40 | 40 | } |
@@ -47,11 +47,11 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | private function loadConfigGateway() |
| 49 | 49 | { |
| 50 | - $gateway = $this->config['gateway'];// 正式环境 |
|
| 51 | - if($this->config['sandbox'] === false){ |
|
| 52 | - $this->gateway = isset($gateway[$this->gateway_type]) ? $gateway[$this->gateway_type] : $gateway['default'];// 沙箱环境 |
|
| 53 | - }else{ |
|
| 54 | - $this->gateway = $gateway['sandbox'];// 沙箱环境 |
|
| 50 | + $gateway = $this->config['gateway']; // 正式环境 |
|
| 51 | + if ($this->config['sandbox'] === false) { |
|
| 52 | + $this->gateway = isset($gateway[$this->gateway_type]) ? $gateway[$this->gateway_type] : $gateway['default']; // 沙箱环境 |
|
| 53 | + } else { |
|
| 54 | + $this->gateway = $gateway['sandbox']; // 沙箱环境 |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | return $this; |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | $this->validate(); |
| 73 | 73 | $data = $this->body; |
| 74 | 74 | $sign = $this->generateSign($data); |
| 75 | - $gateway = $this->gateway . $this->api; |
|
| 75 | + $gateway = $this->gateway . $this->api; |
|
| 76 | 76 | $data = json_encode($data); |
| 77 | 77 | if ('cli' == php_sapi_name()) { |
| 78 | 78 | echo 'api:' . $gateway . PHP_EOL; |
@@ -21,5 +21,5 @@ |
||
| 21 | 21 | * 必传的值 |
| 22 | 22 | * @var array |
| 23 | 23 | */ |
| 24 | - protected $require = ['requestTimestamp', 'merOrderId', 'mid', 'tid','instMid']; |
|
| 24 | + protected $require = ['requestTimestamp', 'merOrderId', 'mid', 'tid', 'instMid']; |
|
| 25 | 25 | } |