public
|
|
public
|
|
public
|
#
all( mixed $cron_log_group = null )
|
private
|
#
allSystem( )
Runs all system-level cron tasks
Runs all system-level cron tasks
|
public
|
#
createInvoices( string $cron_log_group = null )
Runs the create invoice task
Runs the create invoice task
Parameters
- $cron_log_group
string $cron_log_group The cron log group that this event is apart of (optional,
default null)
|
private
string
|
#
createRecurringInvoices( )
Create all recurring invoices
Create all recurring invoices
Returns
string The output from attempting to create recurring invoices
|
private
string
|
#
createRenewingServiceInvoices( )
Create all renewing service invoices
Create all renewing service invoices
Returns
string The output from attempting to create all renewing service invoices
|
private
array
|
#
buildServiceCouponLineItems( array $services, string $default_currency, array & $coupons )
Retrieves a list of coupons to be applied to an invoice for recurring
services, assumes services given are for a single client only
Retrieves a list of coupons to be applied to an invoice for recurring
services, assumes services given are for a single client only
Parameters
- $services
array $services A list of services whose coupons to fetch
- $default_currency
string $default_currency The ISO 4217 currency code for the client
- $coupons
array $coupons A reference to coupons that will need to be incremented
Returns
array A list of stdClass objects representing coupons to apply to an invoice created
for a recurring service
See
|
public
|
#
applyCredits( string $cron_log_group = null )
Runs the apply credits task
Runs the apply credits task
Parameters
- $cron_log_group
string $cron_log_group The cron log group that this event is apart of (optional,
default null)
|
private
array
|
#
getCreditApplyAmounts( array $client_credits = array(), array $client_invoices = array() )
Creates a list of credits to be applied to invoices for each transaction and
also closes invoices with no amount due
Creates a list of credits to be applied to invoices for each transaction and
also closes invoices with no amount due
Parameters
- $client_credits
array $client_credits A list of client credits grouped by client ID
- $client_invoices
array $client_invoices A list of client credits grouped by client ID
Returns
array A list of credits set to be applied keyed by transaction ID with each containing
a list of amounts: - invoice_id The invoice ID to apply the credit to - amount
The amount to apply to the invoice_id for this particular transaction
See
|
public
|
#
autoDebitInvoices( string $cron_log_group = null )
Runs the autodebit invoices task
Runs the autodebit invoices task
Parameters
- $cron_log_group
string $cron_log_group The cron log group that this event is apart of (optional,
default null)
|
public
|
#
paymentReminders( string $cron_log_group = null )
Runs the payment reminders task
Runs the payment reminders task
Parameters
- $cron_log_group
string $cron_log_group The cron log group that this event is apart of (optional,
default null)
|
private
boolean
|
#
shouldSendReminder( stdClass $invoice, stdClass $client, string $action )
Determines whether or not to send a payment reminder notice for an
invoice
Determines whether or not to send a payment reminder notice for an
invoice
Parameters
- $invoice
stdClass
$invoice An invoice object
- $client
stdClass
$client The client object that the invoice belongs to
- $action
string $action The email notice action
Returns
boolean True if a reminder should be sent out for this invoice, false otherwise
See
|
private
mixed
|
#
sendAutodebitNotice( stdClass $client, stdClass $contact, stdClass $invoice, mixed $autodebit_account = null )
Sends an autodebit notice to the given contact regarding this invoice
Sends an autodebit notice to the given contact regarding this invoice
Parameters
- $client
stdClass
$client The client object
- $contact
stdClass
$contact The contact object representing one of the client's contacts
- $invoice
stdClass
$invoice The invoice to send a payment notice about, belonging to this client
- $autodebit_account
mixed An stdClass object representing the autodebit payment account for this client
(if any) (optional)
Returns
mixed An array of errors on failure, or false on success
See
|
private
mixed
|
#
sendPaymentNotice( string $action, stdClass $client, stdClass $contact, stdClass $invoice, mixed $autodebit_account = null )
Sends a payment notice to the given contact regarding this invoice
Sends a payment notice to the given contact regarding this invoice
Parameters
- $action
string $action The payment notice setting (i.e. one of "notice1", "notice2", "notice3")
- $client
stdClass
$client The client object
- $contact
stdClass
$contact The contact object representing one of the client's contacts
- $invoice
stdClass
$invoice The invoice to send a payment notice about, belonging to this client
- $autodebit_account
mixed An stdClass object representing the autodebit payment account for this client
(if any) (optional)
Returns
mixed An array of errors on failure, or false on success
See
|
public
|
#
cardExpirationReminders( string $cron_log_group = null )
Runs the card expiration reminder task
Runs the card expiration reminder task
Parameters
- $cron_log_group
string $cron_log_group The cron log group that this event is apart of (optional,
default null)
|
public
|
#
deliverInvoices( string $cron_log_group = null )
Runs the deliver invoices task
Runs the deliver invoices task
Parameters
- $cron_log_group
string $cron_log_group The cron log group that this event is apart of (optional,
default null)
|
private
array
|
#
groupInvoices( array $invoices, string $type = null, array $options = null )
Groups invoices into invoice IDs by client and $type
Groups invoices into invoice IDs by client and $type
Parameters
- $invoices
array $invoices A list of stdClass objects representing invoices
- $type
string $type The method to use to group the invoices by client (optional), including: -
delivery_method Group the invoices by client ID and invoice delivery method -
currency Group the invoices by client ID and invoice currency
- $options
array $options A set of options that may be used for some types
Returns
array A list of invoices grouped by client and delivery method
|
private
array
|
#
sendInvoices( array $invoice_ids, stdClass $client, string $delivery_method, string $invoice_status_type = "unpaid" )
Sends a group of invoices to a given client via the delivery method and marks
each invoice delivered
Sends a group of invoices to a given client via the delivery method and marks
each invoice delivered
Parameters
- $invoice_ids
array $invoice_ids A list of invoice IDs belonging to the client
- $client
stdClass
An stdClass object representing the client
- $delivery_method
string $delivery_method The delivery method to send the invoices with
- $invoice_status_type
string $invoice_status_type The invoice status type indicating the type of invoice_ids
given: (optional, default "unpaid") - paid - unpaid
Returns
array An array of errors from attempting to deliver the invoices
|
public
|
#
deliverInvoiceReport( mixed $cron_log_group = null )
|
public
|
#
processRenewingServices( string $cron_log_group = null )
Runs the process renewing services task
Runs the process renewing services task
Parameters
- $cron_log_group
string $cron_log_group The cron log group that this event is apart of (optional,
default null)
|
public
|
#
suspendServices( string $cron_log_group = null )
Runs the suspend services task
Runs the suspend services task
Parameters
- $cron_log_group
string $cron_log_group The cron log group that this event is apart of (optional,
default null)
|
public
|
#
unsuspendServices( string $cron_log_group = null )
Runs the unsuspend services task
Runs the unsuspend services task
Parameters
- $cron_log_group
string $cron_log_group The cron log group that this event is apart of (optional,
default null)
|
public
|
#
cancelScheduledServices( string $cron_log_group = null )
Runs the cancel scheduled services task
Runs the cancel scheduled services task
Parameters
- $cron_log_group
string $cron_log_group The cron log group that this event is apart of (optional,
default null)
|
public
|
#
addPaidPendingServices( string $cron_log_group = null )
Runs the add paid pending services task
Runs the add paid pending services task
Parameters
- $cron_log_group
string $cron_log_group The cron log group that this event is apart of (optional,
default null)
|
public
|
#
updateExchangeRates( string $cron_log_group = null )
Runs the update exchange rates task
Runs the update exchange rates task
Parameters
- $cron_log_group
string $cron_log_group The cron log group that this event is apart of (optional,
default null)
|
public
|
#
pluginTasks( string $cron_log_group = null )
Runs all plugin tasks
Parameters
- $cron_log_group
string $cron_log_group The cron log group that this event is apart of (optional,
default null)
|
public
|
#
cleanLogs( string $cron_log_group = null )
Runs the clean-up logs task
Runs the clean-up logs task
Parameters
- $cron_log_group
string $cron_log_group The cron log group that this event is apart of (optional,
default null)
|
private
|
#
sftpBackup( string $cron_log_group = null )
Runs the sFTP database backup task (system)
Runs the sFTP database backup task (system)
Parameters
- $cron_log_group
string $cron_log_group The cron log group that this event is apart of (optional,
default null)
|
private
|
#
amazonS3Backup( string $cron_log_group = null )
Runs the AmazonS3 database backup task (system)
Runs the AmazonS3 database backup task (system)
Parameters
- $cron_log_group
string $cron_log_group The cron log group that this event is apart of (optional,
default null)
|
private
|
#
license( string $cron_log_group = null )
Runs the system task to call home and validate the license
Runs the system task to call home and validate the license
Parameters
- $cron_log_group
string $cron_log_group The cron log group that this event is apart of (optional,
default null)
|
private
boolean
|
#
isTimeToRun( stdClass $cron_task, boolean $system = false )
Determines whether a cron task is enabled and if it is time for the task to
run or not
Determines whether a cron task is enabled and if it is time for the task to
run or not
Parameters
- $cron_task
stdClass
$cron_task An stdClass object representing the cron task
- $system
boolean $system True if the task is a system-level task, false if it is company-level
(optional, default false)
Returns
boolean True if this cron task can be run, false otherwise
|
private
boolean
|
#
isCurrentDay( integer $day )
Determines whether today is the day of the month given
Determines whether today is the day of the month given
Parameters
- $day
integer $day The day of the month to check (i.e. in range [1,31])
Returns
boolean True if today is the current day given, false otherwise
|
private
mixed
|
#
logTaskStarted( integer $run_id, string $event, string $cron_log_group, string $start_date, string $output = null )
Logs to the cron that a task has started
Logs to the cron that a task has started
Parameters
- $run_id
integer $run_id The run ID of this event
- $event
string $event The event to log
- $cron_log_group
string $cron_log_group The cron log group that this event is apart of
- $start_date
string $start_date The start date of the task in Y-m-d H:i:s format
- $output
string $output The output from running the task (optional)
Returns
mixed An array of errors, or false if there are no errors
|
private
mixed
|
#
logTaskCompleted( integer $run_id, string $event, string $cron_log_group, string $end_date, string $output )
Logs to the cron that a current task has been completed
Logs to the cron that a current task has been completed
Parameters
- $run_id
integer $run_id The run ID of this event
- $event
string $event The event to log
- $cron_log_group
string $cron_log_group The cron log group that this event is apart of
- $end_date
string $end_date The start date of the task in Y-m-d H:i:s format
- $output
string $output The output from running the task
Returns
mixed An array of errors, or false if there are no errors
|
private
string
|
#
createCronLogGroup( )
Creates a cron log group
Returns
string The cron log group
|
private
mixed
|
#
getCronTask( string $cron_task_key, string $plugin_dir = null, boolean $system = false )
Retrieves a cron task
Parameters
- $cron_task_key
string $cron_task_key The cron task key of the cron task to get
- $plugin_dir
string $plugin_dir The directory to the plugin this cron task is associated with
- $system
boolean $system True if the task is a system-level task, false if it is company-level
(optional, default false)
Returns
mixed An stdClass representing the cron task, or false if none exist
|
private
string
|
#
setOutput( string $new, string $old = "", boolean $echo = true )
Sets output data
Parameters
- $new
string $new The new output data
- $old
string $old The old output data, if any (optional, default "")
- $echo
boolean $echo True to output the new text
Returns
string A concatenation of the old and new output
|