Browser Events

The DirectID Widget provides a wide range of events which are accessible by using jQuery. These events allow the host page or application to respond to button presses, stage changes and errors to fully provide for the requirements of your flow.

Listening to these events with jQuery is extremely simple, you do not need to reference jQuery on the page as the DirectID Widget uses its own instance of jQuery in no conflict mode.

The following code snippet demonstrates how to listen for an event:

//Example Listener
DIDjQuery(document).on('<DID Event Name>', function(didEvent, didEventData) {

  didEvent.eventData = didEventData;

  console.log(didEvent);
});

 

WIDGET COMPLETION

It’s possible to detect when the Widget has completed its process successfully by using the ‘complete’ event. For example, you could use this to automatically redirect the user to another page once the process is complete.

//Complete Listener
DIDjQuery(document).on('didFlowComplete', function(didEvent, didEventData) {

  didEvent.eventData = didEventData;

  console.log(didEvent);
});

 

WIDGET ERRORS

It’s possible to detect when the Widget has entered an error state using the ‘fatal_error’ event. This can occur due to a communication error or the user providing incorrect login details too many times. You can use this to move the user to an alternate flow if they are having difficulty completely the DirectID process.

//Error Listener
DIDjQuery(document).on('didFatalError', function(didEvent, didEventData) {

  didEvent.eventData = didEventData;

  console.log(didEvent);
});

 

EVENT REFERENCE

The following table outlines all of the events which the DirectID Widget provides:

FLOW EVENTS

Event Condition Event Data
didInitComplete Widget has intialized None
didStageChangeStart Widget has started changing to a new stage Current stage name, New stage name
didStageChangeComplete Widget has completed stage change Old stage name, New stage name
didInterruptAdded A new stage has been added to the flow Current stage name, Added stage name
didFlowComplete The flow has been completed None
didFlowReset The flow has been reset None

 

BANK AND CREDIT CARD EVENTS

Event Condition Event Data
didProviderLoginFormUpdated A new provider login form has been retrieved  
didProviderLoginFormSubmitted A provider login form has been submitted  
didProviderLoginFormAccepted A provider login form has been accepted  
didProviderLoginProgressUpdate A progress update from the DirectID API  
didProviderLoginSuccess The user’s financial provider has authorized the user’s login details  
didProviderLoginInvalid The user’s financial provider has not authorized the user’s login details  
didProviderLoginReconnectRequested The widget has requested that the DirectID process a login reconnect  
didProviderLoginReconnectSuccess The DirectID API has responded accepted the login reconnect request  
didProviderLoginReconnectError The DirectID API has rejected the login reconnect request  
didPopularProvidersError There was an error get the popular provider list  
didPopularProvidersUpdated The popular provider list was updated  
didBrandsError There was an error getting the favourite brands  
didBrandsUpdated The list of brands was updated from the API  
didBrandLogoError The logo for a brand could not be retrieved brand ID, brand name
didBrandLogoIsEmptyOrNull The logo for a brand was empty or null brand ID, brand name
didSelectedBrandUpdated The logo for a brand was empty or null brand ID, brand name
didBrandProviderApiError There was an error retrieving the account types for the selected brand  
didBrandProviderNotSelectedError The stage was loaded without a brand selected  
didBrandNoAvailableProvidersError No account types were found for the seleced brand brand ID, country code
didSelectedBrandProviderUpdated The account type for the selected brand was successfully updated provider label, provider ID
didAvailableBrandProvidersUpdated The list of account types for the selected brand was updated from the API  
didMfaRequested The user’s financial provider has requested more authentication details  
didMfaFormUpdated An MFA form has been updated  
didMfaCountdownStarted The MFA form countdown has begun startingSeconds: initial countdown length, in seconds.
didMfaCountdownEnded An MFA form countdown has reached 0 (i.e. the form has timed out)  
didAccountSelectionRequested The DirectID API has retrieved an account summary for the user and has requested requested that a user select an account  
didAccountSelectionSuccess An account selection has been successfully made  
didAccountSelectionFailure An account selection  

 

INTERACTION EVENTS

Event Condition Event Data
didCloseLoginHelpModal A user has closed the help modal  
didStartButtonClicked A user has clicked the start button  
didProviderNotFound A provider could not be found for the users search query  
didBrandResultsReturned Brands were successfully returned from the search API search term, number of results
didShowMoreBrandResults The list of brands was paginated by the user pages shown
didBrandNotFound The search term returned no results for the brand search search term
didSearchBrandsAgain The user attempted to search the brands again search term
didProviderSelected A provider has been selected  
didBrandSelected A brand has been selected  
didShowPassword A user has revealed a password in a password input  
didHidePassword A user has hidden a password in a password input  
didVerifyButtonClicked A user has clicked the provider login submit button  
didAccountSelected A user has selected an account  
didMfaSubmitClicked A user has clicked the MFA submit button  
didGotoStageClicked A user has clicked a goto stage button (e.g. “Select Another Bank”)  
didUserAbandoned A user has abandoned the widget flow (e.g. by closing their browser) Current stage name

 

ERROR EVENTS

Event Condition Event Data
didFatalError The widget has encountered a fatal error. The flow will not continue.  
didConfigEndpointFailure The widget has failed to get a configuration information. The flow will not continue.  
didInvalidEvent The widget has tried to trigger and unrecognised event.  

 

CONFIG EVENTS

Event Condition Event Data
didConfigUpdated The configuration has been loaded  
didInvalidFlowConfig The provided configuration is invalid  

 

SESSION EVENTS

Event Condition Event Data
didSessionTokenSet The session token has been set  

 

SIGNALR EVENTS

Event Condition Event Data
didSignalrStateChange SignalR has changed connection state  
didSignalrAccountSelectionRequired The DirectID API has requested Payment Confirmation  
didSignalrErrorToInvalid The DirectID API has attempted to cause the widget to error to an invalid state  
didSignalrInvalidLogin The DirectID API has indicated that the user’s provider login details are incorrect  
didSignalrInvalidMfa The DirectID API has indicated that the user’s provider login details are incorrect  
didSignalrFatalError The DirectID API has indicated that the user cannot continue due to an error  
didSignalrMfaRequired The DirectID API has indicated that an MFA response is required for the user.  
didSignalrProgressUpdate The DirectID API has indicated a progress update.  
didSignalrLoginSuccess The DirectID API has indicated that it has successfully logged into the user’s provider.  
didSignalrDuplicateEvent The DirectID API sent an event which the Widget has already processed. event ID

 

RENDER EVENTS

Event Condition Event Data
didStateRenderRequest Render system has received a request to start rendering a new stage New stage name
didStateRenderStart Render system has started rendering a new stage New stage name
didStateRenderError Render system has encountered an error whilst rendering a stage New stage name
didStateRenderComplete Render system has completed rendering a stage New stage name