Session states & acknowledgements
The APP Prevent session
Section titled “The APP Prevent session”A session is a discrete journey (i.e. an ordered series of interactions with a beginning and end) scoped to a single transaction. Our overview, provides a user’s perspective on the lifecycle of a session. This document provides a developer’s perspective including a full list of possible states, outcomes and hooks.
States
Section titled “States”All sessions will be in one of the following states:
- Open
- Analysing
- Warning
- Resolved
- Failed
States 4 & 5 are terminal (or closed) states and any session in these states
will have a corresponding outcome. Closed sessions will also
have an immutable list of InputScreens and WarningScreens that were shown to
the user. These lists are available earlier in the journey but are guaranteed
not to change once the session is closed.
You can respond programmtically to these states with the following lifecycle hooks:
onOpen: Called when a session is created and first enters theOpenstate.onNewAnalysis: Called when a new analysis is added to a sessiononWarning: Called each time aWarningScreenis presented to the user.onAcknowledgement: Called each time a the user acknowledges aWarningScreen.onResolved: Called when a session completes successfully and enters theResolvedstate.onFailed: Called when a session completes unsuccessfully and enters theFailedstate.
Terminal states
Section titled “Terminal states”Sessions are considered closed and can no longer change once they become either
Resolved or Failed. At this point, the session has an outcome which can be:
Resolved: The session has completed successfully, and the user has acknowledged allWarningScreens.UserError: The user has abandoned the process or provided invalid input.SystemError: An error occurred with the user’s device or within the Tunic Pay service.
Terminal states are available to inspect as part of our supported SDKs. A
successful completion calls the onResolved hooke with information about the
screens presented to the user and their interactions with them; an unsuccessful
session instead calls the onFailed hook and carries additional information
to help continuing app logic to respond. For more information please see the SDK
documentation for your language.
Resolved
Section titled “Resolved”The session is resolved when all Analyses are complete and the customer has
acknowledged all WarningScreens.
This indicates specifically that the customer has provided all requested details
and acknowledged any resulting WarningScreens; it does not indicate whether
the transaction is high/low risk or whether the customer has opted to proceed
with or cancel the transaction.
Failed
Section titled “Failed”The session may end unsuccessfully due to:
UserError:InvalidInput: Invalid input from the userAbandoned: The user’s abandoning of the session
SystemError:SDKError: An error originating on the user’s device (e.g.ENOENTetc.)TPError: An error originating within or due to the remote Tunic Pay system (e.g.500;HOST_UNREACHABLEetc.)
Guarantees Coming Soon
Section titled “Guarantees ”Acknowledgments
Section titled “Acknowledgments”After completing all InputScreens, the user may be presented with one or more
WarningScreens depending on the results of our analyses (cf. example screens).
Each WarningScreen provides the user with the option to either Proceed or
Cancel the transaction.
The user’s intent is recorded as an Acknowledgement on the WarningScreen
with one of the following values:
PROCEEDCANCEL
The session is considered Resolved when the user has either:
- acknowledged all
WarningScreensor - made at least one
CANCELacknowledgement.
There are several scenarios in which we may skip WarningScreen(s) if the user
has already chosen to cancel the transaction and we aim to show the highest
impact WarningScreens first; therefore, a Resolved session may have
unacknowledged WarningScreen(s) if the user has expressed an intention to
cancel the transaction.