Merge pull request #1891 from iAmShorty/minimum-payout

[UPDATE] minimum manual payout
This commit is contained in:
Sebastian Grewe 2014-03-05 13:50:43 +01:00
commit f72cdf3842
4 changed files with 16 additions and 1 deletions

7
public/include/config/global.inc.dist.php Normal file → Executable file
View File

@ -77,6 +77,13 @@ $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

2
public/include/pages/account/edit.inc.php Normal file → Executable file
View File

@ -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' => 'info');
} 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' => 'errormsg');
} else {

1
public/include/smarty_globals.inc.php Normal file → Executable file
View File

@ -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']

7
public/templates/mpos/account/edit/default.tpl Normal file → Executable file
View File

@ -89,6 +89,9 @@
<p style="padding-left:3px; padding-redight:30px; font-size:10px;">
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>
</p>
<p style="padding-left:3px; padding-redight:30px; font-size:10px;">
Minimum Cashout: {$GLOBAL.config.mp_threshold} {$GLOBAL.config.currency}
</p>
<fieldset>
<label>Account Balance</label>
{nocache}<input type="text" value="{$GLOBAL.userdata.balance.confirmed|escape}" {$GLOBAL.config.currency} disabled />{/nocache}
@ -109,7 +112,9 @@
<input type="hidden" name="ctoken" value="{$CTOKEN|escape|default:""}" />
<input type="hidden" name="utype" value="withdraw_funds">
{if $GLOBAL.twofactor.enabled && $GLOBAL.twofactor.options.withdraw}
{if $WITHDRAWSENT == 1 && $WITHDRAWUNLOCKED == 1}
{if $GLOBAL.userdata.balance.confirmed|escape < $GLOBAL.config.mp_threshold}
<input type="submit" value="Unlock" class="alt_btn" name="unlock" disabled>
{elseif $WITHDRAWSENT == 1 && $WITHDRAWUNLOCKED == 1}
<input type="submit" value="Cash Out" class="alt_btn">
{elseif $WITHDRAWSENT == 0 && $WITHDRAWUNLOCKED == 1 || $WITHDRAWSENT == 1 && $WITHDRAWUNLOCKED == 0}
<input type="submit" value="Cash Out" class="alt_btn" disabled>