SRCi configure()

configure()

Configuration method for initializing the API. Please note this method should be called only once for the page load. After calling this method, API will provide configuration values as member variables.

Default wsVersion in the absence of a user provided configuration: 76


Usage Copied to clipboard

SRCi.configure(merchantId, merchantName, merchantUrl, sessionId, configuration, callback);


Example Copied to clipboard

SRCi.configure(
    "TESTMERCHANT",
    "Merchant Name",
    "https://www.mysite.com",
    "SESSION0002899787259G30902270H6",
    {
        wsVersion: 76,
        paymentOptions: [response from Payment Options Inquiry],
    },
    function(response) {
        // Handle SRCi.configure() response
    }
);

Arguments Copied to clipboard

merchantId Copied to clipboard String REQUIRED

Merchant's ID

merchantName Copied to clipboard String REQUIRED

Merchant's name

merchantUrl Copied to clipboard String REQUIRED

Merchant's URL

sessionId Copied to clipboard String REQUIRED

Hosted Session ID for the current session.

configuration Copied to clipboard Object

Configuration JSON object that supports data elements; for example, the REST API version or the response from a Payment Options Inquiry (JSON). Note that if you provide the paymentOptions value that includes the Payment Options Inquiry response, you will not have to make an additional WS API PAYMENT_OPTIONS_INQUIRY request.

If you do not include the paymentOptions value in the configuration argument, you must make an additional server side WS API PAYMENT_OPTIONS_INQUIRY request for available payment processing options.

var config = {
    wsVersion: 76,
    paymentOptions: [response from Payment Options Inquiry]
};
        

callback Copied to clipboard Function

Callback function invoked upon completion of the SRCi.configure() method.


Return Value Copied to clipboard

None