Version 4.1.19
This commit is contained in:
1 parent
28bd025b35
commit
2bd5025018
2674 files changed
+233518
-77766
No files matched your search
@@ -2,10 +2,10 @@
|
||||
/**
|
||||
* @brief Task to capture payments approaching their authorization deadlines
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage nexus
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Nexus
|
||||
* @since 12 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -39,14 +39,30 @@ 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 )
|
||||
{
|
||||
try
|
||||
if ( $transaction->method )
|
||||
{
|
||||
$transaction->capture();
|
||||
try
|
||||
{
|
||||
$transaction->capture();
|
||||
}
|
||||
catch ( \Exception $e ) {}
|
||||
}
|
||||
catch ( \Exception $e ) {}
|
||||
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, \IPS\Member::loggedIn()->language()->addToStack( 'invalid_gateway', FALSE, array( 'sprintf' => array( $transaction->id ) ) ) );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user