Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The FlexitiSDK will capture these events and it will send the response through the function handlers defined on the Widget instance creation.

Info

Events will be used to send data from the widget to the Merchant Front-End using the following method and structure.

Code Block
breakoutModewide
languagejs
window.parent.postMessage({
                'eventType': 'flx-success',
                'eventData': {
                    'accountNumber': 2233000 / null
                    'verified': true / false
					'action': Enum [“apply”|“purchase”|“activation”] / null
                }
            }, '*');

...

‘eventType': ‘flx-success’: When the widget ends, after performing all the corresponding customer verification steps related to the flow, it will send the eventData JSON object with the following structure:

Code Block
breakoutModewide
languagejs
'eventData': {
      'accountNumber': 2233000 / null
      'verified': true / false
      'action': Enum [“apply”|“purchase”|“activation”] / null
}
Info

Mandatory: The merchant must call the POST /apply endpoint on a successful widget response on the application flow.

...

'eventType': ‘flx-failure’: To be used for error handling and catching exceptions, it will return the following error structure:

Code Block
breakoutModewide
  {
  'error':HTTP Status Code
  'message': string  //description of the error
  }

...

'eventType': 'flx-cancel': If the customer cancels the flow within the widget, eventData will not be sent. The merchant should handle the cancellation of the flow.

Code Block
breakoutModewide
{
 'eventType': 'flx-cancel'
}

...