Information
The information class is used to provide additional data for a transaction from a gateway module.
All set methods can be chained and are optional. We recommend that the transaction id, amount and currency be set as a minimum.
Properties summary
Type | Property | Description | |
---|---|---|---|
protected | $transactionId | ||
protected object{identifier: | $relatedTransactions | ||
string | $type | ||
protected float|null | $amount | ||
protected CurrencyInterface|null | $currency | ||
protected float|null | $fee | ||
protected CurrencyInterface|null | $feeCurrency | ||
protected float|null | $merchantAmount | ||
protected CurrencyInterface|null | $merchantCurrency | ||
protected | $description | ||
protected | $status | ||
protected | $exchangeRate | ||
protected null|Carbon | $created | ||
protected null|Carbon | $availableOn | ||
protected | $additionalData | ||
string | $identifier |
Methods summary
Return Type | Method Name | Description | |
---|---|---|---|
Information | setTransactionId(string $transactionId) | Set the transaction id. | |
Information | setAmount(float $amount, CurrencyInterface|null $currency = null) | The amount and currency of the transaction as processed. | |
Information | setFee(float $fee, CurrencyInterface|null $currency = null) | A sum of all fees charged against the transaction. The fee can be charged in either the amount or received-amount currency. | |
Information | setMerchantAmount(float $amount, CurrencyInterface|null $currency = null) | The amount and currency credited/debited against the merchant's gateway account. | |
Information | setType(string $type) | Set the type of the transaction according to the gateway. | |
Information | setCurrency(CurrencyInterface $currency) | - | |
Information | setFeeCurrency(CurrencyInterface $currency) | - | |
Information | setMerchantCurrency(CurrencyInterface $currency) | - | |
Information | setDescription(string $description) | Set a description for the transaction. | |
Information | setStatus(string $status) | Set the transaction status. | |
Information | setExchangeRate(float $exchangeRate) | Set the exchange rate for the transaction. | |
Information | setCreated(Carbon $created) | Set the date that the transaction was created. | |
Information | setAvailableOn(Carbon $availableOn) | Set the date that the transaction will be available on. | |
Information | setAdditionalData(array $additionalData) | Set an array of additional data to be displayed on the transaction information modal. | |
Information | setAdditionalDatum(string $key, string|float $value) | Set a single additional datum to be displayed on the information modal. | |
array | toArray() | Obtain all the data provided to the Information class in an array format. Used in the product to populate the modal data. | |
string | getTransactionId() | - | |
float|null | getAmount() | - | |
string|null | getType() | - | |
CurrencyInterface|null | getCurrency() | - | |
CurrencyInterface|null | getFeeCurrency() | - | |
CurrencyInterface|null | getMerchantAmountCurrency() | - | |
string|null | getDescription() | - | |
string|null | getStatus() | - | |
float|null | getExchangeRate() | - | |
string|null | getCreated() | - | |
string|null | getAvailableOn() | - | |
float|null | getFee() | - | |
float|null | getMerchantAmount() | - | |
array | getAdditionalData() | - | |
Information | addRelatedTransaction(string $identifier, string $type = '') | Include additional transaction identifiers that related to the 'primary' transaction identifier. | |
string | __toString() | - |
Details
Information
setTransactionId (string $transactionId)
Set the transaction id.
Information
setAmount (float $amount, CurrencyInterface|null $currency = null)
The amount and currency of the transaction as processed.
Information
setFee (float $fee, CurrencyInterface|null $currency = null)
A sum of all fees charged against the transaction. The fee can be charged in either the amount or received-amount currency.
Information
setMerchantAmount (float $amount, CurrencyInterface|null $currency = null)
The amount and currency credited/debited against the merchant's gateway account.
This should differ from the transaction amount due to including the deduction of fees and any necessary currency exchange between the transaction currency and the merchant's gateway account currency.
Information
setType (string $type)
Set the type of the transaction according to the gateway.
Examples include: charge
, refund
.
Information
setCurrency (CurrencyInterface $currency)
Information
setFeeCurrency (CurrencyInterface $currency)
Information
setMerchantCurrency (CurrencyInterface $currency)
Information
setDescription (string $description)
Set a description for the transaction.
Information
setStatus (string $status)
Set the transaction status.
Information
setExchangeRate (float $exchangeRate)
Set the exchange rate for the transaction.
Information
setCreated (Carbon $created)
Set the date that the transaction was created.
Information
setAvailableOn (Carbon $availableOn)
Set the date that the transaction will be available on.
Information
setAdditionalData (array $additionalData)
Set an array of additional data to be displayed on the transaction information modal.
Information
setAdditionalDatum (string $key, string|float $value)
Set a single additional datum to be displayed on the information modal.
array
toArray ()
Obtain all the data provided to the Information class in an array format. Used in the product to populate the modal data.
protected string
getTransactionId ()
protected float|null
getAmount ()
protected string|null
getType ()
protected CurrencyInterface|null
getCurrency ()
protected CurrencyInterface|null
getFeeCurrency ()
protected CurrencyInterface|null
getMerchantAmountCurrency ()
protected string|null
getDescription ()
protected string|null
getStatus ()
protected float|null
getExchangeRate ()
protected string|null
getCreated ()
protected string|null
getAvailableOn ()
protected float|null
getFee ()
protected float|null
getMerchantAmount ()
protected array
getAdditionalData ()
Information
addRelatedTransaction (string $identifier, string $type = '')
Include additional transaction identifiers that related to the 'primary' transaction identifier.