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

Existence
OPTIONAL
Validation Rules
NONE
FULL
POSTAL_COUNTRY

collectShippingAddress Boolean OPTIONAL

Existence
OPTIONAL
Validation Rules
true
false

customerEmail string OPTIONAL

Existence
OPTIONAL
Validation Rules
Ensures that the email address has a valid format.

interactionLocale string OPTIONAL

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

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

Copyright © 2023 MasterCard