Version 4.7.13

This commit is contained in:
Neo committed 2025-12-19 16:14:56 -08:00
1 parent fd22d99e69
commit 7124a02564
954 files changed
+29277 -59308

No files matched your search

@@ -56,10 +56,6 @@ class _checkoutsettings extends \IPS\Dispatcher\Controller
{
$requireBillingOptions['donation'] = 'nexus_require_billing_donation';
}
if ( \IPS\Settings::i()->nexus_enom_un and $domainPrices = json_decode( \IPS\Settings::i()->nexus_domain_prices, TRUE ) and \count( $domainPrices ) )
{
$requireBillingOptions['domain'] = 'nexus_require_billing_domain';
}
if ( \IPS\Settings::i()->nexus_subs_enabled and \IPS\Db::i()->select( 'COUNT(*)', 'nexus_member_subscription_packages' )->first() )
{
@@ -89,8 +89,8 @@ class _gateways extends \IPS\Node\Controller
$options = array();
foreach ( \IPS\nexus\Gateway::gateways() as $key => $class )
{
/* Deprecate Authorize.net, don't allow it to be used for new gateways */
if( $key === 'AuthorizeNet' )
/* Deprecate Authorize.net, Braintree and 2Checkout don't allow them to be used for new gateways */
if( \in_array( $key, array( 'AuthorizeNet', 'TwoCheckout', 'Braintree' ) ) )
{
continue;
}
@@ -62,6 +62,7 @@ class _invoices extends \IPS\Dispatcher\Controller
catch ( \OutOfRangeException $e ) { }
}
$table = \IPS\nexus\Invoice::table( $where, $url, 't' );
$table->advancedSearch = array(
'i_id' => \IPS\Helpers\Table\SEARCH_CONTAINS_TEXT,
'i_title' => \IPS\Helpers\Table\SEARCH_CONTAINS_TEXT,
@@ -249,7 +250,7 @@ class _invoices extends \IPS\Dispatcher\Controller
}
}
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate('global', 'core')->decision( 'invoice_paid_trans', array(
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate('global', 'core', 'global')->decision( 'invoice_paid_trans', array(
'invoice_paid_trans_view' => $transUrl,
'invoice_paid_trans_ovrd' => $invoice->acpUrl()->setQueryString( array( 'do' => 'paid', 'override' => 1 ) )->csrf()
) );
@@ -910,7 +911,7 @@ class _invoices extends \IPS\Dispatcher\Controller
$invoice->delete();
/* Redirect */
\IPS\Output::i()->redirect( \IPS\Http\Url::internal('app=nexus&module=payments&controller=invoices') );
\IPS\Output::i()->redirect( \IPS\Http\Url::internal('app=nexus&module=payments&controller=invoices')->getSafeUrlFromFilters() );
}
/**
@@ -141,14 +141,24 @@ class _payouts extends \IPS\Dispatcher\Controller
{
\IPS\Output::i()->error( $e->getMessage(), '1X200/1', 500, '' );
}
$payout->status = $payout::STATUS_COMPLETE;
$payout->processed_by = \IPS\Member::loggedIn();
$payout->save();
\IPS\Session::i()->log( 'acplogs__payout_processed', array( $payout->id => FALSE ) );
$payout->member->log( 'payout', array( 'type' => 'processed', 'amount' => $payout->amount->amount, 'currency' => $payout->amount->currency, 'payout_id' => $payout->id ) );
\IPS\Email::buildFromTemplate( 'nexus', 'payoutComplete', array( $payout ), \IPS\Email::TYPE_TRANSACTIONAL )->send( $payout->member );
/* If the payout was actually completed, notify the user */
if( $payout->status == \IPS\nexus\Payout::STATUS_COMPLETE )
{
$payout->markCompleted();
}
else
{
/* Use task if the payout is pending */
$task = \IPS\Task::load( 'payoutPending', 'key', [ 'app=?', 'nexus' ] );
$task->enabled = TRUE;
$task->save();
}
$this->_redirect( $payout );
}
@@ -179,17 +189,31 @@ class _payouts extends \IPS\Dispatcher\Controller
{
\IPS\Output::i()->error( $e->getMessage(), '1X200/9', 403, '' );
}
$pending = 0;
foreach ( $payouts as $payout )
{
$payout->status = $payout::STATUS_COMPLETE;
$payout->completed = new \IPS\DateTime;
$payout->processed_by = \IPS\Member::loggedIn();
$payout->save();
\IPS\Session::i()->log( 'acplogs__payout_processed', array( $payout->id => FALSE ) );
$payout->member->log( 'payout', array( 'type' => 'processed', 'amount' => $payout->amount->amount, 'currency' => $payout->amount->currency, 'payout_id' => $payout->id ) );
\IPS\Email::buildFromTemplate( 'nexus', 'payoutComplete', array( $payout ), \IPS\Email::TYPE_TRANSACTIONAL )->send( $payout->member );
/* Only do this if the payout is actually complete! */
if( $payout->status == \IPS\nexus\Payout::STATUS_COMPLETE )
{
$payout->markCompleted();
continue;
}
$pending++;
}
/* Use task if there are incomplete payouts */
if( $pending )
{
$task = \IPS\Task::load( 'payoutPending', 'key', [ 'app=?', 'nexus' ] );
$task->enabled = TRUE;
$task->save();
}
\IPS\Output::i()->redirect( \IPS\Http\Url::internal('app=nexus&module=payments&controller=payouts') );
@@ -374,6 +398,12 @@ class _payouts extends \IPS\Dispatcher\Controller
$form->saveAsSettings( $values );
\IPS\Session::i()->log( 'acplogs__payout_settings' );
/* Remove any ACP notifications related to Payout Settings */
foreach( \IPS\nexus\Gateway::payoutGateways() as $key => $class )
{
\IPS\core\AdminNotification::remove( 'nexus', 'ConfigurationError', "po{$key}" );
}
\IPS\Output::i()->redirect( \IPS\Http\Url::internal('app=nexus&module=payments&controller=payouts'), 'saved' );
}
@@ -51,7 +51,7 @@ class _shippingrates extends \IPS\Node\Controller
*/
protected function warning()
{
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core' )->decision( 'ship_rates_' . \IPS\Request::i()->type, array(
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->decision( 'ship_rates_' . \IPS\Request::i()->type, array(
'ship_rates_go_back' => \IPS\Http\Url::internal( 'app=nexus&module=payments&controller=shippingrates&do=form&id=' . \IPS\Request::i()->id ),
'ship_rates_save_anyway' => $this->url,
) );