Skip to content

Commit f72cdf3

Browse files
committed
Merge pull request #1891 from iAmShorty/minimum-payout
[UPDATE] minimum manual payout
2 parents 7d20d84 + e03010b commit f72cdf3

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

public/include/config/global.inc.dist.php

100644100755
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@
7777
$config['ap_threshold']['min'] = 1;
7878
$config['ap_threshold']['max'] = 250;
7979

80+
/**
81+
* Minimum manual Payout Threshold
82+
* Minimum manual payout amount
83+
* https://github.com/MPOS/php-mpos/wiki/Config-Setup#wiki-manual-payout-threshold
84+
**/
85+
$config['mp_threshold'] = 1;
86+
8087
/**
8188
* Donation thresholds
8289
* Minimum donation amount in percent

public/include/pages/account/edit.inc.php

100644100755
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@
9696
case 'cashOut':
9797
if ($setting->getValue('disable_payouts') == 1 || $setting->getValue('disable_manual_payouts') == 1) {
9898
$_SESSION['POPUP'][] = array('CONTENT' => 'Manual payouts are disabled.', 'TYPE' => 'info');
99+
} else if ($aBalance['confirmed'] < $config['mp_threshold']) {
100+
$_SESSION['POPUP'][] = array('CONTENT' => 'Payout must be greater or equal than ' . $config['mp_threshold'] . '.', 'TYPE' => 'info');
99101
} else if (!$user->getCoinAddress($_SESSION['USERDATA']['id'])) {
100102
$_SESSION['POPUP'][] = array('CONTENT' => 'You have no payout address set.', 'TYPE' => 'errormsg');
101103
} else {

public/include/smarty_globals.inc.php

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
'txfee_manual' => $config['txfee_manual'],
8989
'txfee_auto' => $config['txfee_auto'],
9090
'payout_system' => $config['payout_system'],
91+
'mp_threshold' => $config['mp_threshold'],
9192
'ap_threshold' => array(
9293
'min' => $config['ap_threshold']['min'],
9394
'max' => $config['ap_threshold']['max']

public/templates/mpos/account/edit/default.tpl

100644100755
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@
8989
<p style="padding-left:3px; padding-redight:30px; font-size:10px;">
9090
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 <span id="tt"><img width="15px" height="15px" title="This {if $GLOBAL.config.txfee_manual > 0.00001}{$GLOBAL.config.txfee_manual}{else}{$GLOBAL.config.txfee_manual|number_format:"8"}{/if} manual payment transaction fee is a network fee and goes back into the network not the pool." src="site_assets/mpos/images/questionmark.png"></span>
9191
</p>
92+
<p style="padding-left:3px; padding-redight:30px; font-size:10px;">
93+
Minimum Cashout: {$GLOBAL.config.mp_threshold} {$GLOBAL.config.currency}
94+
</p>
9295
<fieldset>
9396
<label>Account Balance</label>
9497
{nocache}<input type="text" value="{$GLOBAL.userdata.balance.confirmed|escape}" {$GLOBAL.config.currency} disabled />{/nocache}
@@ -109,7 +112,9 @@
109112
<input type="hidden" name="ctoken" value="{$CTOKEN|escape|default:""}" />
110113
<input type="hidden" name="utype" value="withdraw_funds">
111114
{if $GLOBAL.twofactor.enabled && $GLOBAL.twofactor.options.withdraw}
112-
{if $WITHDRAWSENT == 1 && $WITHDRAWUNLOCKED == 1}
115+
{if $GLOBAL.userdata.balance.confirmed|escape < $GLOBAL.config.mp_threshold}
116+
<input type="submit" value="Unlock" class="alt_btn" name="unlock" disabled>
117+
{elseif $WITHDRAWSENT == 1 && $WITHDRAWUNLOCKED == 1}
113118
<input type="submit" value="Cash Out" class="alt_btn">
114119
{elseif $WITHDRAWSENT == 0 && $WITHDRAWUNLOCKED == 1 || $WITHDRAWSENT == 1 && $WITHDRAWUNLOCKED == 0}
115120
<input type="submit" value="Cash Out" class="alt_btn" disabled>

0 commit comments

Comments
 (0)