Configuration
Configuration of this widget occurs through a configuration options object. See below.
Options Object
The following options are available:
Property | Type | Description |
---|---|---|
orgId | String | Your organization's identifier. |
token | String | Your organization's public authentication token. |
ui.inputStyle | [String] | An array of styles for the inputs. Default is ['outlined']. Use either 'outlined', 'solo', or 'filled'. |
contactEmail | String | A contact email address given to you by Sitata. |
currencyCode | String | The currency that the widget should use as specified in ISO 4217. Default is "USD". |
lang | String | The widget will attempt to determine the user's language automatically. This will force a language selection instead. Use two character languages codes. e.g. 'es' for Spanish. |
noQuoteProcess | String | Values are either: 'assist', 'sitata', or 'plain'. This option tells the widget how to behave if an insurance quote is not possible. Specify 'assist' if you would like to offer your customer's Sitata's Travel Assistance plans without insurance. Specify 'sitata' for an error message and a link back to Sitata. Specify 'plain' for a simple error message and no alternative options for your customer. The default is 'assist'. |
productIds | [String] | A list of product identifiers that you wish to only show during the quote. Hint: Use the human readable identifiers and no the UUIDs to make things easier. |
trip | Trip | Trip object to pre-populate widget with trip cost, itinerary information, and destinations. |
user | User | User object to pre-populate widget with for purchaser info. |
otherTravellers | [Beneficiary ] | List of beneficiaries to pre-populate the widget for additional traveller info. |
departureCountryCode | String | ISO 3166 Alpha 2 character code of the departure country if pre-populating the widget. e.g. "CA" for Canada. |
residentState | String | ISO 3166 character code of regional state of departure. e.g. US-CA for California, United States. |
sessionId | String | A unique identifier (e.g. checkout cart id) for the user for caching purposes |
sessionTimeout | Integer | A threshold number of milliseconds to automatically invalidate the local cache. If it has been longer than the number specified, the cache will clear itself. Only applicable if sessionId is null. Default is 24 hours (in milliseconds). |
forceAbstain | Boolean | When true, the widget will present an explicit content area to ensure the user selects 'I don't want protection'. Default is true. |
showPreExCheck | Booelan | When true, will display a checkbox to force the user to declare if they have pre-existing conditions or not. Default is false. |
preExTitle | String | This title string is shown when the user has selected that they have pre-existing conditions (and hence no quote can be produced). |
preExText | String | This string is shown when the user has selected that they have pre-existing conditions (and hence no quote can be produced). HTML is valid and should be considered to provide a link for an alternative quote process. |
forcedProductIds | [String] | An array of product identifiers to restrict the product selections. You may use the human-readable identifiers. |
Functions
The following functions are available:
Function | Arguments | Description |
---|---|---|
run | () | Initializes the widget. |
isValid | () | Returns true if the widget is in a state that would allow the user to proceed to the next step. i.e. Either no insurance selected, or there is a valid sales quote. |
shouldFetchSalesQuote | () | Returns true if the widget has determined that a Sales Quote should be generated. This is called during onContinue . |
canFetchSalesQuote | () | Returns true if the widget is in a state that is ready to generate a Sales Quote. This is called during onContinue . |
onContinue | () | This function should be used when you are proceeding to the next step in your booking / checkout process. See the next page for details on how to complete the sale. |
Events
The following events are available:
Event | Arguments | Description |
---|---|---|
sitata:inpathInsureReady | () | Fired when the widget is ready for configuration. |
sitata:selectedProducts | (event) | Fired when the use has added or removed a product. Returns the currently selected products list. Each product should have an associated quote under the _quote attribute. |
sitata:customerInfo | (event) | Fired when the user has updated any of the customer information. |
sitata:inpathError | (errorData) | Fired when an error has occurred. |