Skip to main content

Risk control SDK

This SDK collects user device information which will be submitted when orders are created via OpenAPI.

Merchant website access example

Risk control SDK (legacy interface)

<script src="https://ramp.osl-pay.com/js/op-risk.min.js"></script>
<script>
// initialization deviceSessionId & forter token
await OSLPayRisk.init()

// get pay deviceSessionId
OSLPayRisk.getDeviceSessionId()

// get forter token
OSLPayRisk.getForterToken()

// If you have already used the old init API, you can use the following to get error information
OSLPayRisk.getLastErrors()
</script>

Risk control SDK (new version interface, recommended)

<script src="https://ramp.osl-pay.com/js/op-risk.min.js"></script>
<script>
// initialization pay deviceSessionId
async function getDeviceId() {
try {
await OSLPayRisk.initDeviceSession();
const seeId = OSLPayRisk.getDeviceSessionId();
console.log(seeId);
} catch (error) {
console.log(error);
}
}
getDeviceId();

// initialization forter token
async function getToken() {
try {
await OSLPayRisk.initForterToken();
const footId = OSLPayRisk.getForterToken();
console.log(footId);
} catch (error) {
console.log(error);
}
}
getToken();
</script>

If your website has Content Security Policy (CSP) headers set up, allow the following directives:

script-src [...] https://risk.checkout.com;
connect-src [...] https://fpjs.checkout.com https://fpjscache.checkout.com;
frame-src [...] https://risk.checkout.com;

SDK parameters-Functions

Original parameters-Functions

Method nameDescriptionResponse
init()SDK initialization completedundefined
getDeviceSessionId()Obtain "getDeviceSessionId" returned by "checkout"string
getForterToken()Obtain "token" returned by "forter"string

New parameters-Functions

Method nameDescriptionResponse
initDeviceSession()initialization deviceSessionIdstring
initForterToken()initialization forterTokenstring
getLastErrors()Get the error list (structure is described below)Array<ErrorObject>

interface ErrorObject {
  "type": "device" | "forter", // Source of error
  "code": "string", // error.code || "LOAD_FAIL"
  "message": "string",  // Error description
  "stack?": "string",   // Error stack
  "timestamp": number // Occurrence timestamp
}
clearErrors()Clear error logvoid

How was your Reading Experience with us?

footer_logoCopyright
Quadrum Verslo Centra, Konstitucijos pr 21, Vilnius 08130 , Lithuania