launchUI()
This method launches the SRCi flow.
Usage
SRCi.launchUI(config, payloadCallback, errorCallback, cancelCallback);
Example
var payloadCallback = function (correlationId, scheme) { console.log('Payload callback complete with correlation id %s and scheme %s', correlationId, scheme); }; var errorCallback = function (error) { console.log('Error callback triggered with error ' + error); }; var cancelCallback = function () { console.log('Cancel callback triggered'); }; SRCi.launchUI( { orderAmount: "100.00", orderCurrency: "USD" }, payloadCallback, errorCallback, cancelCallback );
Arguments
config
Object
COMPULSORY
Configuration details required to open an SRC window, with following required and optional parameters.
Fields:
orderAmount String COMPULSORY
Order amount
orderCurrency String COMPULSORY
Order currency
dpaBillingPreference Enumeration OPTIONAL
Billing preference with one of the following values: NONE, FULL, POSTAL_COUNTRY
Existence
OPTIONAL
Validation Rules
NONE
FULL
POSTAL_COUNTRY
collectShippingAddress Boolean OPTIONAL
Shipping preference with one of the following values: true or false. If not provided, the default value is set to false.
Existence
OPTIONAL
Validation Rules
true
false
customerEmail string OPTIONAL
The email address of the customer.
Existence
OPTIONAL
Validation Rules
Ensures that the email address has a valid format.
interactionLocale string OPTIONAL
A language identifier or IETF language tag to control the language of the payment interaction with the payer (e.g. en_US, es, fr-CA).
By default, the language is determined from the payer's browser. Supply a value for this field only if you wish to override the default behavior. If the language you specify is not supported by the gateway, the payment is displayed in the best matching language.
Existence
OPTIONAL
Validation Rules
Data must be a language identifier or IETF language tag.
minimum length
2
maximum length
5
interactionCountry string OPTIONAL
The ISO 3166 alpha-3 country code of the payer's country, to be used to present country-specific content to the payer during the interaction.
For a Secure Remote Commerce interaction, the payer's country is used to present country-specific content such as Terms and Conditions and you only need to provide it, if you wish to override the default payer country you have configured for Secure Remove Commerce interactions.
Existence
OPTIONAL
Validation Rules
Data must consist of the characters A-Z.
minimum length
3
maximum length
3
payloadCallback
Function
COMPULSORY
Callback function triggered when a card is added and selected for either a new or existing user.
errorCallback
Function
COMPULSORY
Callback function triggered due to an error encountered during the loading of SRC window.
cancelCallback
Function
COMPULSORY
Callback function triggered when flow is canceled or SRC window is closed.
Return Value
None