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 PaymentStateDetails)
PosLink specifics:
Pass com.teya.unifiedepossdk.poslink.TeyaPosLinkPaymentInProgressUi 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
Enum representing the result of the cancellation attempt.
Represents the result of a payment cancellation attempt.
Enum representing the sub-state for PaymentState.InProgress of the payment. It provides more information about the current in progress payment and what is happening in the Teya payment application.
Enum representing the main state of the payment.
Listener for payment state changes.
Class holding all information about the state of the payment.
Enum representing the reason for the current payment state.
Properties
Returns the current state of the payment. PaymentStateDetails
Functions
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.
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.
Unsubscribes the listener from receiving state change updates.
Calls unsubscribe for all current listeners.