Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
@@ -125,7 +125,7 @@ class _billingAgreements extends \IPS\Task
|
||||
}
|
||||
$billingAgreement->save();
|
||||
}
|
||||
catch ( \IPS\Http\Exception $e )
|
||||
catch ( \IPS\Http\Url\Exception $e )
|
||||
{
|
||||
/* Just log the issue, but don't do anything here,.. this was probably a temporary issue so let the next call run this again */
|
||||
\IPS\Log::log( $e, 'ba_sync_fail' );
|
||||
|
||||
@@ -38,31 +38,51 @@ class _capture extends \IPS\Task
|
||||
{
|
||||
$taskFrequency = new \DateInterval( $this->frequency );
|
||||
$time = \IPS\DateTime::create()->add( $taskFrequency )->add( $taskFrequency );
|
||||
|
||||
foreach ( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'nexus_transactions', array( 't_auth<?', $time->getTimestamp() ) ), 'IPS\nexus\Transaction' ) as $transaction )
|
||||
|
||||
$this->runUntilTimeout( function() use ( $time )
|
||||
{
|
||||
if ( $transaction->method )
|
||||
try
|
||||
{
|
||||
try
|
||||
$transaction = \IPS\nexus\Transaction::constructFromData( \IPS\Db::i()->select( '*', 'nexus_transactions', array( 't_auth<?', $time->getTimestamp() ), 't_auth ASC', 1 )->first() );
|
||||
|
||||
if ( $transaction->method )
|
||||
{
|
||||
$transaction->capture();
|
||||
try
|
||||
{
|
||||
$transaction->capture();
|
||||
}
|
||||
catch ( \Exception $e )
|
||||
{
|
||||
if ( in_array( $transaction->status, array( $transaction::STATUS_PENDING, $transaction::STATUS_WAITING, $transaction::STATUS_GATEWAY_PENDING ) ) )
|
||||
{
|
||||
$transaction->status = \IPS\nexus\Transaction::STATUS_REFUSED;
|
||||
$extra = $transaction->extra;
|
||||
$extra['history'][] = array( 's' => \IPS\nexus\Transaction::STATUS_REFUSED, 'noteRaw' => $e->getMessage() );
|
||||
$transaction->extra = $extra;
|
||||
}
|
||||
|
||||
$transaction->auth = NULL;
|
||||
$transaction->save();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* the gateway doesn't exist anymore, so reset the auth time */
|
||||
$transaction->auth = NULL;
|
||||
$extra = $transaction->extra;
|
||||
$extra['history'][] = array( 's' => \IPS\nexus\Transaction::STATUS_REFUSED, 'on' => time(), 'noteRaw' => 'invalid_gateway' );
|
||||
$transaction->extra = $extra;
|
||||
$transaction->status = \IPS\nexus\Transaction::STATUS_REFUSED;
|
||||
$transaction->save();
|
||||
|
||||
throw new \IPS\Task\Exception( $this, array( 'invalid_gateway', $transaction->id ) );
|
||||
}
|
||||
catch ( \Exception $e ) {}
|
||||
}
|
||||
else
|
||||
catch ( \UnderflowException $e )
|
||||
{
|
||||
/* the gateway doesn't exist anymore, so reset the auth time */
|
||||
$transaction->auth = NULL;
|
||||
$extra = $transaction->extra;
|
||||
$extra['history'][] = array( 's' => \IPS\nexus\Transaction::STATUS_REFUSED, 'on' => time(), 'noteRaw' => 'invalid_gateway' );
|
||||
$transaction->extra = $extra;
|
||||
$transaction->status = \IPS\nexus\Transaction::STATUS_REFUSED;
|
||||
$transaction->save();
|
||||
|
||||
throw new \IPS\Task\Exception( $this, \IPS\Member::loggedIn()->language()->addToStack( 'invalid_gateway', FALSE, array( 'sprintf' => array( $transaction->id ) ) ) );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -65,9 +65,10 @@ class _supportAutoresolve extends \IPS\Task
|
||||
array( 'r_ar_notify=0' )
|
||||
) );
|
||||
foreach ( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'nexus_support_requests', $warningWhere ), 'IPS\nexus\Support\Request' ) as $request )
|
||||
{
|
||||
$email = \IPS\Email::buildFromTemplate( 'nexus', 'autoresolveWarning', array( $request, \IPS\DateTime::ts( $request->last_reply )->add( new \DateInterval( 'P' . \IPS\Settings::i()->nexus_autoresolve_days . 'D' ) )->relative() ), \IPS\Email::TYPE_TRANSACTIONAL );
|
||||
$email->send( $request->email ?: $request->author() );
|
||||
{
|
||||
$fromEmail = $request->department->email ?: \IPS\Settings::i()->email_out;
|
||||
$email = \IPS\Email::buildFromTemplate( 'nexus', 'autoresolveWarning', array( $request, \IPS\DateTime::ts( $request->last_reply )->add( new \DateInterval( 'P' . \IPS\Settings::i()->nexus_autoresolve_days . 'D' ) ) ), \IPS\Email::TYPE_TRANSACTIONAL );
|
||||
$email->send( $request->email ?: $request->author(), array(), array(), $fromEmail, NULL, array( 'Message-Id' => "<IPS-000-SR{$request->id}.{$request->email_key}-{$fromEmail}>" ) );
|
||||
|
||||
$request->ar_notify = TRUE;
|
||||
$request->save();
|
||||
|
||||
Reference in new issue
Block a user