diff --git a/src/PayuniApi.php b/src/PayuniApi.php index d751590..fc46e66 100644 --- a/src/PayuniApi.php +++ b/src/PayuniApi.php @@ -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', @@ -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; @@ -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; } /**