Version 4.7.13
This commit is contained in:
1 parent
fd22d99e69
commit
7124a02564
954 files changed
+29277
-59308
No files matched your search
@@ -26,6 +26,7 @@ abstract class _Payout extends \IPS\Patterns\ActiveRecord
|
||||
const STATUS_COMPLETE = 'done';
|
||||
const STATUS_PENDING = 'pend';
|
||||
const STATUS_CANCELED = 'canc';
|
||||
const STATUS_PROCESSING = 'wait';
|
||||
|
||||
/**
|
||||
* @brief Multiton Store
|
||||
@@ -318,6 +319,23 @@ abstract class _Payout extends \IPS\Patterns\ActiveRecord
|
||||
{
|
||||
return \IPS\Http\Url::internal( "app=nexus&module=payments&controller=payouts&do=view&id={$this->id}", 'admin' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark the payout as completed.
|
||||
* Moved this out of the controllers because there are times when
|
||||
* the payout may not be processed immediately (e.g. via PayPal batch)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function markCompleted()
|
||||
{
|
||||
$this->status = static::STATUS_COMPLETE;
|
||||
$this->completed = new \IPS\DateTime;
|
||||
$this->save();
|
||||
|
||||
/* Notify member */
|
||||
\IPS\Email::buildFromTemplate( 'nexus', 'payoutComplete', array( $this ), \IPS\Email::TYPE_TRANSACTIONAL )->send( $this->member );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get output for API
|
||||
|
||||
Reference in new issue
Block a user