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

Adjusted Maximum Withdrawal Limit

parent fa227f09
......@@ -44,7 +44,6 @@ class WithdrawModelClass extends ModelClassEx {
private $province = null; //province (SDPay)
private $city = null; //city (SDPay)
private $withdrawTool = null; //withdrawal tool class (SDPay)
private $administrativeExceptions = null; //user account whitelisting settings
/*-------------------------------------------------------------------------
* @function_name: コントロールパネルシステムindexモデルクラスコンストラクタ
......@@ -70,6 +69,7 @@ class WithdrawModelClass extends ModelClassEx {
// チェック
$this -> validate();
} catch (Exception $e) {
throw $e;
}
......@@ -124,8 +124,6 @@ class WithdrawModelClass extends ModelClassEx {
//get account data
$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($this -> moneyoutSolution != NO_STRING && in_array($this -> moneyoutSolution, VAL_ARR_MONEYOUT_SOLUTIONS)){
......@@ -195,7 +193,7 @@ class WithdrawModelClass extends ModelClassEx {
$this -> setType();
return;
}
// if type is not input
if($this -> getType() != TYPE_INPUT
&& $this -> getType() != TYPE_LOCAL_INPUT
......@@ -312,19 +310,12 @@ class WithdrawModelClass extends ModelClassEx {
, $this -> getUserData(PARAM_USER_ACCOUNT));
}
// 手数料なし
$accounts = array_map(function($element){
return $element -> user_account;
}, $this -> administrativeExceptions);
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);
// バランスと(送金額 + 手数料)のチェック
if($this -> fromCurrency == USD) {
$this -> setFeeEx($fee[USD . VAL_INT_1]);
} else {
$this -> setFeeEx($feeExchange[PARAM_AMOUNT]);
}
$this -> setAgent1Ex($fee[PARAM_AGENT_CODE . VAL_INT_1]);
......@@ -378,12 +369,10 @@ class WithdrawModelClass extends ModelClassEx {
//check if flat 3
if($_SESSION['moneyoutSolution'] == 'Flat3'){
if(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $accounts)){
$flat3Fee = round($this -> debitAmount * VAL_FLOAT_FLAT3_WITHDRAW_FEE, 2);
if($this -> getFeeEx() < $flat3Fee){
$this -> setFeeEx($flat3Fee);
}
$flat3Fee = round($this -> debitAmount * VAL_FLOAT_FLAT3_WITHDRAW_FEE, 2);
if($this -> getFeeEx() < $flat3Fee){
$this -> setFeeEx($flat3Fee);
}
}
}
......@@ -444,19 +433,12 @@ class WithdrawModelClass extends ModelClassEx {
, $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)
$this -> setFeeEx($fee[USD . VAL_INT_1]);
else
$this -> setFeeEx($feeExchange[PARAM_AMOUNT]);
}else
$this -> setFeeEx(0);
if($this -> fromCurrency == USD) {
$this -> setFeeEx($fee[USD . VAL_INT_1]);
} else {
$this -> setFeeEx($feeExchange[PARAM_AMOUNT]);
}
$this -> setAgent1Ex($fee[PARAM_AGENT_CODE . VAL_INT_1]);
......@@ -479,7 +461,7 @@ class WithdrawModelClass extends ModelClassEx {
$rtn = false;
}
if($this -> amount >= 1000000){
if($this -> amount >= 500000){
$this -> popUpSessionMessage(ERROR, 'E_ERROR_AMOUNT', array());
$rtn = false;
}
......@@ -516,15 +498,13 @@ class WithdrawModelClass extends ModelClassEx {
//check if flat 3
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){
return $element -> user_account;
}, $this -> administrativeExceptions);
// if($this -> getFeeEx() < $flat3Fee){
// $this -> setFeeEx($flat3Fee);
// }
if(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $accounts)){
$this -> arrangeMinimumFee();
}
$this -> arrangeMinimumFee();
}
}
......@@ -1571,15 +1551,11 @@ class WithdrawModelClass extends ModelClassEx {
}
}
/*-------------------------------------------------------------------------
* @function_name: 引落口座通貨の取得
* @parameter : なし
* @return : 引落口座通貨
-------------------------------------------------------------------------*/
public function echoDebitCurrency() {
echo $this -> debitCurrency;
}
/*-------------------------------------------------------------------------
* @function_name: 最小手数料の指定
* @parameter :
......@@ -1608,10 +1584,9 @@ class WithdrawModelClass extends ModelClassEx {
foreach($adminException as $data){
if(isset($data -> user_account) && $data -> user_account === $loggedInUserAcc){
if(isset($data -> ignore_f3withdrawal_fee) && $data -> ignore_f3withdrawal_fee){
$this -> setFeeEx(NO_COUNT);
$this -> drawFee = NO_COUNT;
$this -> setFeeEx(NO_COUNT);
$this -> drawFee = NO_COUNT;
}
break;
}
......@@ -2220,19 +2195,9 @@ class WithdrawModelClass extends ModelClassEx {
}
public function getOutStatus()
{
$rtn = array();
$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();
}
{
$rtn = array();
$method = getOouMoney();
$lang = $this -> getLangage();
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));
......@@ -2287,16 +2252,10 @@ class WithdrawModelClass extends ModelClassEx {
$this -> popUpSessionMessage(ERROR, 'E_ERROR_REGULAR_NUMBER', array(VAL_STR_AMOUNT));
$rtn = false;
} elseif(!$this->CheckWithdrawMinimum($this -> currency, $this -> amount)) { //check withdrawal minimum
$userAccounts = array_map(function($element){
return $element -> user_account;
}, $this -> administrativeExceptions);
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;
}
$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
......
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