Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

init3DSMethod Request with Timeout - Example

Code Block
languagexml
titleinit3DSMethod with Timeout
<!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>