Commit 6a2341e1 authored by iWallet Dev's avatar iWallet Dev

Added Exception to Admin Corp Account

parent 3131375a
...@@ -126,6 +126,10 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -126,6 +126,10 @@ class WithdrawModelClass extends ModelClassEx {
$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"); $this -> administrativeExceptions = $this -> getSettingConfiguration("administrative_exception");
$this -> administrativeExceptions = array_map(function($element){
return $element -> user_account;
}, $this -> administrativeExceptions);
//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)){
...@@ -185,7 +189,7 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -185,7 +189,7 @@ class WithdrawModelClass extends ModelClassEx {
* @parameter : なし * @parameter : なし
* @return : TRUE:成功、FALSE:失敗 * @return : TRUE:成功、FALSE:失敗
-------------------------------------------------------------------------*/ -------------------------------------------------------------------------*/
public function validate() { public function validate() {
$rtn = true; $rtn = true;
//set type confirm, type complete and type back based on money out solution //set type confirm, type complete and type back based on money out solution
...@@ -312,12 +316,8 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -312,12 +316,8 @@ class WithdrawModelClass extends ModelClassEx {
, $this -> getUserData(PARAM_USER_ACCOUNT)); , $this -> getUserData(PARAM_USER_ACCOUNT));
} }
// 手数料なし // 手数料なし
$accounts = array_map(function($element){ if(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $this -> administrativeExceptions)){
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]);
...@@ -443,14 +443,9 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -443,14 +443,9 @@ class WithdrawModelClass extends ModelClassEx {
, NO_STRING , NO_STRING
, $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(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $this -> administrativeExceptions)){
if($this -> fromCurrency == USD) if($this -> fromCurrency == USD)
$this -> setFeeEx($fee[USD . VAL_INT_1]); $this -> setFeeEx($fee[USD . VAL_INT_1]);
else else
...@@ -479,7 +474,8 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -479,7 +474,8 @@ class WithdrawModelClass extends ModelClassEx {
$rtn = false; $rtn = false;
} }
if($this -> amount > 500000){ if(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $this -> administrativeExceptions)
&& $this -> amount > 500000){
$this -> popUpSessionMessage(ERROR, 'E_ERROR_AMOUNT', array()); $this -> popUpSessionMessage(ERROR, 'E_ERROR_AMOUNT', array());
$rtn = false; $rtn = false;
} }
...@@ -517,12 +513,8 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -517,12 +513,8 @@ 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){
return $element -> user_account;
}, $this -> administrativeExceptions);
if(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $accounts)){ if(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $this -> administrativeExceptions)){
$this -> arrangeMinimumFee(); $this -> arrangeMinimumFee();
} }
} }
...@@ -789,7 +781,8 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -789,7 +781,8 @@ class WithdrawModelClass extends ModelClassEx {
//check if method is Flat3 //check if method is Flat3
if($_SESSION['moneyoutSolution'] == 'Flat3'){ if($_SESSION['moneyoutSolution'] == 'Flat3'){
if(count($this -> getPendingWithdrawalTransactions())){ if(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $this -> administrativeExceptions)
&& count($this -> getPendingWithdrawalTransactions())){
$this -> popUpSessionMessage(ERROR, 'E_ERROR_PENDING_FLAT3_WITHDRAWAL', array()); $this -> popUpSessionMessage(ERROR, 'E_ERROR_PENDING_FLAT3_WITHDRAWAL', array());
$this -> setType(); $this -> setType();
return; return;
...@@ -1602,19 +1595,10 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -1602,19 +1595,10 @@ class WithdrawModelClass extends ModelClassEx {
} }
$this -> drawFee = $standardJPYFee["published_amount"]; $this -> drawFee = $standardJPYFee["published_amount"];
$loggedInUserAcc = $this -> getUserData(PARAM_USER_ACCOUNT); if(in_array($this -> getUserData(PARAM_USER_ACCOUNT), $this -> administrativeExceptions)){
$adminException = $this -> getSettingConfiguration("administrative_exception"); $this -> setFeeEx(NO_COUNT);
$this -> drawFee = NO_COUNT;
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;
}
break;
}
} }
} }
...@@ -2214,12 +2198,8 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -2214,12 +2198,8 @@ class WithdrawModelClass extends ModelClassEx {
public function getOutStatus() public function getOutStatus()
{ {
$rtn = array(); $rtn = array();
$userAccounts = array_map(function($element){ if(in_array($this -> getUserData(PARAM_USER_ACCOUNT), $this -> administrativeExceptions)){
return $element -> user_account;
}, $this -> administrativeExceptions);
if(in_array($this -> getUserData(PARAM_USER_ACCOUNT), $userAccounts)){
$method = getOutMoney(); $method = getOutMoney();
} else { } else {
$method = getOouMoney(); $method = getOouMoney();
...@@ -2278,12 +2258,8 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -2278,12 +2258,8 @@ class WithdrawModelClass extends ModelClassEx {
} elseif(!$this -> checkStringNumber($this -> amount)) { } elseif(!$this -> checkStringNumber($this -> amount)) {
$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){ if(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $this -> administrativeExceptions)){
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, $exchange = $this -> getExchangeCommon(VAL_INT_MINIMUM_WITHDRAW_AMOUNT, 'USD', $this -> currency,
false, false, NO_STRING, $this -> getUserData(PARAM_USER_ACCOUNT)); // anton false, false, NO_STRING, $this -> getUserData(PARAM_USER_ACCOUNT)); // anton
$this -> popUpSessionMessage(ERROR, 'E_ERROR_WITHDRAW_MINIMUM', array($this -> currency, $exchange[PARAM_ORIGINAL_AMOUNT])); $this -> popUpSessionMessage(ERROR, 'E_ERROR_WITHDRAW_MINIMUM', array($this -> currency, $exchange[PARAM_ORIGINAL_AMOUNT]));
......
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