Commit 1339b119 authored by iWallet Dev's avatar iWallet Dev

Adjusted Maximum Withdrawal Limit

parent fa227f09
...@@ -44,7 +44,6 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -44,7 +44,6 @@ class WithdrawModelClass extends ModelClassEx {
private $province = null; //province (SDPay) private $province = null; //province (SDPay)
private $city = null; //city (SDPay) private $city = null; //city (SDPay)
private $withdrawTool = null; //withdrawal tool class (SDPay) private $withdrawTool = null; //withdrawal tool class (SDPay)
private $administrativeExceptions = null; //user account whitelisting settings
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* @function_name: コントロールパネルシステムindexモデルクラスコンストラクタ * @function_name: コントロールパネルシステムindexモデルクラスコンストラクタ
...@@ -70,6 +69,7 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -70,6 +69,7 @@ class WithdrawModelClass extends ModelClassEx {
// チェック // チェック
$this -> validate(); $this -> validate();
} catch (Exception $e) { } catch (Exception $e) {
throw $e; throw $e;
} }
...@@ -124,8 +124,6 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -124,8 +124,6 @@ class WithdrawModelClass extends ModelClassEx {
//get account data //get account data
$this -> account = $this -> getRowData($this -> getAccountCommon($this -> getUserData(PARAM_USER_ACCOUNT))); $this -> account = $this -> getRowData($this -> getAccountCommon($this -> getUserData(PARAM_USER_ACCOUNT)));
$this -> administrativeExceptions = $this -> getSettingConfiguration("administrative_exception");
//if moneyout solution is not null save it to session //if moneyout solution is not null save it to session
if($this -> moneyoutSolution != NO_STRING && in_array($this -> moneyoutSolution, VAL_ARR_MONEYOUT_SOLUTIONS)){ if($this -> moneyoutSolution != NO_STRING && in_array($this -> moneyoutSolution, VAL_ARR_MONEYOUT_SOLUTIONS)){
...@@ -195,7 +193,7 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -195,7 +193,7 @@ class WithdrawModelClass extends ModelClassEx {
$this -> setType(); $this -> setType();
return; return;
} }
// if type is not input // if type is not input
if($this -> getType() != TYPE_INPUT if($this -> getType() != TYPE_INPUT
&& $this -> getType() != TYPE_LOCAL_INPUT && $this -> getType() != TYPE_LOCAL_INPUT
...@@ -312,19 +310,12 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -312,19 +310,12 @@ class WithdrawModelClass extends ModelClassEx {
, $this -> getUserData(PARAM_USER_ACCOUNT)); , $this -> getUserData(PARAM_USER_ACCOUNT));
} }
// 手数料なし // バランスと(送金額 + 手数料)のチェック
$accounts = array_map(function($element){ if($this -> fromCurrency == USD) {
return $element -> user_account; $this -> setFeeEx($fee[USD . VAL_INT_1]);
}, $this -> administrativeExceptions); } else {
$this -> setFeeEx($feeExchange[PARAM_AMOUNT]);
if(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $accounts)){ }
// バランスと(送金額 + 手数料)のチェック
if($this -> fromCurrency == USD)
$this -> setFeeEx($fee[USD . VAL_INT_1]);
else
$this -> setFeeEx($feeExchange[PARAM_AMOUNT]);
}else
$this -> setFeeEx(0);
$this -> setAgent1Ex($fee[PARAM_AGENT_CODE . VAL_INT_1]); $this -> setAgent1Ex($fee[PARAM_AGENT_CODE . VAL_INT_1]);
...@@ -378,12 +369,10 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -378,12 +369,10 @@ class WithdrawModelClass extends ModelClassEx {
//check if flat 3 //check if flat 3
if($_SESSION['moneyoutSolution'] == 'Flat3'){ if($_SESSION['moneyoutSolution'] == 'Flat3'){
if(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $accounts)){ $flat3Fee = round($this -> debitAmount * VAL_FLOAT_FLAT3_WITHDRAW_FEE, 2);
$flat3Fee = round($this -> debitAmount * VAL_FLOAT_FLAT3_WITHDRAW_FEE, 2);
if($this -> getFeeEx() < $flat3Fee){
if($this -> getFeeEx() < $flat3Fee){ $this -> setFeeEx($flat3Fee);
$this -> setFeeEx($flat3Fee);
}
} }
} }
} }
...@@ -444,19 +433,12 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -444,19 +433,12 @@ class WithdrawModelClass extends ModelClassEx {
, $this -> getUserData(PARAM_USER_ACCOUNT)); , $this -> getUserData(PARAM_USER_ACCOUNT));
} }
// setting exception
$accounts = array_map(function($element){
return $element -> user_account;
}, $this -> administrativeExceptions);
// バランスと(送金額 + 手数料)のチェック // バランスと(送金額 + 手数料)のチェック
if(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $accounts)){ if($this -> fromCurrency == USD) {
if($this -> fromCurrency == USD) $this -> setFeeEx($fee[USD . VAL_INT_1]);
$this -> setFeeEx($fee[USD . VAL_INT_1]); } else {
else $this -> setFeeEx($feeExchange[PARAM_AMOUNT]);
$this -> setFeeEx($feeExchange[PARAM_AMOUNT]); }
}else
$this -> setFeeEx(0);
$this -> setAgent1Ex($fee[PARAM_AGENT_CODE . VAL_INT_1]); $this -> setAgent1Ex($fee[PARAM_AGENT_CODE . VAL_INT_1]);
...@@ -479,7 +461,7 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -479,7 +461,7 @@ class WithdrawModelClass extends ModelClassEx {
$rtn = false; $rtn = false;
} }
if($this -> amount >= 1000000){ if($this -> amount >= 500000){
$this -> popUpSessionMessage(ERROR, 'E_ERROR_AMOUNT', array()); $this -> popUpSessionMessage(ERROR, 'E_ERROR_AMOUNT', array());
$rtn = false; $rtn = false;
} }
...@@ -516,15 +498,13 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -516,15 +498,13 @@ class WithdrawModelClass extends ModelClassEx {
//check if flat 3 //check if flat 3
if($_SESSION['moneyoutSolution'] == 'Flat3'){ if($_SESSION['moneyoutSolution'] == 'Flat3'){
$flat3Fee = round($this -> debitAmount * VAL_FLOAT_FLAT3_WITHDRAW_FEE, 2); // $flat3Fee = round($this -> debitAmount * VAL_FLOAT_FLAT3_WITHDRAW_FEE, 2);
$accounts = array_map(function($element){ // if($this -> getFeeEx() < $flat3Fee){
return $element -> user_account; // $this -> setFeeEx($flat3Fee);
}, $this -> administrativeExceptions); // }
if(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $accounts)){ $this -> arrangeMinimumFee();
$this -> arrangeMinimumFee();
}
} }
} }
...@@ -1571,15 +1551,11 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -1571,15 +1551,11 @@ class WithdrawModelClass extends ModelClassEx {
} }
} }
/*-------------------------------------------------------------------------
* @function_name: 引落口座通貨の取得
* @parameter : なし
* @return : 引落口座通貨
-------------------------------------------------------------------------*/
public function echoDebitCurrency() { public function echoDebitCurrency() {
echo $this -> debitCurrency; echo $this -> debitCurrency;
} }
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* @function_name: 最小手数料の指定 * @function_name: 最小手数料の指定
* @parameter : * @parameter :
...@@ -1608,10 +1584,9 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -1608,10 +1584,9 @@ class WithdrawModelClass extends ModelClassEx {
foreach($adminException as $data){ foreach($adminException as $data){
if(isset($data -> user_account) && $data -> user_account === $loggedInUserAcc){ if(isset($data -> user_account) && $data -> user_account === $loggedInUserAcc){
if(isset($data -> ignore_f3withdrawal_fee) && $data -> ignore_f3withdrawal_fee){ if(isset($data -> ignore_f3withdrawal_fee) && $data -> ignore_f3withdrawal_fee){
$this -> setFeeEx(NO_COUNT); $this -> setFeeEx(NO_COUNT);
$this -> drawFee = NO_COUNT; $this -> drawFee = NO_COUNT;
} }
break; break;
} }
...@@ -2220,19 +2195,9 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -2220,19 +2195,9 @@ class WithdrawModelClass extends ModelClassEx {
} }
public function getOutStatus() public function getOutStatus()
{ {
$rtn = array(); $rtn = array();
$method = getOouMoney();
$userAccounts = array_map(function($element){
return $element -> user_account;
}, $this -> administrativeExceptions);
if(in_array($this -> getUserData(PARAM_USER_ACCOUNT), $userAccounts)){
$method = getOutMoney();
} else {
$method = getOouMoney();
}
$lang = $this -> getLangage(); $lang = $this -> getLangage();
foreach ($method as $key => $value) { foreach ($method as $key => $value) {
$solution = ($value[1] == 'Flat3') ? PARAM_WITHDRAW_FLAT3_METHOD : (($value[1] == 'SDPay') ? PARAM_WITHDRAW_LBTC_METHOD : (($value[1] == 'H2P') ? PARAM_WITHDRAW_H2P_METHOD : PARAM_WITHDRAW_IBT_METHOD)); $solution = ($value[1] == 'Flat3') ? PARAM_WITHDRAW_FLAT3_METHOD : (($value[1] == 'SDPay') ? PARAM_WITHDRAW_LBTC_METHOD : (($value[1] == 'H2P') ? PARAM_WITHDRAW_H2P_METHOD : PARAM_WITHDRAW_IBT_METHOD));
...@@ -2287,16 +2252,10 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -2287,16 +2252,10 @@ class WithdrawModelClass extends ModelClassEx {
$this -> popUpSessionMessage(ERROR, 'E_ERROR_REGULAR_NUMBER', array(VAL_STR_AMOUNT)); $this -> popUpSessionMessage(ERROR, 'E_ERROR_REGULAR_NUMBER', array(VAL_STR_AMOUNT));
$rtn = false; $rtn = false;
} elseif(!$this->CheckWithdrawMinimum($this -> currency, $this -> amount)) { //check withdrawal minimum } elseif(!$this->CheckWithdrawMinimum($this -> currency, $this -> amount)) { //check withdrawal minimum
$userAccounts = array_map(function($element){ $exchange = $this -> getExchangeCommon(VAL_INT_MINIMUM_WITHDRAW_AMOUNT, 'USD', $this -> currency,
return $element -> user_account; false, false, NO_STRING, $this -> getUserData(PARAM_USER_ACCOUNT)); // anton
}, $this -> administrativeExceptions); $this -> popUpSessionMessage(ERROR, 'E_ERROR_WITHDRAW_MINIMUM', array($this -> currency, $exchange[PARAM_ORIGINAL_AMOUNT]));
$rtn = false;
if(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $userAccounts)){
$exchange = $this -> getExchangeCommon(VAL_INT_MINIMUM_WITHDRAW_AMOUNT, 'USD', $this -> currency,
false, false, NO_STRING, $this -> getUserData(PARAM_USER_ACCOUNT)); // anton
$this -> popUpSessionMessage(ERROR, 'E_ERROR_WITHDRAW_MINIMUM', array($this -> currency, $exchange[PARAM_ORIGINAL_AMOUNT]));
$rtn = false;
}
} }
// check currency if in list of allowed currenicies // check currency if in list of allowed currenicies
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment