PaymentStateDetails

@ObjCName(name = "TeyaPaymentStateDetails", exact = true)
data class PaymentStateDetails(val eposTransactionId: String, val amount: Int, val tip: Int?, val currency: String, val state: PaymentStateSubscription.PaymentState, val inProgressState: PaymentStateSubscription.InProgressState?, val gatewayPaymentId: GatewayPaymentId? = null, val reason: PaymentStateSubscription.PaymentStateReason? = null, val debugErrorMessage: String? = null, val metadata: PaymentStateSubscription.PaymentStateDetails.Metadata? = null, val transactionTimestamp: Long? = null, val wasUnsubscribed: Boolean = false)

Class holding all information about the state of the payment.

Constructors

Link copied to clipboard
constructor(eposTransactionId: String, amount: Int, tip: Int?, currency: String, state: PaymentStateSubscription.PaymentState, inProgressState: PaymentStateSubscription.InProgressState?, gatewayPaymentId: GatewayPaymentId? = null, reason: PaymentStateSubscription.PaymentStateReason? = null, debugErrorMessage: String? = null, metadata: PaymentStateSubscription.PaymentStateDetails.Metadata? = null, transactionTimestamp: Long? = null, wasUnsubscribed: Boolean = false)

Types

Link copied to clipboard

Additional metadata related to the payment, such as card details or response codes. Useful to prepare a consolidated receipt on ePOS side. Available if payment finished successfully.

Properties

Link copied to clipboard
val amount: Int

the final total amount that was charged in minor units. In final successful states, it can be different from the requested one, only if a tip was added in the Payments app.

Link copied to clipboard

the currency of the tip and amount.

Link copied to clipboard

useful for logging and reporting issues with Teya.

Link copied to clipboard

The ePOS id passed in the makePayment call.

Link copied to clipboard

Teya backend id for the payment created. This field will not be null for on PaymentStateSubscription.PaymentState.Successful state.

Link copied to clipboard

more granular state for PaymentState.InProgress main state. Always null for All In One integration. See InProgressState.

Link copied to clipboard

If true, you won't get any more state changes for this payment, the payment has reached a final state.

Link copied to clipboard

Additional metadata related to the payment, such as card details or response codes. Useful to prepare a consolidated receipt on ePOS side. Available if payment finished successfully.

Link copied to clipboard

The reason for the current payment state, if applicable. See PaymentStateReason.

Link copied to clipboard

The current state of the payment, see PaymentState.

Link copied to clipboard
val tip: Int?

the final tip amount in minor units. In final successful states, it can be different from the requested one, only if a tip was added in the Payments app.

Link copied to clipboard

The timestamp (in milliseconds since epoch) when the transaction occurred.

Link copied to clipboard

If true, it means that the listener was unsubscribed from, it serves as a final call to it so that even if you unsubscribe, you'll always get one final call.