@@ -57,13 +57,13 @@ |
||
| 57 | 57 | trigger_error('need openssl support sha256', E_USER_ERROR); |
| 58 | 58 | } |
| 59 | 59 | if (empty ($this->appId)) { |
| 60 | - throw new InvalidConfigException ('The "appId" property must be set.'); |
|
| 60 | + throw new InvalidConfigException('The "appId" property must be set.'); |
|
| 61 | 61 | } |
| 62 | 62 | if (empty ($this->privateKey)) { |
| 63 | - throw new InvalidConfigException ('The "privateKey" property must be set.'); |
|
| 63 | + throw new InvalidConfigException('The "privateKey" property must be set.'); |
|
| 64 | 64 | } |
| 65 | 65 | if (empty ($this->publicKey)) { |
| 66 | - throw new InvalidConfigException ('The "publicKey" property must be set.'); |
|
| 66 | + throw new InvalidConfigException('The "publicKey" property must be set.'); |
|
| 67 | 67 | } |
| 68 | 68 | $this->initPrivateKey(); |
| 69 | 69 | $this->initPublicKey(); |
@@ -67,11 +67,11 @@ discard block |
||
| 67 | 67 | * @var array 交易类型和Trade映射 |
| 68 | 68 | */ |
| 69 | 69 | public $tradeTypeMap = [ |
| 70 | - Gateway::TRADE_TYPE_NATIVE => 'NATIVE',//WEB 原生扫码支付 |
|
| 71 | - Gateway::TRADE_TYPE_JS_API => 'JSAPI',//应用内JS API,如微信 |
|
| 72 | - Gateway::TRADE_TYPE_APP => 'APP',//app支付 |
|
| 73 | - Gateway::TRADE_TYPE_H5 => 'MWEB',//H5支付 |
|
| 74 | - Gateway::TRADE_TYPE_MICROPAY => 'MICROPAY',//刷卡支付 |
|
| 70 | + Gateway::TRADE_TYPE_NATIVE => 'NATIVE', //WEB 原生扫码支付 |
|
| 71 | + Gateway::TRADE_TYPE_JS_API => 'JSAPI', //应用内JS API,如微信 |
|
| 72 | + Gateway::TRADE_TYPE_APP => 'APP', //app支付 |
|
| 73 | + Gateway::TRADE_TYPE_H5 => 'MWEB', //H5支付 |
|
| 74 | + Gateway::TRADE_TYPE_MICROPAY => 'MICROPAY', //刷卡支付 |
|
| 75 | 75 | ]; |
| 76 | 76 | |
| 77 | 77 | /** |
@@ -85,19 +85,19 @@ discard block |
||
| 85 | 85 | trigger_error('need openssl support sha256', E_USER_ERROR); |
| 86 | 86 | } |
| 87 | 87 | if (empty ($this->appId)) { |
| 88 | - throw new InvalidConfigException ('The "appId" property must be set.'); |
|
| 88 | + throw new InvalidConfigException('The "appId" property must be set.'); |
|
| 89 | 89 | } |
| 90 | 90 | if (empty ($this->apiKey)) { |
| 91 | - throw new InvalidConfigException ('The "apiKey" property must be set.'); |
|
| 91 | + throw new InvalidConfigException('The "apiKey" property must be set.'); |
|
| 92 | 92 | } |
| 93 | 93 | if (empty ($this->mchId)) { |
| 94 | - throw new InvalidConfigException ('The "mchId" property must be set.'); |
|
| 94 | + throw new InvalidConfigException('The "mchId" property must be set.'); |
|
| 95 | 95 | } |
| 96 | 96 | if (empty ($this->privateKey)) { |
| 97 | - throw new InvalidConfigException ('The "privateKey" property must be set.'); |
|
| 97 | + throw new InvalidConfigException('The "privateKey" property must be set.'); |
|
| 98 | 98 | } |
| 99 | 99 | if (empty ($this->publicKey)) { |
| 100 | - throw new InvalidConfigException ('The "publicKey" property must be set.'); |
|
| 100 | + throw new InvalidConfigException('The "publicKey" property must be set.'); |
|
| 101 | 101 | } |
| 102 | 102 | $this->initPrivateKey(); |
| 103 | 103 | $this->initPublicKey(); |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $weParams = $trade->user->socialAccounts['wechat']->getDecodedData(); |
| 137 | 137 | $data['openid'] = $weParams['openid']; |
| 138 | 138 | } else { |
| 139 | - throw new PaymentException ('Non-WeChat authorized login.'); |
|
| 139 | + throw new PaymentException('Non-WeChat authorized login.'); |
|
| 140 | 140 | } |
| 141 | 141 | } |
| 142 | 142 | $response = $this->post('pay/unifiedorder', $data)->send(); |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | throw new PaymentException($response->data['return_msg']); |
| 149 | 149 | } |
| 150 | 150 | } else { |
| 151 | - throw new Exception ('Http request failed.'); |
|
| 151 | + throw new Exception('Http request failed.'); |
|
| 152 | 152 | } |
| 153 | 153 | } |
| 154 | 154 | |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | } elseif ($this->signType == self::SIGNATURE_METHOD_SHA256) { |
| 229 | 229 | $sign = hash_hmac('sha256', $bizString, $this->apiKey); |
| 230 | 230 | } else { |
| 231 | - throw new InvalidConfigException ('This encryption is not supported'); |
|
| 231 | + throw new InvalidConfigException('This encryption is not supported'); |
|
| 232 | 232 | } |
| 233 | 233 | return strtoupper($sign); |
| 234 | 234 | } |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | throw new InvalidConfigException(openssl_error_string()); |
| 258 | 258 | } |
| 259 | 259 | } else { |
| 260 | - throw new InvalidConfigException ('The "privateKey" property must be set.'); |
|
| 260 | + throw new InvalidConfigException('The "privateKey" property must be set.'); |
|
| 261 | 261 | } |
| 262 | 262 | } |
| 263 | 263 | |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | throw new InvalidConfigException(openssl_error_string()); |
| 275 | 275 | } |
| 276 | 276 | } else { |
| 277 | - throw new InvalidConfigException ('The "publicKey" property must be set.'); |
|
| 277 | + throw new InvalidConfigException('The "publicKey" property must be set.'); |
|
| 278 | 278 | } |
| 279 | 279 | } |
| 280 | 280 | } |
| 281 | 281 | \ No newline at end of file |