Skip to content

InvoiceDetails class

After the invoice is created, the service returns a JSON object with information about it. For easier handling of the data, the InvoiceDetails class loads the data and provides easy access to the properties.

Class properties

PropertyDescription
$accountAccount identifier
$invoiceInvoice identifier
$createdInvoice creation date
$currencyCurrency abbreviation
$addressThe generated cryptocurrency address to receive a payment from a customer
$expireInvoice expiration time in ISO-8601 format, for example, 2022-02-22T09:00:30
$currencyAmount in the selected currency
$userDataUserData class
$statusInvoice current status
$historyInvoice status change history
$linkbackThe customer will be redirected to this URL after the payment is completed
$callbackUrlCallback URL to receive data about the payment
$invoiceUrlLink to the Apirone invoice web view - apirone.com/invoice

All properties also available via getPropertyName() functions.

Additional methods

MethodDescription
update()Returns updated invoice data from the API
info()Returns public or private invoice info
isExpired()Checks if the invoice has not expired
timeToExpire()Returns the number of seconds until an invoice expires. If the invoice has status paid, overpaid, completed or expired returns -1
showLinkback()*Shows linkback if set and invoice status is paid or overpaid
statusNum()*Returns count of history items. In case when the invoice completed or expired return zero value

* - Used to render the invoice data.

Released under the MIT License.