BalanceInterface
BalanceInterface is used as part of the WHMCS\Module\Gateway\Balance object to ensure that all required methods are present for output.
Utilise the factory method to initialise the BalanceInterface object that will be added to a BalanceCollection object in your custom gateway module.
Methods summary
Return Type | Method Name | Description | |
---|---|---|---|
Price | getAmount() | Get the amount for the BalanceInterface object as a WHMCS\View\Formatter\Price object. | |
string | getColor() | Get the color for the BalanceInterface object. | |
string | getCurrencyCode() | Get the currency code for the BalanceInterface object. | |
Currency|null | getCurrencyObject() | Get the WHMCS\Billing\Currency object for the BalanceInterface object using the currencyCode as the query term. Will return null for an unknown currency. | |
string | getLabel() | Get the label for the BalanceInterface item. This should be the translated value. | |
static BalanceInterface | factory(float $amount, string $currencyCode, string|null $label = null, string|null $color = null) | Initialise the BalanceInterface object providing the data that will be used on output. |
Details
Price
getAmount ()
Get the amount for the BalanceInterface object as a WHMCS\View\Formatter\Price object.
string
getColor ()
Get the color for the BalanceInterface object.
e.g. #5dc560
string
getCurrencyCode ()
Get the currency code for the BalanceInterface object.
Currency|null
getCurrencyObject ()
Get the WHMCS\Billing\Currency object for the BalanceInterface object using the currencyCode as the query term. Will return null for an unknown currency.
string
getLabel ()
Get the label for the BalanceInterface item. This should be the translated value.
static BalanceInterface
factory (float $amount, string $currencyCode, string|null $label = null, string|null $color = null)
Initialise the BalanceInterface object providing the data that will be used on output.