InvoiceService
in package
Table of Contents
- $whmcs_api : IWhmcsHttpClient
- __construct() : mixed
- details() : InvoiceObject
- exists() : bool
- fetchByProductIdAndUserAndStatus() : Collection
- fetchInvoiceStatusById() : string
- Retrieves the invoice status from WHMCS
- store() : InvoiceObject
- update() : InvoiceObject
- updatePaymentMethod() : bool
- Update the paymentMethod of the invoice
Properties
$whmcs_api
protected
IWhmcsHttpClient
$whmcs_api
Methods
__construct()
public
__construct(IWhmcsHttpClient $whmcs_api) : mixed
Parameters
- $whmcs_api : IWhmcsHttpClient
Return values
mixed —details()
public
details(mixed $invoice_id) : InvoiceObject
Parameters
- $invoice_id : mixed
Return values
InvoiceObject —exists()
public
exists(int $invoiceId) : bool
Parameters
- $invoiceId : int
Return values
bool —fetchByProductIdAndUserAndStatus()
public
fetchByProductIdAndUserAndStatus(int $product_id[, int|null $userid = null ][, InvoiceStatus|null $status = null ]) : Collection
Parameters
- $product_id : int
- $userid : int|null = null
- $status : InvoiceStatus|null = null
Return values
Collection —fetchInvoiceStatusById()
Retrieves the invoice status from WHMCS
public
fetchInvoiceStatusById(int $invoiceId) : string
Parameters
- $invoiceId : int
Return values
string —the invoice status
store()
public
store(InvoiceObject $invoiceObject) : InvoiceObject
Parameters
- $invoiceObject : InvoiceObject
Tags
Return values
InvoiceObject —update()
public
update(InvoiceObject $invoiceObject, mixed $id) : InvoiceObject
Parameters
- $invoiceObject : InvoiceObject
- $id : mixed
Tags
Return values
InvoiceObject —updatePaymentMethod()
Update the paymentMethod of the invoice
public
updatePaymentMethod(int $invoiceId, PaymentGateway $paymentGateway) : bool
Parameters
- $invoiceId : int
- $paymentGateway : PaymentGateway