Client-Side Integration
1. Add two JS file references to your web page in your page header:
1
// JS file reference #1:
2
// ----- Staging:
3
<script src="https://songbirdstag.cardinalcommerce.com/cardinalcruise/v1/songbird.js" type="text/javascript"></script>
4
// ----- Production:
5
<script src="https://songbird.cardinalcommerce.com/cardinalcruise/v1/songbird.js" type="text/javascript"></script>
6
// JS file reference #2:
7
<script src="https://cdn.cardknox.com/sdk-3ds/1.0.2110.1401-beta/cardknox-3ds.min.js" type="text/javascript"></script>
Copied!
2. In your page load, add the initialization code:
1
// set up configuration
2
ck3DS.configuration.enableConsoleLogging = true;
3
​
4
// Below can be used to conditionally turn off 3DS handling
5
// ck3DS.configuration.process3DS = true;
6
​
7
// name of function that will post the completed payment request with the verification fields
8
// to the server.
9
// Function will be called with the following parameters:
10
// actionCode, cavv, eciFlag, cardknoxRefNum, authenticateStatus, signatureVerification
11
ck3DS.configuration.onVerifyComplete = _NAME_OF_JS_FUNCTION;
12
​
13
var environment = "staging"; // supported values: staging, production
14
ck3DS.initialize3DS(environment);
Copied!
4. In form submit handler, add this:
1
ck3DS.profileBin(_9_DIGIT_CARD_BIN_HERE_)
2
.then((binProfilingResult) =>
3
{
4
// ...Send the payment request to your server,
5
// including the ck3DS.referenceId and ck3DS.initializeStatus
6
// that will be sent to the Cardknox gateway along with the payment request
7
});
Copied!
5. Handle your server response. If the response from Cardknox had a status of V / Verify, call the verifyTrans function. When 3DS verification is complete, the onVerifyComplete handler will be called with the response fields that should be passed to your server.
1
if (_RESPONSE_OBJ.xRESULT_ === "V") {
2
ck3DS.verifyTrans(_RESPONSE_OBJ);
3
}
Copied!
External documentation: https://kb.cardknox.com/3d-secure/​
Last modified 18d ago
Copy link