@@ -43,7 +43,7 @@ public function __construct(string $key, string $iv, string $type = '')
43
43
* @author Yifan
44
44
* @ dateTime 2022-08-23
45
45
*/
46
- public function UniversalTrade (array $ encryptInfo , string $ tradeType, int $ workType = 1 ) {
46
+ public function UniversalTrade (array $ encryptInfo , string $ tradeType ) {
47
47
$ this ->encryptInfo = $ encryptInfo ;
48
48
$ contrast = [
49
49
'upp ' => 'upp ' ,
@@ -126,7 +126,7 @@ public function UniversalTrade(array $encryptInfo, string $tradeType, int $workT
126
126
throw new Exception ('Unknown params ' );
127
127
break ;
128
128
}
129
- $ this ->SetParams ($ contrast [$ tradeType ], $ workType );
129
+ $ this ->SetParams ($ contrast [$ tradeType ]);
130
130
if ($ tradeType == 'upp ' ) {
131
131
$ this ->HtmlApi ();
132
132
exit ;
@@ -208,17 +208,10 @@ private function CheckParams() {
208
208
* @author Yifan
209
209
* @ dateTime 2022-08-23
210
210
*/
211
- private function SetParams (string $ type = '' , int $ workType = 1 ) {
212
- if (isset ($ this ->encryptInfo ['TradeGateway ' ])) {
213
- $ tradeGateway = $ this ->encryptInfo ['TradeGateway ' ];
214
- unset($ this ->encryptInfo ['TradeGateway ' ]);
215
- }
211
+ private function SetParams (string $ type = '' ) {
216
212
$ this ->parameter ['MerID ' ] = $ this ->encryptInfo ['MerID ' ];
217
213
$ this ->parameter ['EncryptInfo ' ] = $ this ->Encrypt ();
218
214
$ this ->parameter ['HashInfo ' ] = $ this ->HashInfo ($ this ->parameter ['EncryptInfo ' ]);
219
- if ( in_array ($ workType ,[4 ,6 ])) {
220
- $ this ->parameter ['TradeGateway ' ]= $ tradeGateway ;
221
- }
222
215
$ this ->curlUrl = $ this ->apiUrl . $ type ;
223
216
}
224
217
/**
0 commit comments