Page History
...
Пример вызова init3DSMethod
| Code Block | ||||
|---|---|---|---|---|
| ||||
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="nca-3ds-web-sdk.js" type="text/javascript"></script>
<title>Init 3DS Method - Example</title>
</head>
<body>
<!-- The first example shows how to generate a form and attach to an already defined iframe -->
<iframe name="iframeContainer" id="iframe"></iframe>
<!-- In the second example it will generate an iframe and attach to the #frameContainer element -->
<div id="frameContainer"></div>
<script type="text/javascript">
iframe = document.getElementById('iframe');
frameContainer = document.getElementById('frameContainer');
nca3DSWebSDK.init3DSMethod('http://example.com', 'base64-encoded-3dsmethod-request', iframe);
nca3DSWebSDK.createIframeAndInit3DSMethod(
'http://example.com',
'base64-encoded-3dsmethod-request',
'threeDSMethodIFrameContainer',
frameContainer,
() => {
console.log('Iframe loaded, form created and submitted');
}
);
</script>
</body>
</html> |
Пример вызова init3DSMethod с обработкой тайм-аута
| Code Block | ||||
|---|---|---|---|---|
| ||||
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="nca-3ds-web-sdk.js" type="text/javascript"></script>
<title>Init 3DS Method with Timeout - Example</title>
</head>
<body>
<div id="methodFrameWithTimeout"></div>
<script type="text/javascript">
const methodContainer = document.getElementById('methodFrameWithTimeout');
// 3DS Method with 10 second timeout
nca3DSWebSDK.createIframeAndInit3DSMethod(
'http://example.com/3dsmethod',
'base64-encoded-3dsmethod-request',
'methodIFrameTimeout',
methodContainer,
() => {
console.log('3DS Method completed successfully');
},
10, // 10 second timeout
() => {
console.log('3DS Method timed out after 10 seconds');
}
);
</script>
</body>
</html> |
Пример вызова init3DSChallengeRequest
| Code Block | ||||
|---|---|---|---|---|
| ||||
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="nca-3ds-web-sdk.js" type="text/javascript"></script>
<title>Init 3DS Challenge Request - Example</title>
</head>
<body>
<!-- This example will show how to initiate Challenge Reqeuests for different window sizes. -->
<div id="frameContainer05"></div>
<script type="text/javascript">
container05 = document.getElementById('frameContainer05');
nca3DSWebSDK.createIFrameAndInit3DSChallengeRequest(
'http://localhost:8080/acs/challenge',
'base64-encoded-challenge-request',
'05',
'threeDSCReq05',
container05,
() => {
console.log('Iframe loaded, form created and submitted');
}
);
</script>
</body>
</html> |
Пример вызова init3DSChallengeRequest с обработкой тайм-аута
| Code Block | ||||
|---|---|---|---|---|
| ||||
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="nca-3ds-web-sdk.js" type="text/javascript"></script>
<title>Init 3DS Challenge Request with Timeout - Example</title>
</head>
<body>
<div id="challengeFrameWithTimeout"></div>
<script type="text/javascript">
const challengeContainer = document.getElementById('challengeFrameWithTimeout');
// 3DS Challenge with 60 second timeout
nca3DSWebSDK.createIFrameAndInit3DSChallengeRequest(
'http://localhost:8080/acs/challenge',
'base64-encoded-challenge-request',
'03',
'challengeIFrameTimeout',
challengeContainer,
() => {
console.log('Challenge authentication completed successfully');
},
60, // 60 second timeout
() => {
console.log('Challenge authentication timed out after 60 seconds');
}
);
</script>
</body>
</html> |