Transaction

@Serializable
data class Transaction(val paymentTransactionKey: Int? = 0, val transactionId: String, val clientTransactionId: String? = null, val description: String? = null, val cardType: String? = null, val cardHolderName: String? = null, val cardNumberLastFour: String? = null, val paymentMethod: String? = null, val amount: Double = 0.0, val surcharge: Double = 0.0, val currencyCode: String? = null, val transactionDateTime: Instant? = null, val transactionStatus: String? = null, val gatewayResultCode: String? = null, val gatewayResultMessage: String? = null, val message: String? = null, val failureReason: String? = null, val paymentSource: PaymentSource? = null)(source)

Represents a financial transaction, containing detailed information about the payment.

This data class holds all relevant data for a transaction that has been processed, including identifiers, payment details, and status.

Constructors

Link copied to clipboard
constructor(paymentTransactionKey: Int? = 0, transactionId: String, clientTransactionId: String? = null, description: String? = null, cardType: String? = null, cardHolderName: String? = null, cardNumberLastFour: String? = null, paymentMethod: String? = null, amount: Double = 0.0, surcharge: Double = 0.0, currencyCode: String? = null, transactionDateTime: Instant? = null, transactionStatus: String? = null, gatewayResultCode: String? = null, gatewayResultMessage: String? = null, message: String? = null, failureReason: String? = null, paymentSource: PaymentSource? = null)

Properties

Link copied to clipboard

The principal amount of the transaction.

Link copied to clipboard

The name of the cardholder.

Link copied to clipboard

The last four digits of the card number.

Link copied to clipboard

The type of card used for the payment (e.g., "Visa", "MasterCard").

Link copied to clipboard

An optional identifier for the transaction provided by the client.

Link copied to clipboard

The ISO 4217 currency code for the transaction amount (e.g., "USD").

Link copied to clipboard

An optional description for the transaction.

Link copied to clipboard

The reason for the failure of the transaction, if applicable

Link copied to clipboard

The result code from the payment gateway

Link copied to clipboard

The result message from the payment gateway

Link copied to clipboard

The result message of the transaction

Link copied to clipboard

The method of payment used.

Link copied to clipboard

Payment information for the transaction, if available

Link copied to clipboard

The primary key for the payment transaction.

Link copied to clipboard

Any additional surcharge applied to the transaction.

Link copied to clipboard
@Serializable(with = InstantSerializer::class)
val transactionDateTime: Instant?

The date and time when the transaction occurred.

Link copied to clipboard

The unique identifier for the transaction.

Link copied to clipboard

The current status of the transaction (e.g., "Completed", "Pending").

Functions

Link copied to clipboard
fun toJson(): JsonObject

Converts the Transaction object to a JsonObject for API requests.