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.

class Information implements Arrayable

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.

Parameters

string $transactionId

Return Value

Information

Information setAmount (float $amount, CurrencyInterface|null $currency = null)

The amount and currency of the transaction as processed.

Parameters

float $amount
CurrencyInterface|null $currency

Return Value

Information

See also

setMerchantAmount()

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.

Parameters

float $fee
CurrencyInterface|null $currency

Return Value

Information

See also

setMerchantAmount()
setAmount()

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.

Parameters

float $amount
CurrencyInterface|null $currency

Return Value

Information

See also

setAmount()

Information setType (string $type)

Set the type of the transaction according to the gateway.

Examples include: charge, refund.

Parameters

string $type

Return Value

Information

Information setCurrency (CurrencyInterface $currency)

Parameters

CurrencyInterface $currency

Return Value

Information

See also

setAmount()

Information setFeeCurrency (CurrencyInterface $currency)

Parameters

CurrencyInterface $currency

Return Value

Information

See also

setFeeAmount()

Information setMerchantCurrency (CurrencyInterface $currency)

Parameters

CurrencyInterface $currency

Return Value

Information

See also

setMerchantAmount()

Information setDescription (string $description)

Set a description for the transaction.

Parameters

string $description

Return Value

Information

Information setStatus (string $status)

Set the transaction status.

Parameters

string $status

Return Value

Information

Information setExchangeRate (float $exchangeRate)

Set the exchange rate for the transaction.

Parameters

float $exchangeRate

Return Value

Information

Information setCreated (Carbon $created)

Set the date that the transaction was created.

Parameters

Carbon $created

Return Value

Information

Information setAvailableOn (Carbon $availableOn)

Set the date that the transaction will be available on.

Parameters

Carbon $availableOn

Return Value

Information

Information setAdditionalData (array $additionalData)

Set an array of additional data to be displayed on the transaction information modal.

Parameters

array $additionalData

Return Value

Information

Information setAdditionalDatum (string $key, string|float $value)

Set a single additional datum to be displayed on the information modal.

Parameters

string $key
string|float $value

Return Value

Information

array toArray ()

Obtain all the data provided to the Information class in an array format. Used in the product to populate the modal data.

Return Value

array

protected string getTransactionId ()

Return Value

string

protected float|null getAmount ()

Return Value

float|null

protected string|null getType ()

Return Value

string|null

protected CurrencyInterface|null getCurrency ()

Return Value

CurrencyInterface|null

protected CurrencyInterface|null getFeeCurrency ()

Return Value

CurrencyInterface|null

protected CurrencyInterface|null getMerchantAmountCurrency ()

Return Value

CurrencyInterface|null

protected string|null getDescription ()

Return Value

string|null

protected string|null getStatus ()

Return Value

string|null

protected float|null getExchangeRate ()

Return Value

float|null

protected string|null getCreated ()

Return Value

string|null

protected string|null getAvailableOn ()

Return Value

string|null

protected float|null getFee ()

Return Value

float|null

protected float|null getMerchantAmount ()

Return Value

float|null

protected array getAdditionalData ()

Return Value

array

Information addRelatedTransaction (string $identifier, string $type = '')

Include additional transaction identifiers that related to the 'primary' transaction identifier.

Parameters

string $identifier
string $type the same kinds of values provided to setType()

Return Value

Information

See also

setTransactionId()
setType()

string __toString ()

Return Value

string