PaymentStateSubscription

@ObjCName(name = "TeyaPaymentStateSubscription", exact = true)
interface PaymentStateSubscription

PaymentStateSubscription is a handler to a payment which is "in progress". It allows for:

  • subscribing (and unsubscribing) to state changes

  • cancelling the payment (unsupported by some implementations and also best effort, can be ignored by the Teya payment app)

  • get information about the state (see com.teya.unifiedepossdk.PaymentStateDetails)

PosLink specifics:

  • Pass a TeyaPosLinkPaymentInProgressUi listener to the subscribe call to make Teya UI show up while the payment is in progress. You can also use unsubscribe with that same instance to hide the UI, although usually that shouldn't be needed as the UI hides itself after a final state (with some extra configurable delay).

Types

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@ObjCName(name = "TeyaPaymentStateChangeListener", exact = true)
interface PaymentStateChangeListener

Listener for payment state changes.

Link copied to clipboard
Link copied to clipboard

Properties

Link copied to clipboard

Returns the current state of the payment. com.teya.unifiedepossdk.PaymentStateDetails

Link copied to clipboard

Whether this subscription tracks a payment (money charged to the card) or a refund (money returned to the card). See TransactionType.

Functions

Link copied to clipboard
abstract fun cancelPayment(onResult: (CancellationResultInfo) -> Unit)

Cancels the ongoing payment request. This is a best effort call, meaning that the Teya payment app may ignore this request, if, for example, it is too late to cancel it.

Link copied to clipboard

Subscribes the listener to receive state change updates. Some states may be skipped by some implementations, don't assume that you'll get notified for each individual intermediate state.

Link copied to clipboard

Unsubscribes the listener from receiving state change updates.

Link copied to clipboard
abstract fun unsubscribeAll()

Calls unsubscribe for all current listeners.