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
TeyaPosLinkPaymentInProgressUilistener 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
Listener for payment state changes.
Properties
Returns the current state of the payment. com.teya.unifiedepossdk.PaymentStateDetails
Whether this subscription tracks a payment (money charged to the card) or a refund (money returned to the card). See TransactionType.
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.