Skip to content

Commit

Permalink
Revert "修正傳入參數"
Browse files Browse the repository at this point in the history
This reverts commit df80b67.
  • Loading branch information
Ryder Hsieh committed Oct 28, 2022
1 parent df80b67 commit bd6052f
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/PayuniApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function __construct(string $key, string $iv, string $type = '')
* @author Yifan
* @ dateTime 2022-08-23
*/
public function UniversalTrade(array $encryptInfo, string $tradeType, int $workType = 1) {
public function UniversalTrade(array $encryptInfo, string $tradeType) {
$this->encryptInfo = $encryptInfo;
$contrast = [
'upp' => 'upp',
Expand Down Expand Up @@ -126,7 +126,7 @@ public function UniversalTrade(array $encryptInfo, string $tradeType, int $workT
throw new Exception('Unknown params');
break;
}
$this->SetParams($contrast[$tradeType], $workType);
$this->SetParams($contrast[$tradeType]);
if ($tradeType == 'upp') {
$this->HtmlApi();
exit;
Expand Down Expand Up @@ -208,17 +208,10 @@ private function CheckParams() {
* @author Yifan
* @ dateTime 2022-08-23
*/
private function SetParams(string $type = '', int $workType = 1) {
if (isset($this->encryptInfo['TradeGateway'])) {
$tradeGateway = $this->encryptInfo['TradeGateway'];
unset($this->encryptInfo['TradeGateway']);
}
private function SetParams(string $type = '') {
$this->parameter['MerID'] = $this->encryptInfo['MerID'];
$this->parameter['EncryptInfo'] = $this->Encrypt();
$this->parameter['HashInfo'] = $this->HashInfo($this->parameter['EncryptInfo']);
if ( in_array($workType,[4,6])) {
$this->parameter['TradeGateway']= $tradeGateway;
}
$this->curlUrl = $this->apiUrl . $type;
}
/**
Expand Down

0 comments on commit bd6052f

Please sign in to comment.