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: 79

Usage

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

Example

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

Arguments

merchantId String COMPULSORY

Merchant's ID

merchantName String COMPULSORY

Merchant's name

merchantUrl String COMPULSORY

Merchant's URL

sessionId String COMPULSORY

Hosted Session ID for the current session.

configuration Object OPTIONAL

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: 79,
    paymentOptions: [response from Payment Options Inquiry]
};
        

callback Function OPTIONAL

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

Return Value

None

Copyright © 2023 MasterCard