Skip to content

Commit bd6052f

Browse files
author
Ryder Hsieh
committed
Revert "修正傳入參數"
This reverts commit df80b67.
1 parent df80b67 commit bd6052f

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/PayuniApi.php

+3-10
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(string $key, string $iv, string $type = '')
4343
* @author Yifan
4444
* @ dateTime 2022-08-23
4545
*/
46-
public function UniversalTrade(array $encryptInfo, string $tradeType, int $workType = 1) {
46+
public function UniversalTrade(array $encryptInfo, string $tradeType) {
4747
$this->encryptInfo = $encryptInfo;
4848
$contrast = [
4949
'upp' => 'upp',
@@ -126,7 +126,7 @@ public function UniversalTrade(array $encryptInfo, string $tradeType, int $workT
126126
throw new Exception('Unknown params');
127127
break;
128128
}
129-
$this->SetParams($contrast[$tradeType], $workType);
129+
$this->SetParams($contrast[$tradeType]);
130130
if ($tradeType == 'upp') {
131131
$this->HtmlApi();
132132
exit;
@@ -208,17 +208,10 @@ private function CheckParams() {
208208
* @author Yifan
209209
* @ dateTime 2022-08-23
210210
*/
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 = '') {
216212
$this->parameter['MerID'] = $this->encryptInfo['MerID'];
217213
$this->parameter['EncryptInfo'] = $this->Encrypt();
218214
$this->parameter['HashInfo'] = $this->HashInfo($this->parameter['EncryptInfo']);
219-
if ( in_array($workType,[4,6])) {
220-
$this->parameter['TradeGateway']= $tradeGateway;
221-
}
222215
$this->curlUrl = $this->apiUrl . $type;
223216
}
224217
/**

0 commit comments

Comments
 (0)