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.

Usage

Risk.configure(configuration, callback);

Example

Risk.configure({
        merchantId: "TESTMERCHANT",
        sessionId: "SESSION0002899787259G30902270H6",
        apiVersion: 56,
        riskProvider: "NUDETECT"
    },
    function(response) {
        // Handle Risk.configure() response */

        console.log(response.message)
        // Configuration message: 'Risk SDK is configured successfully.'

        console.log(response.status)
        // Configuration status: 'SUCCESS' or 'ERROR'
    }
);
  

Arguments

riskConfig Object COMPULSORY

Configuration values

merchantId String COMPULSORY

Merchant Id

sessionId String COMPULSORY

Identifier of the payment session.

apiVersion Number OPTIONAL

The Web Services API version that you submitted the request in. If not provided, default version is 56.

riskProvider String OPTIONAL

Name of the risk provider. If not provided, SDK will make a PaymentOptionsInquiry call to determine supported risk provider.

callback Function OPTIONAL

Callback function invoked upon completion of the Risk.configure() method. Once the configuration is completed the callback will be invoked with response object as an argument. Object will have message and status properties which will indicate whether configuration was successful or failed due to an error.

Return Value

None

Copyright © 2023 MasterCard