Class · implements Arrayable
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.
public function setTransactionId(string $transactionId): selfSet the transaction id.
Parameters
| Type | Name | Description |
|---|---|---|
string | $transactionId |
Returns self
public function setAmount(float $amount, ?CurrencyInterface $currency = null): selfThe amount and currency of the transaction as processed.
Parameters
| Type | Name | Description |
|---|---|---|
float | $amount | |
CurrencyInterface|null | $currency |
Returns self
public function setFee(float $fee, ?CurrencyInterface $currency = null): selfA sum of all fees charged against the transaction. The fee can be charged in either the amount or received-amount currency.
Parameters
| Type | Name | Description |
|---|---|---|
float | $fee | |
CurrencyInterface|null | $currency |
Returns $this
public function setMerchantAmount(float $amount, ?CurrencyInterface $currency = null): selfThe 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
| Type | Name | Description |
|---|---|---|
float | $amount | |
CurrencyInterface|null | $currency |
Returns self
public function setType(string $type): selfSet the type of the transaction according to the gateway. Examples include: charge, refund.
Parameters
| Type | Name | Description |
|---|---|---|
string | $type |
Returns self
public function setCurrency(CurrencyInterface $currency): selfParameters
| Type | Name | Description |
|---|---|---|
CurrencyInterface | $currency |
Returns self
public function setFeeCurrency(CurrencyInterface $currency): selfParameters
| Type | Name | Description |
|---|---|---|
CurrencyInterface | $currency |
Returns $this
public function setMerchantCurrency(CurrencyInterface $currency): selfParameters
| Type | Name | Description |
|---|---|---|
CurrencyInterface | $currency |
Returns $this
public function setDescription(string $description): selfSet a description for the transaction.
Parameters
| Type | Name | Description |
|---|---|---|
string | $description |
Returns self
public function setStatus(string $status): selfSet the transaction status.
Parameters
| Type | Name | Description |
|---|---|---|
string | $status |
Returns self
public function setExchangeRate(float $exchangeRate): InformationSet the exchange rate for the transaction.
Parameters
| Type | Name | Description |
|---|---|---|
float | $exchangeRate |
Returns Information
public function setCreated(Carbon $created): selfSet the date that the transaction was created.
Parameters
| Type | Name | Description |
|---|---|---|
Carbon | $created |
Returns self
public function setAvailableOn(Carbon $availableOn): selfSet the date that the transaction will be available on.
Parameters
| Type | Name | Description |
|---|---|---|
Carbon | $availableOn |
Returns self
public function setAdditionalData(array $additionalData): selfSet an array of additional data to be displayed on the transaction information modal.
Parameters
| Type | Name | Description |
|---|---|---|
array | $additionalData |
Returns self
public function setAdditionalDatum(string $key, $value): selfSet a single additional datum to be displayed on the information modal.
Parameters
| Type | Name | Description |
|---|---|---|
string | $key | |
string|float | $value |
Returns self
public function toArray(): arrayObtain all the data provided to the Information class in an array format. Used in the product to populate the modal data.
Returns array
public function addRelatedTransaction(string $identifier, string $type = ''): selfInclude additional transaction identifiers that related to the 'primary' transaction identifier.
Parameters
| Type | Name | Description |
|---|---|---|
string | $identifier | |
string | $type | the same kinds of values provided to setType() |
Returns $this
public function getRelatedTransactions(): arrayReturns object{identifier: — string, type: string}[]