Version 4.1.19.4
This commit is contained in:
1 parent
2bd5025018
commit
0dc2aee5ed
312 files changed
+53730
-32118
No files matched your search
@@ -1099,15 +1099,12 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
/* The payment has been approved */
|
||||
if ( $this->invoice->amountToPay()->amount->isZero() )
|
||||
{
|
||||
/* If a guest is checking out, we need to remember that so we can automatically log them in */
|
||||
$isGuest = (bool) !$this->invoice->member->member_id;
|
||||
|
||||
{
|
||||
/* Mark the invoice paid */
|
||||
$extra = $this->invoice->status_extra;
|
||||
$extra['type'] = 'zero';
|
||||
$this->invoice->status_extra = $extra;
|
||||
$this->invoice->markPaid();
|
||||
$memberJustCreated = $this->invoice->markPaid();
|
||||
|
||||
/* Redirect */
|
||||
$destination = $this->invoice->return_uri ?: $this->invoice->url();
|
||||
@@ -1117,9 +1114,9 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $isGuest )
|
||||
if ( $memberJustCreated )
|
||||
{
|
||||
\IPS\Session::i()->setMember( $this->invoice->member );
|
||||
\IPS\Session::i()->setMember( $memberJustCreated );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->redirect( $destination );
|
||||
@@ -1421,7 +1418,7 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
/* Check Fraud Rules and capture */
|
||||
try
|
||||
{
|
||||
$transaction->checkFraudRulesAndCapture( $maxMind );
|
||||
$memberJustCreated = $transaction->checkFraudRulesAndCapture( $maxMind );
|
||||
}
|
||||
catch ( \LogicException $e )
|
||||
{
|
||||
@@ -1437,9 +1434,9 @@ class _checkout extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
/* Logged in? */
|
||||
if ( !\IPS\Member::loggedIn()->member_id and $this->invoice->member->member_id )
|
||||
if ( $memberJustCreated )
|
||||
{
|
||||
\IPS\Session::i()->setMember( $this->invoice->member );
|
||||
\IPS\Session::i()->setMember( $memberJustCreated );
|
||||
}
|
||||
|
||||
/* Send email receipt */
|
||||
|
||||
@@ -425,7 +425,16 @@ class _product extends \IPS\Content\Controller
|
||||
$normalPrice->amount = $normalPrice->amount->add( new \IPS\Math\Number( number_format( $term['cost'][ $memberCurrency ]['amount'], \IPS\nexus\Money::numberOfDecimalsForCurrency( $memberCurrency ), '.', '' ) ) );
|
||||
}
|
||||
|
||||
$return['renewal'] = \IPS\Member::loggedIn()->language()->addToStack( 'and_renewal', FALSE, array( 'sprintf' => array( new \IPS\nexus\Purchase\RenewalTerm( new \IPS\nexus\Money( ( new \IPS\Math\Number( number_format( $term['cost'][ $memberCurrency ]['amount'], \IPS\nexus\Money::numberOfDecimalsForCurrency( $memberCurrency ), '.', '' ) ) )->add( ( new \IPS\Math\Number( number_format( $_data['renewalAdjustment'], \IPS\nexus\Money::numberOfDecimalsForCurrency( $memberCurrency ), '.', '' ) ) ) ), $memberCurrency ), new \DateInterval( 'P' . $term['term'] . mb_strtoupper( $term['unit'] ) ), $package->tax ? \IPS\nexus\Tax::load( $package->tax ) : NULL, $term['add'] ) ) ) );
|
||||
$return['renewal'] = \IPS\Member::loggedIn()->language()->addToStack( 'and_renewal', FALSE, array( 'sprintf' => array(
|
||||
( new \IPS\nexus\Purchase\RenewalTerm(
|
||||
new \IPS\nexus\Money(
|
||||
( new \IPS\Math\Number( number_format( $term['cost'][ $memberCurrency ]['amount'], \IPS\nexus\Money::numberOfDecimalsForCurrency( $memberCurrency ), '.', '' ) ) )
|
||||
->add( ( new \IPS\Math\Number( number_format( $_data['renewalAdjustment'], \IPS\nexus\Money::numberOfDecimalsForCurrency( $memberCurrency ), '.', '' ) ) ) )
|
||||
, $memberCurrency ),
|
||||
new \DateInterval( 'P' . $term['term'] . mb_strtoupper( $term['unit'] ) ),
|
||||
$package->tax ? \IPS\nexus\Tax::load( $package->tax ) : NULL, $term['add']
|
||||
) )->toDisplay()
|
||||
) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user