From faf414e66986f12a5ef178ea2ced28171ae1f6cb Mon Sep 17 00:00:00 2001 From: iAmShorty Date: Wed, 5 Mar 2014 15:02:16 +0100 Subject: [PATCH] [FEATURE] added minimum payout --- public/include/config/global.inc.dist.php | 6 ++++++ public/include/pages/account/edit.inc.php | 2 ++ public/include/smarty_globals.inc.php | 1 + public/templates/bootstrap/account/edit/cashout.tpl | 7 ++++++- 4 files changed, 15 insertions(+), 1 deletion(-) mode change 100644 => 100755 public/include/config/global.inc.dist.php mode change 100644 => 100755 public/templates/bootstrap/account/edit/cashout.tpl diff --git a/public/include/config/global.inc.dist.php b/public/include/config/global.inc.dist.php old mode 100644 new mode 100755 index 06e67c82..1b7dd8be --- a/public/include/config/global.inc.dist.php +++ b/public/include/config/global.inc.dist.php @@ -77,6 +77,12 @@ $config['price']['currency'] = 'USD'; $config['ap_threshold']['min'] = 1; $config['ap_threshold']['max'] = 250; +/* Minimum manual Payout Threshold + * Minimum manual payout amount + * https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-manual-payout-threshold + **/ +$config['mp_threshold'] = 1; + /** * Donation thresholds * Minimum donation amount in percent diff --git a/public/include/pages/account/edit.inc.php b/public/include/pages/account/edit.inc.php index 3ae8dbf2..25ea149a 100755 --- a/public/include/pages/account/edit.inc.php +++ b/public/include/pages/account/edit.inc.php @@ -96,6 +96,8 @@ if ($user->isAuthenticated()) { case 'cashOut': if ($setting->getValue('disable_payouts') == 1 || $setting->getValue('disable_manual_payouts') == 1) { $_SESSION['POPUP'][] = array('CONTENT' => 'Manual payouts are disabled.', 'TYPE' => 'alert alert-warning'); + } else if ($aBalance['confirmed'] < $config['mp_threshold']) { + $_SESSION['POPUP'][] = array('CONTENT' => 'Payout must be greater or equal than ' . $config['mp_threshold'] . '.', 'TYPE' => 'info'); } else if (!$user->getCoinAddress($_SESSION['USERDATA']['id'])) { $_SESSION['POPUP'][] = array('CONTENT' => 'You have no payout address set.', 'TYPE' => 'alert alert-danger'); } else { diff --git a/public/include/smarty_globals.inc.php b/public/include/smarty_globals.inc.php index 9956a7e5..19e3fd78 100755 --- a/public/include/smarty_globals.inc.php +++ b/public/include/smarty_globals.inc.php @@ -88,6 +88,7 @@ $aGlobal = array( 'txfee_manual' => $config['txfee_manual'], 'txfee_auto' => $config['txfee_auto'], 'payout_system' => $config['payout_system'], + 'mp_threshold' => $config['mp_threshold'], 'ap_threshold' => array( 'min' => $config['ap_threshold']['min'], 'max' => $config['ap_threshold']['max'] diff --git a/public/templates/bootstrap/account/edit/cashout.tpl b/public/templates/bootstrap/account/edit/cashout.tpl old mode 100644 new mode 100755 index e843b2ef..79e3d682 --- a/public/templates/bootstrap/account/edit/cashout.tpl +++ b/public/templates/bootstrap/account/edit/cashout.tpl @@ -15,6 +15,9 @@

Please note: a {if $GLOBAL.config.txfee_manual > 0.00001}{$GLOBAL.config.txfee_manual}{else}{$GLOBAL.config.txfee_manual|number_format:"8"}{/if} {$GLOBAL.config.currency} transaction will apply when processing "On-Demand" manual payments

+

+ Minimum Cashout: {$GLOBAL.config.mp_threshold} {$GLOBAL.config.currency} +

@@ -37,7 +40,9 @@ {if $GLOBAL.twofactor.enabled && $GLOBAL.twofactor.options.withdraw} - {if $WITHDRAWSENT == 1 && $WITHDRAWUNLOCKED == 1} + {if $GLOBAL.userdata.balance.confirmed|escape < $GLOBAL.config.mp_threshold} + + {elseif $WITHDRAWSENT == 1 && $WITHDRAWUNLOCKED == 1} {elseif $WITHDRAWSENT == 0 && $WITHDRAWUNLOCKED == 1 || $WITHDRAWSENT == 1 && $WITHDRAWUNLOCKED == 0}