WhmcsManager
extends AbstractExternalSourceManager
in package
Uses
ActivityLogger
Table of Contents
- $errorLogName : string
- $warningLogName : string
- $jobsLogName : string
- The name of the log in which we are going to log actions performed by jobs
- $activityLogName : string
- $microApiToken : string
- $microApiUrl : string
- $paymentMethod : string
- $shouldVerify : bool
- __construct() : mixed
- The service constructor
- fetchCloudUnpaidInvoices() : array<string|int, mixed>
- Fetch all Unpaid cloud related invoices from WHMCS
- fetchInvoiceStatus() : InvoiceStatus
- getCloudProductIds() : array<string|int, mixed>
- Fetch all product id related to Bennu Cloud
- initClient() : PendingRequest
- logEntry() : Activity
- logEntryWithoutModel() : Activity
- logError() : Activity
- logWarning() : Activity
- openUserRequest() : array<string|int, mixed>
- Open a ticket on WHCMS
- postInvoice() : bool
- updateInvoicePaymentMethod() : bool
- Update payment method of invoice
- log() : array<string|int, Activity>
Properties
$errorLogName
public
static string
$errorLogName
= "error"
$warningLogName
public
static string
$warningLogName
= "warning"
$jobsLogName
The name of the log in which we are going to log actions performed by jobs
protected
string
$jobsLogName
= "jobs"
$activityLogName
private
static string
$activityLogName
= "whmcs"
$microApiToken
private
string
$microApiToken
$microApiUrl
private
string
$microApiUrl
$paymentMethod
private
string
$paymentMethod
the payment method of the invoice to created
$shouldVerify
private
bool
$shouldVerify
whether to enforce ssl and tls check
Methods
__construct()
The service constructor
public
__construct() : mixed
Return values
mixed —fetchCloudUnpaidInvoices()
Fetch all Unpaid cloud related invoices from WHMCS
public
fetchCloudUnpaidInvoices() : array<string|int, mixed>
Return values
array<string|int, mixed> —fetchInvoiceStatus()
public
fetchInvoiceStatus(int $invoiceId) : InvoiceStatus
Parameters
- $invoiceId : int
Tags
Return values
InvoiceStatus —getCloudProductIds()
Fetch all product id related to Bennu Cloud
public
getCloudProductIds() : array<string|int, mixed>
Return values
array<string|int, mixed> —id's of Cloud Product on WHMCS
initClient()
public
initClient() : PendingRequest
Return values
PendingRequest —logEntry()
public
static logEntry(Model $model, array<string|int, mixed> $properties, string $description, string $event, string $logName) : Activity
Parameters
- $model : Model
- $properties : array<string|int, mixed>
- $description : string
- $event : string
- $logName : string
Return values
Activity —logEntryWithoutModel()
public
static logEntryWithoutModel(array<string|int, mixed> $properties, string $description, string $event, string $logName) : Activity
Parameters
- $properties : array<string|int, mixed>
- $description : string
- $event : string
- $logName : string
Return values
Activity —logError()
public
static logError(Model $model, array<string|int, mixed> $properties, string $description, string $event) : Activity
Parameters
- $model : Model
- $properties : array<string|int, mixed>
- $description : string
- $event : string
Return values
Activity —logWarning()
public
static logWarning(Model $model, array<string|int, mixed> $properties, string $description, string $event) : Activity
Parameters
- $model : Model
- $properties : array<string|int, mixed>
- $description : string
- $event : string
Return values
Activity —openUserRequest()
Open a ticket on WHCMS
public
openUserRequest(int $user_id, int $dept_id, string $title, string $text) : array<string|int, mixed>
Parameters
- $user_id : int
-
user id
- $dept_id : int
-
department id
- $title : string
-
title of the request
- $text : string
-
message (markdown allowed)
Return values
array<string|int, mixed> —postInvoice()
public
postInvoice(Invoice $invoice) : bool
Parameters
- $invoice : Invoice
Tags
Return values
bool —updateInvoicePaymentMethod()
Update payment method of invoice
public
updateInvoicePaymentMethod(int $invoiceId, string $paymentGateway) : bool
Parameters
- $invoiceId : int
- $paymentGateway : string
Return values
bool —log()
protected
log(Model|array<string|int, mixed> $models, array<string|int, mixed> $properties, string $description[, null $logName = null ]) : array<string|int, Activity>
Parameters
- $models : Model|array<string|int, mixed>
- $properties : array<string|int, mixed>
- $description : string
- $logName : null = null