Commit 020921e5 authored by iWallet Dev's avatar iWallet Dev

Withdrawal Model Rev

parent 1339b119
...@@ -44,6 +44,7 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -44,6 +44,7 @@ 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モデルクラスコンストラクタ
...@@ -69,7 +70,6 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -69,7 +70,6 @@ class WithdrawModelClass extends ModelClassEx {
// チェック // チェック
$this -> validate(); $this -> validate();
} catch (Exception $e) { } catch (Exception $e) {
throw $e; throw $e;
} }
...@@ -124,6 +124,8 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -124,6 +124,8 @@ 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)){
...@@ -193,7 +195,7 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -193,7 +195,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
...@@ -310,12 +312,19 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -310,12 +312,19 @@ class WithdrawModelClass extends ModelClassEx {
, $this -> getUserData(PARAM_USER_ACCOUNT)); , $this -> getUserData(PARAM_USER_ACCOUNT));
} }
// バランスと(送金額 + 手数料)のチェック // 手数料なし
if($this -> fromCurrency == USD) { $accounts = array_map(function($element){
$this -> setFeeEx($fee[USD . VAL_INT_1]); return $element -> user_account;
} else { }, $this -> administrativeExceptions);
$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]);
...@@ -369,10 +378,12 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -369,10 +378,12 @@ 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); 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); if($this -> getFeeEx() < $flat3Fee){
$this -> setFeeEx($flat3Fee);
}
} }
} }
} }
...@@ -433,12 +444,19 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -433,12 +444,19 @@ 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($this -> fromCurrency == USD) { if(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $accounts)){
$this -> setFeeEx($fee[USD . VAL_INT_1]); if($this -> fromCurrency == USD)
} else { $this -> setFeeEx($fee[USD . VAL_INT_1]);
$this -> setFeeEx($feeExchange[PARAM_AMOUNT]); 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]);
...@@ -498,13 +516,15 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -498,13 +516,15 @@ 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);
// if($this -> getFeeEx() < $flat3Fee){ $accounts = array_map(function($element){
// $this -> setFeeEx($flat3Fee); return $element -> user_account;
// } }, $this -> administrativeExceptions);
$this -> arrangeMinimumFee(); if(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $accounts)){
$this -> arrangeMinimumFee();
}
} }
} }
...@@ -1551,11 +1571,15 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -1551,11 +1571,15 @@ 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 :
...@@ -1584,9 +1608,10 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -1584,9 +1608,10 @@ 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;
} }
...@@ -2195,9 +2220,19 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -2195,9 +2220,19 @@ 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));
...@@ -2252,10 +2287,16 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -2252,10 +2287,16 @@ 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
$exchange = $this -> getExchangeCommon(VAL_INT_MINIMUM_WITHDRAW_AMOUNT, 'USD', $this -> currency, $userAccounts = array_map(function($element){
false, false, NO_STRING, $this -> getUserData(PARAM_USER_ACCOUNT)); // anton return $element -> user_account;
$this -> popUpSessionMessage(ERROR, 'E_ERROR_WITHDRAW_MINIMUM', array($this -> currency, $exchange[PARAM_ORIGINAL_AMOUNT])); }, $this -> administrativeExceptions);
$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