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

Default userLanguage in the absence of a user provided configuration: en-US

Usage

Rupay.configure(rupayConfig)

Example

Rupay.configure({
    merchantId: "TESTMERCHANT",
    sessionId: "SESSION0002899787259G30902270H6",
    containerId: "ABC",
    callback: function() {
        if (Rupay.isConfigured())
            console.log("Done with configure");
    },
    configuration: {
        userLanguage: "en-US",
        wsVersion: 79
    }
});
  

Arguments

rupayConfig Object COMPULSORY

Configuration values

merchantId String COMPULSORY

Merchant Id

sessionId String COMPULSORY

Hosted Session Id created for this session

containerId String OPTIONAL

The <div> id in your html where the API will inject a hidden iframe.

callback Function COMPULSORY

A function that will be invoked once the API has been initialized.

configuration JSON COMPULSORY

JSON value supporting data elements like userLanguage, REST API version (wsVersion)
Fixed value

userLanguage String OPTIONAL

A language identifier or IETF language tag to control the language of the payment page displayed to the payer. For example, "en_US", es, "fr-CA". By default, the language is "en_US".

wsVersion Number COMPULSORY

The Web Services API version that you submitted the request in.

Return Value

None

Copyright © 2023 Mastercard