Transaction class

The Transaction class represents the details of a transaction, including payment and refund data.

This class is designed to store transaction-related information and provides utilities for serialization and deserialization, as well as creating copies of instances with modified fields.

Constructors

Transaction.new({String? result, String? resultDetails, String? amount, String? callerId, String? nsu, String? nsuLastSuccesfullMessage, String? cvNumber, bool? receiptAlreadyPrinted, String? type, String? brand, String? inputType, String? installments, String? gmtDateTime, String? nsuLocal, String? authorizationCode, String? cardBin, String? cardLastDigits, String? extraScreensResult, String? splitPayloadResponse, String? cardholderName, AutomationSlip? automationSlip, bool? printMerchantPreference, String? orderId, String? pixPayloadResponse, String? refundTransactionDate, String? refundCvNumber, String? refundOriginTerminal})
Constructor for creating a Transaction instance.
Transaction.fromJson(String source)
Deserializes a Transaction instance from JSON.
factory
Transaction.fromMap(Map<String, dynamic> map)
Creates an instance of Transaction from a Map.
factory

Properties

amount String?
The transaction amount as a string.
final
authorizationCode String?
The authorization code for the transaction.
final
automationSlip AutomationSlip?
The automation slip for the transaction, if applicable.
final
brand String?
The brand of the card used in the transaction.
final
callerId String?
The identifier for the caller of the transaction.
final
cardBin String?
The BIN (first digits) of the card used in the transaction.
final
cardholderName String?
The name of the cardholder.
final
cardLastDigits String?
The last digits of the card used in the transaction.
final
cvNumber String?
The control number (CV) of the transaction.
final
extraScreensResult String?
The result of any extra screens shown during the transaction.
final
gmtDateTime String?
The GMT timestamp of the transaction. Date Format (MMDDhhmmss).
final
hashCode int
Generates a hash code for the instance.
no setteroverride
inputType String?
The input type for the transaction (e.g., manual entry, card swipe).
final
installments String?
The number of installments for the transaction.
final
nsu String?
The NSU (Unique Sequential Number) of the transaction.
final
nsuLastSuccesfullMessage String?
The NSU of the last successful message related to the transaction.
final
nsuLocal String?
The local NSU of the transaction.
final
orderId String?
The order ID associated with the transaction.
final
pixPayloadResponse String?
The response payload for a PIX transaction, if applicable.
final
printMerchantPreference bool?
Whether the merchant prefers to print the receipt.
final
receiptAlreadyPrinted bool?
Whether the receipt for the transaction has already been printed.
final
refundCvNumber String?
The control number (CV) for the refund transaction.
final
refundOriginTerminal String?
The origin terminal for the refund transaction.
final
refundTransactionDate String?
The date of the refund transaction.
final
result String?
The result of the transaction.
final
resultDetails String?
Additional details about the transaction result.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
splitPayloadResponse String?
The response from the split payload, if applicable.
final
type String?
The type of the transaction (e.g., credit, debit).
final

Methods

copyWith({String? result, String? resultDetails, String? amount, String? callerId, String? nsu, String? nsuLastSuccesfullMessage, String? cvNumber, bool? receiptAlreadyPrinted, String? type, String? brand, String? inputType, String? installments, String? gmtDateTime, String? nsuLocal, String? authorizationCode, String? cardBin, String? cardLastDigits, String? extraScreensResult, String? splitPayloadResponse, String? cardholderName, AutomationSlip? automationSlip, bool? printMerchantPreference, String? orderId, String? pixPayloadResponse, String? refundTransactionDate, String? refundCvNumber, String? refundOriginTerminal}) Transaction
Creates a copy of the current instance with updated fields.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() String
Serializes the instance to JSON.
toMap() Map<String, dynamic>
Converts the instance to a Map.
toString() String
Returns a string representation of the instance.
override

Operators

operator ==(covariant Transaction other) bool
Compares the current instance with another Transaction instance.
override