- ID de exploración:
- 2d9547dd-14d2-4fa2-96b9-db3781de0dadFinalizado
- URL enviada:
- https://pbh.link/f8ohoorRedireccionado
- Informe finalizado:
Enlaces: 0 encontrados
Los enlaces salientes identificados en la página
Variables JavaScript: 76 encontradas
Las variables JavaScript globales cargadas en el objeto de ventana de una página son variables declaradas fuera de las funciones y a las que se puede acceder desde cualquier lugar del código en el ámbito actual
Nombre | Tipo |
---|---|
0 | object |
onbeforetoggle | object |
documentPictureInPicture | object |
onscrollend | object |
$ | function |
jQuery | function |
bootstrap | object |
Popper | function |
ValidateNumber | function |
limit | function |
Mensajes de registro de la consola: 5 encontrados
Mensajes registrados en la consola web
Tipo | Categoría | Registrar |
---|---|---|
warning | other |
|
verbose | dom |
|
error | other |
|
error | other |
|
error | network |
|
HTML
El cuerpo HTML sin procesar de la página
<!DOCTYPE html><html><head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Patient Resource Portal</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css" media="all">
<link rel="stylesheet" href="/Content/css/mobilePayBill/bootstrap.min.css" media="all">
<link rel="stylesheet" href="/Content/css/mobilePayBill/style.css" media="all">
<link rel="stylesheet" href="/Content/css/responsive.css" media="all">
<script src="/Scripts/js/jquery.min.js"></script>
<script src="/Scripts/js/bootstrap.min.js"></script>
<script src="/Scripts/js/popover.js"></script>
<script src="/Scripts/js/popper.min.js"></script>
<script src="/Scripts/js/prc.js"></script>
<script src="/Scripts/jquery-1.11.min.js" type="text/javascript"></script>
<script>
$(document).ready(function () {
$(".hide_show").click(function () {
$(this).toggleClass("left_shift");
var img = $(this).find("img");
if ($(img).attr('src') === "~/images/menu.png") {
$(img).attr('src', "~/images/close.png");
} else {
$(img).attr('src', "~/images/menu.png")
}
$(".left_panel, .right_panel").toggleClass("collaps");
});
});
</script>
<script type="text/javascript" src="https://js.authorize.net/v1/AcceptCore.js"></script><meta http-equiv="origin-trial" id="origin-trial" content="Ayudt5SzRWp86yExqv4T3+PiWzcX+WBtprm+ux6vfIGn5Dg3JSrZL2Y5UkppRzYnVyYzu8hvj+Q4pdGSWsLVYgMAAABgeyJvcmlnaW4iOiJodHRwczovL3BheS5nb29nbGUuY29tOjQ0MyIsImZlYXR1cmUiOiJUcGNkIiwiZXhwaXJ5IjoxNzM1MzQzOTk5LCJpc1RoaXJkUGFydHkiOnRydWV9"><style type="text/css">
.gpay-button {
background-origin: content-box;
background-position: center center;
background-repeat: no-repeat;
background-size: contain;
border: 0px;
border-radius: 4px;
box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 1px 0px, rgba(60, 64, 67, 0.15) 0px 1px 3px 1px;
cursor: pointer;
height: 40px;
min-height: 40px;
padding: 12px 24px 10px;
width: 240px;
}
.gpay-button.black {
background-color: #000;
box-shadow: none;
}
.gpay-button.white {
background-color: #fff;
}
.gpay-button.short, .gpay-button.plain {
min-width: 90px;
width: 160px;
}
.gpay-button.black.short, .gpay-button.black.plain {
background-image: url(https://www.gstatic.com/instantbuy/svg/dark_gpay.svg);
}
.gpay-button.white.short, .gpay-button.white.plain {
background-image: url(https://www.gstatic.com/instantbuy/svg/light_gpay.svg);
}
.gpay-button.black.active {
background-color: #5f6368;
}
.gpay-button.black.hover {
background-color: #3c4043;
}
.gpay-button.white.active {
background-color: #fff;
}
.gpay-button.white.focus {
box-shadow: #e8e8e8 0 1px 1px 0, #e8e8e8 0 1px 3px;
}
.gpay-button.white.hover {
background-color: #f8f8f8;
}
.gpay-button-fill, .gpay-button-fill > .gpay-button.white, .gpay-button-fill > .gpay-button.black {
width: 100%;
height: inherit;
}
.gpay-button-fill > .gpay-button.white,
.gpay-button-fill > .gpay-button.black {
padding: 12px 15% 10px;
}
.gpay-button.donate, .gpay-button.book,
.gpay-button.checkout,
.gpay-button.subscribe, .gpay-button.pay,
.gpay-button.order {
padding: 9px 24px;
}
.gpay-button-fill > .gpay-button.donate,
.gpay-button-fill > .gpay-button.book,
.gpay-button-fill > .gpay-button.checkout,
.gpay-button-fill > .gpay-button.order,
.gpay-button-fill > .gpay-button.pay,
.gpay-button-fill > .gpay-button.subscribe {
padding: 9px 15%;
}
</style><style type="text/css">
.gpay-card-info-container.black,
.gpay-button.black {
outline: 1px solid #757575;
box-shadow: none;
}
.gpay-card-info-container.black.focus,
.gpay-button.black.focus {
outline: 1px auto Highlight;
outline: 1px auto -webkit-focus-ring-color;
box-shadow: none;
}
.gpay-card-info-container.white,
.gpay-button.white {
outline: 1px solid #3C4043;
box-shadow: none;
}
.gpay-card-info-container.white.focus,
.gpay-button.white.focus {
outline: 1px auto Highlight;
outline: 1px auto -webkit-focus-ring-color;
box-shadow: none;
}
</style><style id="apple-pay-btn-font-en-US">@font-face{font-family:apple-pay-btn-en-US;src:url(https://applepay.cdn-apple.com/jsapi/v1.1.0/assets/1.1.0/fonts/en-US.woff2) format("woff2"),url(https://applepay.cdn-apple.com/jsapi/v1.1.0/assets/1.1.0/fonts/en-US.woff) format("woff");font-display:block;}</style></head>
<body class="theme_gradient mobilePayBill" style="">
<script src="/Scripts/jquery-ui-1.9.2.min.js"></script>
<script src="/Scripts/jquery.validate.js" type="text/javascript"></script>
<script src="/Scripts/jquery.validate.unobtrusive.js" type="text/javascript"></script>
<script src="/Scripts/jquery.unobtrusive-ajax.js"></script>
<script src="/Scripts/expressive.annotations.validate.js" type="text/javascript"></script>
<link href="/Content/css/toggle-switch.css" rel="stylesheet">
<style>
#btnApplePay {
width: 150px;
height: 50px;
display: none;
border-radius: 5px;
margin-left: auto;
margin-right: auto;
margin-top: 20px;
background-image: -webkit-named-image(apple-pay-logo-white);
background-position: 50% 50%;
background-color: black;
background-size: 60%;
background-repeat: no-repeat;
}
apple-pay-button {
--apple-pay-button-min-width: 90px;
--apple-pay-button-width: 160px;
--apple-pay-button-min-height: 40px;
--apple-pay-button-height: 40px;
--apple-pay-button-border-radius: 3px;
--apple-pay-button-padding: 0px 0px;
--apple-pay-button-box-sizing: border-box;
}
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none !important;
}
#expMonth {
width: 90px !important;
}
#expYear {
width: 70px !important;
}
</style>
<section class="content ">
<div class="modal fade" id="divVerifyHIPAAPopup" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title fs-title" id="exampleModalLabel">HIPAA Verification</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<form action="/Mobile/VerifyHIPAAOneTime" data-ajax="true" data-ajax-begin="VerifyHIPAAClearResults" data-ajax-method="post" data-ajax-mode="replace" data-ajax-success="VerifyHIPAADataAjaxSuccess" data-ajax-update="#divVerifyHIPAAOnceForm" id="AjaxForm" method="post" role="form" novalidate="novalidate">
<div id="divVerifyHIPAAOnceForm">
<div id="divViewHipaaVerification" class="modal-body">
<div class="form-group" id="divPaymentCode">
<label for="" class="fs-subtitle">Payment Code</label>
<input class="form-control" disabled="true" id="txtHIPAAPaymentCode" name="hipaaModel.PaymentCode" placeholder="Payment Code e.g. 14##########" type="text" value="1441177907027">
</div>
<div class="form-group" id="divDateOfBirth">
<label for="" class="fs-subtitle">Enter Date of Birth</label>
<div class="form-inline">
<input autocomplete="off" class="form-control" data-val="true" data-val-date="The field Date Of Birth must be a date." data-val-required="Please enter Date of Birth." id="txtHIPAADOB" name="hipaaModel.DateOfBirth" placeholder="Enter Date of Birth (MM/DD/YYYY)" type="text" value="" style="display: none;"><span class="combodate"><select class="year form-controlComboDate" style="width: auto;"><option value="">year</option><option value="2024">2024</option><option value="2023">2023</option><option value="2022">2022</option><option value="2021">2021</option><option value="2020">2020</option><option value="2019">2019</option><option value="2018">2018</option><option value="2017">2017</option><option value="2016">2016</option><option value="2015">2015</option><option value="2014">2014</option><option value="2013">2013</option><option value="2012">2012</option><option value="2011">2011</option><option value="2010">2010</option><option value="2009">2009</option><option value="2008">2008</option><option value="2007">2007</option><option value="2006">2006</option><option value="2005">2005</option><option value="2004">2004</option><option value="2003">2003</option><option value="2002">2002</option><option value="2001">2001</option><option value="2000">2000</option><option value="1999">1999</option><option value="1998">1998</option><option value="1997">1997</option><option value="1996">1996</option><option value="1995">1995</option><option value="1994">1994</option><option value="1993">1993</option><option value="1992">1992</option><option value="1991">1991</option><option value="1990">1990</option><option value="1989">1989</option><option value="1988">1988</option><option value="1987">1987</option><option value="1986">1986</option><option value="1985">1985</option><option value="1984">1984</option><option value="1983">1983</option><option value="1982">1982</option><option value="1981">1981</option><option value="1980">1980</option><option value="1979">1979</option><option value="1978">1978</option><option value="1977">1977</option><option value="1976">1976</option><option value="1975">1975</option><option value="1974">1974</option><option value="1973">1973</option><option value="1972">1972</option><option value="1971">1971</option><option value="1970">1970</option><option value="1969">1969</option><option value="1968">1968</option><option value="1967">1967</option><option value="1966">1966</option><option value="1965">1965</option><option value="1964">1964</option><option value="1963">1963</option><option value="1962">1962</option><option value="1961">1961</option><option value="1960">1960</option><option value="1959">1959</option><option value="1958">1958</option><option value="1957">1957</option><option value="1956">1956</option><option value="1955">1955</option><option value="1954">1954</option><option value="1953">1953</option><option value="1952">1952</option><option value="1951">1951</option><option value="1950">1950</option><option value="1949">1949</option><option value="1948">1948</option><option value="1947">1947</option><option value="1946">1946</option><option value="1945">1945</option><option value="1944">1944</option><option value="1943">1943</option><option value="1942">1942</option><option value="1941">1941</option><option value="1940">1940</option><option value="1939">1939</option><option value="1938">1938</option><option value="1937">1937</option><option value="1936">1936</option><option value="1935">1935</option><option value="1934">1934</option><option value="1933">1933</option><option value="1932">1932</option><option value="1931">1931</option><option value="1930">1930</option><option value="1929">1929</option><option value="1928">1928</option><option value="1927">1927</option><option value="1926">1926</option><option value="1925">1925</option><option value="1924">1924</option></select> <select class="month form-controlComboDate" style="width: auto;"><option value="">month</option><option value="0">01 - Jan</option><option value="1">02 - Feb</option><option value="2">03 - Mar</option><option value="3">04 - Apr</option><option value="4">05 - May</option><option value="5">06 - Jun</option><option value="6">07 - Jul</option><option value="7">08 - Aug</option><option value="8">09 - Sep</option><option value="9">10 - Oct</option><option value="10">11 - Nov</option><option value="11">12 - Dec</option></select> <select class="day form-controlComboDate" style="width: auto;"><option value="">day</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option><option value="31">31</option></select> </span>
</div>
<div class="form-group" id="msgDOB" style="display:none;">
<span class="field-validation-valid" data-valmsg-for="hipaaModel.DateOfBirth" data-valmsg-replace="true"></span>
</div>
<div>
<span id="comboDateErrorMsg" class="field-validation-error" style="display:none; width:100%;">Please enter a valid date</span>
</div>
</div>
<div class="form-group" id="divLast4ofSS">
<label for="" class="fs-subtitle">Enter Last 4 SS</label>
<input autocomplete="off" class="form-control" data-val="true" data-val-number="The field Last 4 of SS must be a number." data-val-required="Please enter Last 4 of SS." id="txtHIPAALast4ofSS" maxlength="4" name="hipaaModel.Last4ofSS" onkeypress="return ValidateNumber(event);" placeholder="Enter Last 4 SS" type="text" value="">
<div class="form-group" id="msgL4ss" style="display:none;">
<span class="field-validation-valid" data-valmsg-for="hipaaModel.Last4ofSS" data-valmsg-replace="true"></span>
</div>
</div>
<label for="" class="field-validation-error lblHIPAAErrorMessage" style="padding-left: 10px;"></label>
<input id="hidSubdomain" name="mobileModel.PracticeSubDomain" type="hidden" value="OVA">
<div class="modal-footer">
<button type="submit" class="btn-primary" id="btnHIPAASubmitButton" onclick="return validateComboDate();">Submit</button>
</div>
</div>
<div id="divViewStatementOptions" class="modal-body" style="display:none;">
<br>
<div style="margin-left:auto; margin-right:auto; width:90%; text-align:center;">
<h5 class="text-center mt-4" style="color:black;">
<span>HIPAA Verification Successful!</span>
</h5>
<div style="clear:both; margin-top:20px;">
<a id="viewStmtLink" href="#" target="_blank" class="btn-secondary" style="display:none;">View Statement</a>
</div>
</div>
<br>
</div>
</div>
<script src="/Scripts/expressive.annotations.validate.js" type="text/javascript"></script>
<script src="/Content/ComboDate/combodate.js" type="text/javascript"></script>
<script src="/Content/ComboDate/moment.min.js" type="text/javascript"></script>
<link href="/Content/ComboDate/ComboDate.css" rel="stylesheet">
<script src="/Content/BootstrapDatePicker/bootstrap-datepicker.js"></script>
<link href="/Content/BootstrapDatePicker/Datepicker.css" rel="stylesheet">
<script type="text/javascript">
//set the combodate control
var datefield = document.getElementById("txtHIPAADOB");
datefield.setAttribute("type", "text");
$('input[id$=txtHIPAADOB]').combodate({
firstItem: 'name', // show headers within drop downs
customClass: 'form-controlComboDate' // set class for visual formatting of drop downs. must do so here.
//value: '01-01-2019' // set the default date selected
});
function validateComboDate() {
// should either be blank for populated with a full date.
var datefield = document.getElementById("txtHIPAADOB");
$("#msgDOB").hide();
$("#comboDateErrorMsg").hide();
if (datefield.value == '') {
$("#msgDOB").show();
$("#comboDateErrorMsg").show();
return false;
}
return true;
};
////set the bootstrap control
//var datefield = document.getElementById("txtHIPAADOB");
//datefield.setAttribute("readonly", "true");
//$('input[id$=txtHIPAADOB]').datepicker({
// format: 'mm/dd/yyyy',
// startView: 2, // start calendar in year selection first
// startDate: '-100y', // set min date range as 100 years ago
// endDate: '+0d', // set max date range as today
// autoclose: true, // close the calendar on date select
// defaultViewDate: '-50y' // set starting calendar date as 50 years ago
//});
</script>
<script>
function VerifyHIPAADataAjaxSuccess() {
$('#btnHIPAASubmitButton').html('Submit');
if ('' != "Error") {
//------- On success, hide the data entry fields and just show the link to open/view statement
$("#divPaymentCode").hide();
$("#divDateOfBirth").hide();
$("#divLast4ofSS").hide();
$('#btnHIPAASubmitButton').hide();
$("#viewStmtLink").css('display', 'initial');
$("#divViewHipaaVerification").hide();
$("#divViewStatementOptions").css('display', 'initial');
document.getElementById("viewStmtLink").href = "../Mobile/ViewOneTimeStatement/?fp=" + "";
}
else {
$("#txtHIPAAPaymentCode-error").text("");
$("#divDateOfBirth").hide();
$("#divLast4ofSS").hide();
$("#msgDOB").hide();
$("#msgL4ss").hide();
if (resultDOB == "1") {
$("#divDateOfBirth").show();
$("#msgDOB").show();
}
if (resultLast4SS == "1") {
$("#divLast4ofSS").show();
$("#msgL4ss").show();
}
}
}
function VerifyHIPAAClearResults() {
$('#btnHIPAASubmitButton').html('<i class="fa fa-spinner fa-spin"></i> Processing..');
}
//$('.prev i').removeClass();
//$('.prev i').addClass("fa fa-chevron-left");
//$('.next i').removeClass();
//$('.next i').addClass("fa fa-chevron-right");
//$(".datepicker").on("blur", function (e) {
// var isValidDate = validateDate(e.target.value);
// if (!isValidDate) {
// $(this).closest('#divDateOfBirth').find('span.field-validation-valid').addClass('field-validation-error');
// $(this).closest('#divDateOfBirth').find('span.field-validation-valid').html('Please enter a valid date format');
// }
// else {
// $(this).closest('#divDateOfBirth').find('span.field-validation-valid').html('');
// }
//});
function validateDate(dateValue) {
var selectedDate = dateValue;
if (selectedDate == '')
return false;
var regExp = /^(\d{1,2})(\/|-)(\d{1,2})(\/|-)(\d{4})$/; //Declare Regex
var dateArray = selectedDate.match(regExp); // is format OK?
if (dateArray == null) {
return false;
}
month = dateArray[1];
day = dateArray[3];
year = dateArray[5];
if (month < 1 || month > 12) {
return false;
} else if (day < 1 || day > 31) {
return false;
} else if ((month == 4 || month == 6 || month == 9 || month == 11) && day == 31) {
return false;
} else if (month == 2) {
var isLeapYear = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
if (day > 29 || (day == 29 && !isLeapYear)) {
return false
}
}
return true;
}
</script><input id="hidOneTimePaymentCode" name="hipaaModel.PaymentCode" type="hidden" value="1441177907027"></form> </div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-6 offset-md-3">
<div class="text-center mt-4">
<a class="btnVerifyHIPAAData btn-secondarylight" data-toggle="modal" id="btnViewStatement" data-target="#divVerifyHIPAAPopup" href="javascript:;" vspaymentcode="1441177907027" dob="1" last4ss="0" hipaatype="STATEMENT" title="view statement">
<i class="fa fa-eye"></i>
<span>Click to View Statement</span>
</a>
</div>
<h1 class="text-center mt-5">OrthoVirginia</h1>
<!-- multistep form -->
<form id="msform" novalidate="novalidate">
<!-- progressbar -->
<ul id="progressbar">
<li class="step step-1 active" step_no="1"><a href="#">Review</a></li>
<li class="step step-2" data_txt="isDisabled" step_no="2"><a href="#">Pay</a></li>
<li class="step step-3" data_txt="isDisabled" step_no="3"><a href="#">Receipt</a></li>
</ul>
<!-- fieldsets -->
<fieldset class="steps" id="step-1">
<p class="mt-1">Payment Code : <strong>1441177907027</strong></p>
<h3 class="fs-subtitle mb-4">Balance Due : <strong>$38.80</strong></h3>
<h2 class="fs-title"> <lable id="payAmountLable">$38.80</lable> </h2>
<input value="38.8" class="form-control groupOfTexbox" id="txtPaymentAmount" name="TotalRemainingBalance" placeholder="Enter amount" type="hidden">
<span class="field-validation-error" id="err_txtPaymentAmount"></span>
<a href="javascript:;" class="edit-link editAmount">Edit Amount</a>
<p class="mt-3">for <br><strong>OrthoVirginia</strong></p>
<noscript>
<style type="text/css">
.javascriptDisabled {
display: none;
}
</style>
<div class="noscriptmsg">
Javascript is disabled, to pay by Phone 1-855-829-0149.
</div>
</noscript>
<div class="javascriptDisabled">
<a href="javascript:;" class="btn mt-3 btn-block btn-primary btn-login next_step" data-cnt="step-2" id="paybillcreditcard">Pay Now</a>
</div>
</fieldset>
<fieldset class="steps" id="step-2" style="display: none;">
<h3 class="fs-subtitle mt-0 mb-4 pull-left text-left">
<small class="very-sml">Payment Amount:</small><br>
<strong id="spnDisplayPaymentAmount" style="color:#000; font-size: 20px;">0</strong>
</h3>
<h3 class="fs-subtitle mt-0 mb-4 pull-right text-right">
<small class="very-sml">Payment Code:</small><br>
<strong id="" style="color:#000; font-size: 20px;"><span id="spnDisplayPaymentCode">1441177907027</span></strong>
</h3>
<input id="hidCustomerProfileID" name="mobileModel.CustomerProfileID" type="hidden" value="674535316">
<input data-val="true" data-val-number="The field PracticeId must be a number." data-val-required="The PracticeId field is required." id="hidPracticeID" name="mobileModel.PracticeId" type="hidden" value="2503">
<input id="hidPracticeName" name="mobileModel.PracticeName" type="hidden" value="OrthoVirginia">
<input id="hidPaymentCode" name="mobileModel.PaymentCode" type="hidden" value="1441177907027">
<input id="hidHistoryCode" name="mobileModel.HistoryCode" type="hidden" value="18316555">
<div class="clearfix"></div>
<div class="d-flex form-height">
<div class="col-lg-12 grey-bg" style="padding: 0;">
<div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical">
<a class="nav-link active d-flex justify-content-between align-items-center" id="v-pills-credit-tab" data-toggle="pill" href="#v-pills-credit" role="tab" aria-controls="v-pills-credit" aria-selected="true"><img src="/Content/images/card-icon.png" class="" width="40"></a>
<a class="nav-link d-flex justify-content-between align-items-center" id="v-pills-bank-tab" data-toggle="pill" href="#v-pills-bank" role="tab" aria-controls="v-pills-bank" aria-selected="false"><img src="/Content/images/bank-logo.png" class="" width="40"></a>
<a class="nav-link d-flex justify-content-between align-items-center" id="v-pills-google-tab" data-toggle="pill" href="#v-pills-google" role="tab" aria-controls="v-pills-google" aria-selected="false"> <img src="/Content/images/google-pay-logo.png" class="" height="40"></a>
<div id="divAppleTab" style="display: none;">
<a class="nav-link d-flex justify-content-between align-items-center" id="v-pills-apple-tab" data-toggle="pill" href="#v-pills-apple" role="tab" aria-controls="v-pills-apple" aria-selected="false"><img src="/Content/images/apple-pay-logo.png" class="" height="40"></a>
</div>
</div>
</div>
<div class="col-lg-12 text-left">
<div id="v-pills-tabContent" class="payment_options tab-content">
<div class="tab-pane fade show active" id="v-pills-credit" role="tabpanel" aria-labelledby="v-pills-home-tab">
<div class="mt-4">
<div class="col-md-12 labelCheckCard" style="display: none;">
<div class="row">
<a href="javascript:;" class="v-sml-btn mt-4 mb-4 show_card_fields">Pay with new card</a>
</div>
</div>
<div class="col-md-12 existing_card_dtl">
</div>
<div class="add_card_dtl row">
<div class="col-md-12">
<div class="form-group">
<label for="">Card Number</label>
<!-- <p class="log"></p> -->
<input class="form-control default card_pay" id="cardNumber" name="CardNumber" onkeydown="if(this.value.length==16 && event.keyCode!=8 && event.keyCode!=9 && event.keyCode!=37 && event.keyCode!=39 && event.keyCode!=35 && event.keyCode!=36 && event.keyCode!=46 || (event.keyCode===40 || event.keyCode===38)) return false;" onkeypress="return onlyNumeric(event)" placeholder="XXXX-XXXX-XXXX-XXXX" type="number" value="">
<span class="field-validation-error" id="err_cardNumber"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="">Name on Account</label>
<input class="form-control" id="txtCardNameOnAccount" name="CardNameOnAccount" onkeypress="return onlyAlphabets(event);" placeholder="John Doe" type="text" value="">
<span class="field-validation-error" id="err_cardNameOnAccount"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="">Billing Zip Code</label>
<input class="form-control" id="txtCardBillingZipCode" maxlength="5" minlength="5" name="CardBillingZipCode" onkeydown="if(this.value.length==5 && event.keyCode!=8 && event.keyCode!=9 && event.keyCode!=37 && event.keyCode!=39 || (event.keyCode===40 || event.keyCode===38)) return false;" onkeypress="return onlyNumeric(event)" placeholder="12345" type="number" value="">
<span class="field-validation-error" id="err_cardBillingZipCode"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="">Expiration Date</label>
<div class="row">
<div class="col-6">
<select class="form-control" id="expMonth" name="CardExpirationMonth"><option value="">Month</option>
<option value="01">01 - Jan</option>
<option value="02">02 - Feb</option>
<option value="03">03 - Mar</option>
<option value="04">04 - Apr</option>
<option value="05">05 - May</option>
<option value="06">06 - Jun</option>
<option value="07">07 - Jul</option>
<option value="08">08 - Aug</option>
<option value="09">09 - Sep</option>
<option value="10">10 - Oct</option>
<option value="11">11 - Nov</option>
<option value="12">12 - Dec</option>
</select>
<span class="field-validation-error" id="err_expMonth"></span>
</div>
<div class="col-6">
<select class="form-control" id="expYear" name="CardExpirationYear"><option value="">Year</option>
<option value="2024">2024</option>
<option value="2025">2025</option>
<option value="2026">2026</option>
<option value="2027">2027</option>
<option value="2028">2028</option>
<option value="2029">2029</option>
<option value="2030">2030</option>
<option value="2031">2031</option>
<option value="2032">2032</option>
<option value="2033">2033</option>
<option value="2034">2034</option>
</select>
<span class="field-validation-error" id="err_expYear"></span>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="">
CVV
<span class="rounded-circle where_find">? <img src="/Content/images/cvv-card.png" class="d-none" alt="cvv-card"></span>
</label>
<input class="form-control" id="cardCode" maxlength="3" name="CardCVV" onkeypress="return onlyNumeric(event)" placeholder="e.g. 123" type="password" value="">
<span class="field-validation-error" id="err_cardCode"></span>
</div>
</div>
<div class="col-md-12 margin-top-10 mb-3">
<div class="form-group">
<label class="checkbox_container">
<span>Save this card for future use</span>
<input type="checkbox" id="creditCardCheck" checked="checked">
<span class="checkmark"></span>
</label>
</div>
</div>
<div class="col-md-12 text-right">
<a href="javascript:;" class="btn btn-login next_step btn-block btn-primary mb-5 sendPaymentDataToAnet creditCardSend" data-cnt="step-3">Pay <span id="spnPayAmountDisplay">$1,023.06</span></a>
</div>
</div>
<div id="error-message"></div>
</div>
</div><!-- /credit -->
<div class="tab-pane fade" id="v-pills-bank" role="tabpanel" aria-labelledby="v-pills-profile-tab">
<div class="row mt-4">
<div class="col-md-12 labelCheckBank" style="display: none;">
<a href="javascript:;" class="v-sml-btn mt-4 mb-4 show_bank_fields">Pay with new bank account</a>
</div>
<div class="col-md-12 existing_bank_dtl">
</div>
<div class="col-md-12">
<div class="add_bank_dtl row">
<div class="col-md-6">
<div class="form-group">
<label for="">Bank Name</label>
<input class="form-control" id="bankName" name="BankName" onkeypress="return onlyAlphabets(event);" placeholder="Enter Bank Name" type="text" value="">
<span class="field-validation-error" id="err_bankName"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="">Name on Account</label>
<input class="form-control" id="nameOnAccount" name="BankNameOnAccount" onkeypress="return onlyAlphabets(event);" placeholder="Enter Name on Account" type="text" value="">
<span class="field-validation-error" id="err_nameOnAccount"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="">Account Number</label>
<input class="form-control" id="accountNumber" name="BankAccountNumber" onkeydown="if(this.value.length==16 && event.keyCode!=8 && event.keyCode!=9 && event.keyCode!=37 && event.keyCode!=39 || (event.keyCode===40 || event.keyCode===38)) return false;" onkeypress="return onlyNumeric(event)" placeholder="Enter Account Number" type="number" value="">
<span class="field-validation-error" id="err_accountNumber"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="">ABA Routing Number</label>
<input class="form-control" id="routingNumber" name="BankABARoutingNumber" placeholder="Enter ABA Routing Number" type="text" value="">
<span class="field-validation-error" id="err_routingNumber"></span>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label for="">Account Type</label>
<select class="chosen form-control" name="faculty" id="accountType">
<option value="">Select Bank Account Type</option>
<option value="Savings">Savings </option>
<option value="Checking">Checking </option>
</select>
<span class="field-validation-error" id="err_accountType"></span>
</div>
</div>
<div class="col-md-12 mt-3">
<div class="form-group">
<label class="checkbox_container">
<span>Save this bank account information for future use</span>
<input type="checkbox" id="bankCardCheck" checked="checked">
<span class="checkmark"></span>
</label>
</div>
</div>
<div class="col-md-12 text-right">
<a href="javascript:;" class="btn btn-block btn-primary btn-login next_step mb-5 sendPaymentDataToAnet bankAccountSend" data-cnt="step-3">Pay $1,023.06</a>
</div>
</div>
</div>
</div>
</div><!-- /bank -->
<div class="tab-pane fade" id="v-pills-google" role="tabpanel" aria-labelledby="v-pills-settings-tab">
<div class="merchant-note text-center">
<p id="lblGooglePay">Use the button below to Pay with GooglePay, please do not refresh or close the page.</p>
<div id="btnGooglePay"><div><button type="button" aria-label="Google Pay" class="gpay-button black short en" id="gpay-button-online-api-id"></button></div></div><br>
</div>
</div><!-- /Google Pay -->
<!-- /Apple Pay -->
<div class="tab-pane fade" id="v-pills-apple" role="tabpanel" aria-labelledby="v-pills-settings-tab">
<div class="merchant-note text-center">
<p>Use the button below to Pay with Apple Pay, please do not refresh or close the page.</p>
<div class="d-flex justify-content-center mb-1">
<apple-pay-button buttonstyle="black" type="plain" locale="en-US" id="applePay" aria-hidden="true" hidden="" disabled="" lang="en-US"></apple-pay-button>
</div>
<p style="display:none" id="got_notactive">ApplePay is possible on this browser, but not currently activated.</p>
<p style="display:none" id="appleSuccess">Test transaction completed, thanks. <a href="<?=$_SERVER[" script_url"]?="">">reset</a></p>
</div>
</div>
<!-- /Apple Pay -->
</div>
</div>
</div>
</fieldset>
<fieldset class="steps" id="step-3" style="display: none;">
<input id="hidResponse" name="hidResponse" type="hidden" value="">
<img src="/Content/images/payment-success.png" width="80">
<h4 class="mt-4">
Payment Successful
</h4>
<p class="mt-2 opaq">If you require a receipt, please enter your e-mail address below and click Send Receipt.</p>
<p><strong class="authorization_code"></strong></p>
<input type="text" name="EmailReceipt" placeholder="Enter your e-mail address" id="PREmailId">
<span id="err_PRerror" class="field-validation-error"></span>
<a class="submit btn mt-3 btn-block btn-primary mb-3" id="SendReceipt">Send Receipt</a>
</fieldset>
<div class="balanceNoteContainer">
<span class="opaq balanceNote">**Any account(s) sent to collections will not reflect in the current balance due. If you have any questions, please call 888-224-0273**</span>
</div>
<div class="balanceNoteContainer">
<p>
<a href="javascript:;" id="privacy-policy" onclick="window.open('https://millenniapay.com/privacy-policy/', '_blank').focus();">
Privacy Policy
</a>
</p>
</div>
</form>
</div>
</div>
</div>
</section>
<div class="varification forgot" id="hipaaverificationpopup" style="display:none;">
<div class="varificaiton__overlay"></div>
<div class="varificaiton__content text-center forgot">
<p>We apologize that the statement for this payment code is not available at the moment.</p>
<div>
<a href="javascript:;" class="btn btn-login btn-primary mt-4" id="vhclose">Close</a>
</div>
</div>
</div>
<div class="varification forgot" id="emailsentpopup" style="display:none;">
<div class="varificaiton__overlay"></div>
<div class="varificaiton__content text-center forgot">
<p>E-mail sent successfully.</p>
<div>
<button type="button" class="btn btn-login btn-primary mt-4" id="closemodal">Close</button>
</div>
</div>
</div>
<div class="varification forgot" id="errorpopup" style="display:none;">
<div class="varificaiton__overlay"></div>
<div class="varificaiton__content text-center forgot">
<p>We apologize that the email was not sent due to some reason. Please try again.</p>
<div>
<a href="javascript:;" class="btn btn-login btn-primary mt-4" id="vherrorclose">Try again</a>
</div>
</div>
</div>
<script type="text/javascript" src="https://js.authorize.net/v1/Accept.js" charset="utf-8"></script>
<script src="/Scripts/js/jquery.creditCardValidator.js"></script>
<script>
$(document).on("click", ".btnVerifyHIPAAData", function () {
$("#txtHIPAAPaymentCode").val("");
$("#txtHIPAADOB").val("");
$("#txtHIPAALast4ofSS").val("");
$("#btnHIPAASubmitButton").show();
$(".lblErrorMessage").text("");
if ($("#diverror").length) {
$("#diverror").removeClass("alert alert-danger");
}
resultDOB = $(this).attr("DOB");
resultLast4SS = $(this).attr("Last4SS");
resultPaymentCode = $(this).attr("VSPaymentCode");
$("#hidOneTimePaymentCode").val(resultPaymentCode);
$("#txtHIPAAPaymentCode").val(resultPaymentCode);
$("#divDateOfBirth").hide();
$("#divLast4ofSS").hide();
if (resultDOB == "1" ) {
$("#divDateOfBirth").show();
}
if (resultLast4SS == "1") {
$("#divLast4ofSS").show();
}
if (resultDOB == "0" && resultLast4SS == "0") {
$(".lblHIPAAErrorMessage").text("There is no HIPAA Data available to verify, please contact support.");
$("#btnHIPAASubmitButton").hide();
}
});
$("#hipaaviewstatement").click(function () {
$("#hipaaverificationpopup").show();
});
$("#vhclose").click(function () {
$("#hipaaverificationpopup").hide();
});
</script>
<script>
$(document).ready(function () {
var isPaymentWithDiscountSelected = false;
var showDiscountAvailable = false;
if(showDiscountAvailable){
$("#payAmountLable").text(NumberFormatter(0.00));
$("#txtPaymentAmount").val(0);
}else{
$("#payAmountLable").text(NumberFormatter(round2Fixed(38.8000)));
$("#txtPaymentAmount").val(38.8000);
}
});
$('#switchPayDiscount').on('click',function(){
var id = $(this).attr('id');
if($('#' + id).prop('checked') == true){
$("#payAmountLable").text(NumberFormatter(round2Fixed(0.0000)));
$("#txtPaymentAmount").val(0.0000);
$("#hidDiscountedBalancePaid").val("true");
isPaymentWithDiscountSelected = true;
$("#err_txtPaymentAmount").html("");
$(".editAmount").hide();
}else{
$("#txtPaymentAmount").val(0);
$("#payAmountLable").text('$0.00');
$("#hidDiscountedBalancePaid").val("false");
isPaymentWithDiscountSelected = false;
$(".editAmount").show();
}
});
function NumberFormatter(number) {
let formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
});
return formatter.format(number);
}
function IsPaymentWithDiscount(){
let DiscountedBalancePaid = false;
if(typeof isPaymentWithDiscountSelected == 'undefined'){
DiscountedBalancePaid = false;
}else{
DiscountedBalancePaid = isPaymentWithDiscountSelected;
}
return DiscountedBalancePaid;
}
</script>
<script>
var submitCardValidation=false;
var keyupInput="";
$('#cardNumber,#txtCardNameOnAccount,#cardCode,#txtCardBillingZipCode').on('keyup',function(){
submitCardValidation=false;
keyupInput=$(this).attr('id');
validateCreditCard();
});
$('#expMonth,#expYear').on('change',function(){
submitCardValidation=false;
keyupInput=$(this).attr('id');
validateCreditCard();
});
function validateCreditCard(){
var valid = true;
var cardHolderNameRegex = /^[a-z ,.'-]+$/i;
var cvvRegex = '';
var yearRegex = /^[0-9]{4,4}$/;
var cardHolderName = $("#txtCardNameOnAccount").val();
var cardNumber = $("#cardNumber").val();
var cvv = $("#cardCode").val();
var zipcode= $("#txtCardBillingZipCode").val();
var expYear =$("#expYear ").val();
var expMonth=$("#expMonth").val();
if (cardNumber.substr(0, 2) == '34' || cardNumber.substr(0, 2) == '37') {
cvvRegex = /^[0-9]{3,4}$/;
}
else {
cvvRegex = /^[0-9]{3,3}$/;
}
if (cardHolderName == "" || cardNumber == "" || cvv == "" || zipcode== "" || expYear=="" || expMonth=="") {
if (cardHolderName == "" && (submitCardValidation == true || keyupInput == "txtCardNameOnAccount")) {
$("#err_cardNameOnAccount").html('Please enter name on account.');;
}
else if(submitCardValidation==true || keyupInput=="txtCardNameOnAccount")
{
$("#err_cardNameOnAccount").html('');;
}
if (cardNumber == "") {
$("#err_cardNumber").html('Please enter card number.');;
}
else
{
$("#err_cardNumber").html('');
}
if (cvv == "" && (submitCardValidation==true || keyupInput=="cardCode")) {
$("#err_cardCode").html('Please enter CVV.');;
}
else if(submitCardValidation==true || keyupInput=="cardCode")
{
$("#err_cardCode").html('');
}
if(zipcode=="" && (submitCardValidation==true || keyupInput=="txtCardBillingZipCode"))
{
$("#err_cardBillingZipCode").html('Please enter your billing zip code.');;
}
else if(submitCardValidation==true || keyupInput=="txtCardBillingZipCode")
{
$("#err_cardBillingZipCode").html('');
}
if(expYear=="" && (submitCardValidation==true || keyupInput=="expYear"))
{
$("#err_expYear").html('Please select year');
}
else if(submitCardValidation==true || keyupInput=="expYear")
{
$("#err_expYear").html('');;
}
if (expMonth == "" && (submitCardValidation == true || keyupInput == "expMonth")) {
$("#err_expMonth").html('Please select month');
}
else if (submitCardValidation == true || keyupInput == "expMonth") {
$("#err_expMonth").html('');
}
valid = false;
}
if (cardHolderName != "" && !cardHolderNameRegex.test(cardHolderName)) {
$("#err_cardNameOnAccount").html('Name on account is invalid.');
valid = false;
}
if (cardNumber != "") {
$('#cardNumber').validateCreditCard(function(result) {
if (!(result.valid)) {
$("#err_cardNumber").html('Enter valid card number.');
valid = false;
}
else
{
$("#err_cardNumber").html('');
}
});
}
if (cvv != "" && !cvvRegex.test(cvv)) {
$("#err_cardCode").html('CVV number is invalid');
valid = false;
}
else if(cvv != "")
{
$("#err_cardCode").html('');
}
if (expYear!= "" && !yearRegex .test(expYear)) {
$("#err_expYear").html('Invalid year');
valid = false;
}
else if(expYear != "")
{
$("#err_expYear").html('');
}
return valid;
}
var cardtype = '';
$('#cardNumber').on('keyup',function(){
$('#cardNumber').validateCreditCard(function (result) {
if (result.card_type) {
$(".card_pay").attr("class", "form-control card_pay " + result.card_type.name);
var cardNumRange = result.card_type.range.split(",");
cardtype = result.card_type.name;
console.log(cardtype);
if (cardNumRange[0] == '34' || cardNumRange[1] == '37' ) {
$('#cardCode').attr('maxLength', 4);
$('#cardCode').attr('placeholder', 'e.g. 1234');
//TODO: REMOVE THIS STATIC LINK
$('.where_find').find('img').attr('src', "/MobilePay/Content/images/American-Express.png");
}
else {
$('#cardCode').attr('maxLength', 3);
$('#cardCode').attr('placeholder', 'e.g. 123');
//TODO: REMOVE THIS STATIC LINK
$('.where_find').find('img').attr('src', "/MobilePay/Content/images/cvv-card.png");
}
}
else
{
$(".card_pay").attr("class", "form-control card_pay ");
}
});
});
</script>
<script>
var submitBankValidation=false;
$('#accountNumber,#routingNumber,#nameOnAccount,#accountType,#bankName').on('keyup change',function(){
submitBankValidation=false;
keyupInput=$(this).attr('id');
validateBank();
});
function validateBank(){
var valid = true;
var accountNumber= $("#accountNumber").val();
var routingNumber= $("#routingNumber").val();
var nameOnAccount= $("#nameOnAccount").val();
var accountType= $("#accountType").val();
var bankName=$("#bankName").val();
if (accountNumber == "" && (submitBankValidation == true || keyupInput == "accountNumber")) {
valid = false;
$("#err_accountNumber").html('Please enter account number.');;
}
else if (submitBankValidation == true || keyupInput == "accountNumber") {
$("#err_accountNumber").html('');
}
if (routingNumber == "" && (submitBankValidation == true || keyupInput == "routingNumber")) {
valid = false;
$("#err_routingNumber").html('Please enter routing number.');;
}
else if (submitBankValidation == true || keyupInput == "routingNumber") {
$("#err_routingNumber").html("");
}
if (nameOnAccount == "" && (submitBankValidation == true || keyupInput == "nameOnAccount")) {
valid = false;
$("#err_nameOnAccount").html('Please enter name on account.');;
}
else if (submitBankValidation == true || keyupInput == "nameOnAccount") {
$("#err_nameOnAccount").html('');
}
if (accountType == "" && (submitBankValidation == true || keyupInput == "accountType")) {
valid = false;
$("#err_accountType").html('Please select account type.');;
}
else if (submitBankValidation == true || keyupInput == "accountType") {
$("#err_accountType").html('');
}
if (bankName == "" && (submitBankValidation == true || keyupInput == "bankName")) {
valid = false;
$("#err_bankName").html("Please enter bank name.");;
}
else if (submitBankValidation == true || keyupInput == "bankName") {
$("#err_bankName").html('');
}
return valid;
}
</script>
<script>
$('.creditCardSend').on('click',function(){
if($(this).find('.fa-spinner').length)
{
return false;
}
submitCardValidation=true;
loading("loading");
keyupInput=$(this).attr('id');
if(validateCreditCard()==false)
{
loading("payment");
return false;
}
creditCardSend();
});
function creditCardSend() {
var authData = {};
authData.clientKey = '3mm3a4PXykS5wGFg8AEN69wkX5npSHG333pZ5QSkGWjLneqhGJASbyYzA7mS26Kv';
authData.apiLoginID = '63W9Avuvm';
var cardData = {};
cardData.cardNumber = document.getElementById("cardNumber").value;
cardData.month = document.getElementById("expMonth").value;
cardData.year = document.getElementById("expYear").value;
cardData.cardCode = document.getElementById("cardCode").value;
var secureData = {};
secureData.authData = authData;
secureData.cardData = cardData;
Accept.dispatchData(secureData, responseHandler);
function responseHandler(response) {
var flag_error_check=1;
var flag_error="";
if (response.messages.resultCode === "Error") {
var i = 0;
while (i < response.messages.message.length) {
flag_error_check=0;
if (response.messages.message[i].code == "E_WC_05" ) {
document.getElementById("err_cardNumber").textContent = response.messages.message[i].text;
flag_error_check=1;
}
if(response.messages.message[i].code == "E_WC_20"){
flag_error_check=1;
document.getElementById("err_cardNumber").textContent ="The card number is invalid";
}
if (response.messages.message[i].code == "E_WC_06") {
flag_error_check=1;
$('#err_expMonth').html("Invalid month");
}
else
{
$('#err_expMonth').html('');
}
if (response.messages.message[i].code == "E_WC_07" || response.messages.message[i].code =="E_WC_08") {
flag_error_check=1;
$('#err_expYear').html("Invalid year");
}
else
{
$('#err_expYear').html('');
}
if (response.messages.message[i].code == "E_WC_15") {
flag_error_check=1;
document.getElementById("err_cardCode").textContent = response.messages.message[i].text;
}
if(flag_error_check==0){
flag_error +="\n"+response.messages.message[i].text;
}
i = i + 1;
}
if(flag_error!="")
{
alert(flag_error);
}
loading("payment");
} else {
if ($('#creditCardCheck').prop("checked") == true) {
saveCardChecked = 1;
}
else {
saveCardChecked = 0;
}
ProcessCreditCardPayment(response.opaqueData, saveCardChecked);
}
}
}
function ProcessCreditCardPayment(responseData) {
var EmailAddress = '';
var PaymentAmount = $("#txtPaymentAmount").val();
var NameOnAccount = $("#txtCardNameOnAccount").val();
var code = $("#cardCode").val();
var PaymentCode = $("#hidPaymentCode").val();
var PracticeID = $("#hidPracticeID").val();
var PracticeName = $("#hidPracticeName").val();
var CustomerProfileID = $("#hidCustomerProfileID").val();
var BillingZipCode = $("#txtCardBillingZipCode").val();
var SelectedInvoices = '';
var DiscountedBalancePaid = IsPaymentWithDiscount();
var DiscountedBalanceAmount = $("#hidDiscountedBalance").val();
var DiscountAmount = 0;
if(DiscountedBalancePaid == true && round2Fixed(DiscountedBalanceAmount) == round2Fixed(PaymentAmount)){
DiscountAmount = $("#hidDiscountAmount").val();
}
$.ajax({
url: '/PayBill/CreateTransaction',
cache: false,
data: {practiceID: PracticeID, practiceName: PracticeName, customerProfileID: CustomerProfileID, paymentCode: PaymentCode, nameOnAccount: NameOnAccount, dataDesc: responseData.dataDescriptor, dataValue: responseData.dataValue, createPaymentProfile: saveCardChecked, paymentAmount: PaymentAmount, billingZipCode: BillingZipCode, emailAddress: EmailAddress, Code: code, transSource: 6, selectedInvoices: SelectedInvoices, discountedBalancePaid: DiscountedBalancePaid, discountAmount: DiscountAmount },
success: function (data) {
if (data.success) {
messageFunc(data.value, "CC");
}
else{
loading("payment"); loading("payment1");
}
},
error: function (xhr) {
alert(xhr.responseText);
loading("payment"); loading("payment1");
}
});
}
$('.save_card_pay_submit').on('click', function () {
var cardData = {};
var dataCheck = $('.card_details:checked');
var EmailAddress ="";
var PracticeID = $("#hidPracticeID").val();
var PracticeName = $("#hidPracticeName").val();
var CustomerProfileID = $("#hidCustomerProfileID").val();
var PaymentCode = $("#hidPaymentCode").val();
cardData.cardCode = $(this).closest('.save_card_pay_div').find('.cvv').val();
cardData.ProfileID = dataCheck.attr('PaymentProfileID');
var PaymentAmount = $("#txtPaymentAmount").val();
var SelectedInvoices = '';
var DiscountedBalancePaid = IsPaymentWithDiscount();
var DiscountedBalanceAmount = $("#hidDiscountedBalance").val();
var DiscountAmount = 0;
if(DiscountedBalancePaid == true && round2Fixed(DiscountedBalanceAmount) == round2Fixed(PaymentAmount)){
DiscountAmount = $("#hidDiscountAmount").val();
}
if (cardData.cardCode == "") {
$(this).closest('.save_card_pay_div').find(".err_cvv").html('Please Enter CVV');
return false;
}
if (cardData.ProfileID == "") {
$(this).closest('.save_card_pay_div').find(".err_cvv").html('Payment Profile is missing. Please log out and try again');
return false;
}
if (cardData.cardCode != "" && cardData.cardCode.length < 3) {
$(this).closest('.save_card_pay_div').find(".err_cvv").html('CVV number is invalid');
return false;
}
else if (cardData.cardCode != "") {
loading("loading1");
$(this).closest('.save_card_pay_div').find(".err_cvv").html('');;
}
$.ajax({
url: '/PayBill/CreateTransactionWithSavedMethod',
cache: false,
data: {practiceID: PracticeID, practiceName: PracticeName, customerProfileID: CustomerProfileID, paymentCode: PaymentCode, customerPaymentProfileID: cardData.ProfileID, paymentAmount: PaymentAmount, emailaddress: EmailAddress, Code: cardData.cardCode, transSource: 6, selectedInvoices: SelectedInvoices, discountedBalancePaid: DiscountedBalancePaid, discountAmount: DiscountAmount },
success: function (data) {
if (data.success) {
messageFunc(data.value, "CC");
}
else{
loading("payment"); loading("payment1");
}
},
error: function (xhr) {
alert(xhr.responseText);
loading("payment"); loading("payment1");
}
});
});
// The result of the transaction processing will be returned from the processing script as a JSON object. Parse the object to determine success or failure, and alert the user.
function messageFunc(returnMsg, paymentType) {
try {
responseObj = JSON.parse(returnMsg);
var errorText = "";
if (responseObj != null)
{
if (responseObj.messages.resultCode == "0")
{
if(responseObj.transactionResponse.messages != null)
{
$('#hidResponse').val(returnMsg);
authCode = responseObj.transactionResponse.authCode;
message = "";
if (paymentType == "CC"){
message = "Authorization Code: " + authCode;
}
payment_status = true;
$('.authorization_code').html(message);
next_step();
}
else
{
errorText = "Failed Transaction: ";
if (responseObj.transactionResponse.errors != null)
{
errorText += responseObj.transactionResponse.errors[0].errorText;
loading("payment"); loading("payment1");
}
alert(errorText);
}
}
else
{
errorText = "Failed Transaction: ";
if (responseObj.transactionResponse != null && responseObj.transactionResponse.errors != null)
{
errorText += responseObj.transactionResponse.errors[0].errorText;
loading("payment"); loading("payment1");
}
else
{
errorText += responseObj.transactionResponse.errors[0].errorText;
loading("payment");
loading("payment1");
}
alert(errorText);
}
}
else
{
alert("Null Response.");
loading("payment"); loading("payment1");
}
}
catch (error) {
console.log("Couldn't parse result string");
message = "Error.";
alert(message);
loading("payment"); loading("payment1");
}
}
</script>
<script>
$('.bankAccountSend').on('click',function(){
if($(this).find('.fa-spinner').length)
{
return false;
}
loading("loading");
submitBankValidation=true;
keyupInput=$(this).attr('id');
if(validateBank()==false)
{
loading("payment");
return false;
}
bankAccountSend();
});
function bankAccountSend() {
var authData = {};
authData.clientKey = '3mm3a4PXykS5wGFg8AEN69wkX5npSHG333pZ5QSkGWjLneqhGJASbyYzA7mS26Kv';
authData.apiLoginID = '63W9Avuvm';
var bankData = {};
bankData.accountNumber = document.getElementById('accountNumber').value;
bankData.routingNumber = document.getElementById('routingNumber').value;
bankData.nameOnAccount = document.getElementById('nameOnAccount').value;
bankData.accountType = document.getElementById('accountType').value;
var secureData = {};
secureData.authData = authData;
secureData.bankData= bankData;
Accept.dispatchData(secureData, responseHandler);
function responseHandler(response) {
var flag_error_check=1;
var flag_error="";
// console.log(response);
if (response.messages.resultCode === "Error") {
var i = 0;
while (i < response.messages.message.length) {
flag_error_check=0;
if (response.messages.message[i].code == "E_WC_27") {
document.getElementById("err_accountType").textContent = response.messages.message[i].text;
flag_error_check=1;
}
else {
$("#err_accountType").html('');
}
if ( response.messages.message[i].code == "E_WC_25") {
flag_error_check=1;
document.getElementById("err_routingNumber").textContent = response.messages.message[i].text;
}
else {
$("#err_routingNumber").html('');
}
if (response.messages.message[i].code == "E_WC_24") {
flag_error_check=1;
document.getElementById("err_accountNumber").textContent = response.messages.message[i].text;
}
else {
document.getElementById("err_accountNumber").textContent = "";
}
if(flag_error_check==0){
flag_error +="\n"+response.messages.message[i].text;
}
i = i + 1;
}
if(flag_error!="")
{
alert(flag_error);
}
loading("payment");
} else {
if ($('#bankCardCheck').prop("checked") == true) {
saveCardChecked = 1;
}
else {
saveCardChecked = 0;
}
ProcessBankAccountPayment(response.opaqueData, saveCardChecked);
}
}
}
function ProcessBankAccountPayment(responseData, saveCardChecked) {
var EmailAddress ="";
var PaymentAmount = $("#txtPaymentAmount").val();
var NameOnAccount = $("#nameOnAccount").val();
var PaymentCode = $("#hidPaymentCode").val();
var PracticeID = $("#hidPracticeID").val();
var PracticeName = $("#hidPracticeName").val();
var CustomerProfileID = $("#hidCustomerProfileID").val();
var SelectedInvoices = '';
var DiscountedBalancePaid = IsPaymentWithDiscount();
var DiscountedBalanceAmount = $("#hidDiscountedBalance").val();
var DiscountAmount = 0;
if(DiscountedBalancePaid == true && round2Fixed(DiscountedBalanceAmount) == round2Fixed(PaymentAmount)){
DiscountAmount = $("#hidDiscountAmount").val();
}
$.ajax({
url: '/PayBill/CreateBankTransaction',
cache: false,
data: {practiceID: PracticeID, practiceName: PracticeName, customerProfileID: CustomerProfileID, paymentCode: PaymentCode, nameOnAccount: NameOnAccount, dataDesc: responseData.dataDescriptor, dataValue: responseData.dataValue, createPaymentProfile: saveCardChecked, paymentAmount: PaymentAmount, emailAddress: EmailAddress, transSource: 6, selectedInvoices: SelectedInvoices, discountedBalancePaid: DiscountedBalancePaid, discountAmount: DiscountAmount },
success: function (data) {
if (data.success) {
messageFunc(data.value, "BA");
}
else{
loading("payment"); loading("payment1");
}
},
error: function (xhr) {
alert("jquery error");
loading("payment"); loading("payment1");
}
});
}
$('.save_bank_pay_submit').on('click', function () {
var bankData = {};
var dataCheck = $('.bank_details:checked');
bankData.ProfileID = dataCheck.attr('PaymentProfileID');
var EmailAddress = ""
var PracticeID = $("#hidPracticeID").val();
var PracticeName = $("#hidPracticeName").val();
var CustomerProfileID = $("#hidCustomerProfileID").val();
var PaymentCode = $("#hidPaymentCode").val();
var PaymentAmount = $("#txtPaymentAmount").val();
var SelectedInvoices = '';
var DiscountedBalancePaid = IsPaymentWithDiscount();
var DiscountedBalanceAmount = $("#hidDiscountedBalance").val();
var DiscountAmount = 0;
if(DiscountedBalancePaid == true && round2Fixed(DiscountedBalanceAmount) == round2Fixed(PaymentAmount)){
DiscountAmount = $("#hidDiscountAmount").val();
}
if (bankData.ProfileID == "") {
$(this).closest('.save_bank_pay_div').find(".save_bank_pay_div_error").html('The Profile ID is Missing');
return false;
}
else if (bankData.ProfileID != "") {
loading("loading1");
$(this).closest('.save_bank_pay_div').find(".save_bank_pay_div_error").html('');;
}
$.ajax({
url: '/PayBill/CreateBankTransactionWithSavedMethod',
cache: false,
data: {practiceID: PracticeID, practiceName: PracticeName, customerProfileID: CustomerProfileID, paymentCode: PaymentCode, customerPaymentProfileID: bankData.ProfileID, paymentAmount: PaymentAmount, emailaddress: EmailAddress, transSource: 6, selectedInvoices: SelectedInvoices, discountedBalancePaid: DiscountedBalancePaid, discountAmount: DiscountAmount },
success: function (data) {
if (data.success) {
messageFunc(data.value, "BA");
}
else{
loading("payment"); loading("payment1");
}
},
error: function (xhr) {
alert(xhr.responseText);
loading("payment"); loading("payment1");
}
});
});
</script>
<script>
$('.delete_save').on('click', function () {
var CustomerProfileID = $("#hidCustomerProfileID").val();
var PaymentProfileID = $(this).closest('.save').find('.delete_at').attr('PaymentProfileID');
var self = $(this);
if (confirm("Are you sure you want to delete this Payment Method?")) {
$.ajax({
type: "POST",
url: '/PayBill/DeletePaymentProfile',
dataType: "json",
type: "POST",
cache: false,
data: { customerProfileID: CustomerProfileID, customerPaymentProfileID: PaymentProfileID }, //use id here
success: function (data) {
if (data.success)
{
if (data.value == "Ok"){
alert("The Payment Method was successfully removed.");
if (self.closest('#v-pills-credit').find('.delete_save').length == 1) {
$('#v-pills-credit').find('.labelCheckCard').hide();
$('#v-pills-credit').find('.lb_crd').html("");
$('#v-pills-credit').find(".add_card_dtl").show();
}
if (self.closest('#v-pills-bank').find('.delete_save').length == 1) {
$('#v-pills-bank').find('.labelCheckBank').hide();
$('#v-pills-bank').find('.lb_bnk').html("");
$('#v-pills-bank').find(".add_bank_dtl").show();
}
self.closest('.close_row').remove();
}
else{
alert(data.text);
}
}
else {
alert("An error occured removing the Payment Method.");
}
},
error: function (result) {
alert("An error attempting to remove the Payment Method.");
}
});
}
});
</script>
<script>
if (!!window.performance && window.performance.navigation.type == 2) {
window.location.reload();
}
$(".login").click(function () {
$(this).addClass('btn-primary');
$(this).removeClass('btn-flat');
$('.pay-bill').removeClass('btn-primary');
$('.pay-bill').addClass('btn-flat');
$('.login-fields').show();
$('.pay-bill-fields').hide();
});
$(".login-first a").click(function () {
$('.login-fields').show();
$('.pay-bill-fields').hide();
$('.login-first').hide();
$('.d-pay-bill').show();
});
$(".d-pay-bill a").click(function () {
$('.login-fields').hide();
$('.pay-bill-fields').show();
$('.login-first').show();
$('.d-pay-bill').hide();
});
$(".pay-bill").click(function () {
$(this).addClass('btn-primary');
$(this).removeClass('btn-flat');
$('.login').removeClass('btn-primary');
$('.login').addClass('btn-flat');
$('.login-fields').hide();
$('.pay-bill-fields').show();
});
$(".register").click(function () {
$('#form-1').hide();
$('.slogan-2').hide();
$('#form-2').show();
$('.reg-ben').hide();
$('.reg-cta').show();
});
//data-cnt="step-2"
var step = 1;
var payment_status = false;
var paybillamount=0;
var balanceAmount = 0;
var saveCardChecked = 1;
var accountNumber_save = "";
var nameOnAccount_save = "";
var billingZipCode_save = "";
var expMonth_save = "";
var expYear_save = "";
var accountType_save = "";
var bankName_save = "";
var bankRoutingNumber_save ="";
$("#txtPaymentAmount").val($("#txtPaymentAmount").val().replace('$', ''));
$(".next_step").click(function () {
var a = verifyamount();
if (a == false) {
return false;
}
if (step == 2) {
return false;
}
var pmt=$('#txtPaymentAmount').val();
next_step();
loading("payment");
});
function next_step() {
if (step == 2) {
if (payment_status == false) {
return false;
}
}
step++;
var data = "step-" + step;
/*
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
});
*/
paybillamount = $('#txtPaymentAmount').val();
emailaddress = $('#payBillModel_EmailAddress').val();
var field = document.getElementById("paybillcreditcard");
field.setAttribute("value", "Pay " + NumberFormatter(paybillamount));
$('.save_card_pay_submit').html('Pay <span id="spnPayAmountDisplay_div">' + NumberFormatter(round2Fixed(paybillamount)));
$('.save_bank_pay_submit').html('Pay <span id="spnPayAmountDisplay_div">' + NumberFormatter(round2Fixed(paybillamount)));
$('#spnDisplayPaymentAmount').html(NumberFormatter(paybillamount));
$('#paybillbank').html("Pay " + NumberFormatter(paybillamount));
$(".steps").hide();
$("#" + data).fadeIn();
$("." + data).addClass("active");
$("." + data).removeAttr("data_txt");
if (data == 'step-3') {
var PaymentCode = $("#hidPaymentCode").val();
var PaymentAmount = $("#txtPaymentAmount").val();
var HistoryCode = $("#hidHistoryCode").val();
$.ajax({
url: '/Mobile/UpdateSmsPaid',
cache: false,
data: {historyCode: HistoryCode, paymentCode: PaymentCode, paymentAmount: PaymentAmount},
success: function (data) {
$(".step").addClass("cursor_default");
},
error: function (xhr) {
$(".step").addClass("cursor_default");
}
});
}
}
$(document).ready(function () {
$('.where_find').click(function () {
if ($(this).find("img").hasClass('d-none')) {
$(this).find("img").removeClass("d-none");
} else {
$(this).find("img").addClass("d-none");
}
});
$('.where_find img').click(function () {
if ($(this).hasClass('card_hide1')) {
$(this).removeClass("card_hide1");
} else {
$(this).addClass("card_hide1");
}
});
});
$('#progressbar li').click(function () {
if ($('.step-3').hasClass('active')) {
return false;
}
if ($(this).attr("data_txt") != 'isDisabled') {
var data = 'step-' + $(this).attr("step_no");
step = $(this).attr("step_no");
if (step == 2) {
if(verifyamount() == true){
paybillamount = $('#txtPaymentAmount').val();
$('#spnDisplayPaymentAmount').html(NumberFormatter(round2Fixed(paybillamount)));
$('.sendPaymentDataToAnet').html('Pay <span id="spnPayAmountDisplay">' + NumberFormatter(round2Fixed(paybillamount)));
$('.save_card_pay_submit').html('Pay <span id="spnPayAmountDisplay_div">' + NumberFormatter(round2Fixed(paybillamount)));
$('.save_bank_pay_submit').html('Pay <span id="spnPayAmountDisplay_div">' + NumberFormatter(round2Fixed(paybillamount)));
}else{
return false;
}
}
$(".steps").hide();
$("#" + data).fadeIn();
$("." + data).addClass("active");
$("." + data).removeAttr("data_txt");
}
});
var paymentcode = $('#custpaymentcode').text()
paybillamount = $('#spnDisplayPaymentAmount').text().replace('$', '');
$("#txtPaymentAmount").change(function () {
var pAmount = $("#txtPaymentAmount").val().replace('$', '');
var totalpayAmount =38.80;
pAmount = round2Fixed(pAmount);
if (pAmount != "") {
if (pAmount <= 0) {
return false;
}
if (totalpayAmount< pAmount) {
$("#txtPaymentAmount").val('0.00')
}
}
});
function loading(status)
{
if(status=="loading")
{
$(".sendPaymentDataToAnet").css("pointer-events", "none");
$('.sendPaymentDataToAnet').html('<i class="fa fa-spinner fa-spin"></i> Processing..');
}
else if (status == "loading1") {
if($(".sendPaymentDataToAnet1").length)
{
$(".sendPaymentDataToAnet1").css("pointer-events", "none");
$('.sendPaymentDataToAnet1').html('<i class="fa fa-spinner fa-spin"></i> Processing..');
}
}
else if (status == "payment1") {
if($(".sendPaymentDataToAnet1").length)
{
$(".sendPaymentDataToAnet1").css("pointer-events", "");
$('.sendPaymentDataToAnet1').html('Pay <span id="spnPayAmountDisplay">'+ NumberFormatter(round2Fixed(paybillamount)));
}
}
else
{
$(".sendPaymentDataToAnet").css("pointer-events", "");
$('.sendPaymentDataToAnet').html('Pay <span id="spnPayAmountDisplay">'+ NumberFormatter(round2Fixed(paybillamount)));
}
}
$('#step-2 .nav-link').on('click',function(){
$('#step-2').find('.nav-link').removeClass('active');
$(this).addClass('active');
var hrf= $(this).attr("href");
$('#v-pills-tabContent').find('.tab-pane').removeClass("show").removeClass("active");
$('#v-pills-tabContent').find(hrf).addClass("show").addClass("active");
});
$("input[type='radio']").click(function () {
if ($(this).is('.card_details')) {
$('.save_card_pay_div').hide();
$(this).closest('.save').find('.save_card_pay_div').show();
var crdNum = $(this).closest('.save').find('.card_details').attr('id');
if (crdNum.substr(0, 2) == '34' || crdNum.substr(0, 2) == '37') {
$(this).closest('.save').find('.cvv').attr('maxLength', 4);
}
else {
$(this).closest('.save').find('.cvv').attr('maxLength', 3);
}
$('.save_card_pay_submit').html('Pay <span id="spnPayAmountDisplay_div">' + NumberFormatter(round2Fixed(paybillamount)));
$('.add_card_dtl').hide();
}
if ($(this).is('.bank_details')) {
$('.save_bank_pay_div').hide();
$(this).closest('.save').find('.save_bank_pay_div').show();
$('.save_bank_pay_submit').html('Pay <span id="spnPayAmountDisplay_div">' + NumberFormatter(round2Fixed(paybillamount)));
$('.add_bank_dtl').hide();
}
});
$(function () {
var acc_crd = $(".card_details").length;
if (acc_crd > 0) {
$(".add_card_dtl").hide();
$(".lb_crd").html("Your Saved Cards");
}
else {
$(".labelCheckCard").hide();
}
$(document).on("click", ".show_card_fields", function () {
$('.card_details:checked').closest(".close_row").find('.save_card_pay_div').hide();
$('.card_details:checked').prop("checked", false);
if ($(".show_card_fields").text() == "Pay with new card" ){
$(".show_card_fields").html("Pay with saved card");
}
else{
$(".show_card_fields").html("Pay with new card");
}
$(".add_card_dtl").toggle();
$(".existing_card_dtl").toggle();
});
var banc_crd = $(".bank_details").length;
if (banc_crd > 0) {
$(".add_bank_dtl").hide();
$(".lb_bnk").html("Your Saved Bank Details");
}
else {
$(".labelCheckBank").hide();
}
$(document).on("click", ".show_bank_fields", function () {
$('.bank_details:checked').closest(".close_row").find('.save_bank_pay_div').hide();
$('.bank_details:checked').prop("checked", false);
if ($(".show_bank_fields").text() == "Pay with new bank account" ){
$(".show_bank_fields").html("Pay with saved bank account");
}
else{
$(".show_bank_fields").html("Pay with new bank account");
}
$(".add_bank_dtl").toggle();
$(".existing_bank_dtl").toggle();
});
});
$('#close_window').on('click', function () {
window.opener = self;
window.close();
});
$(".ActiveDashboard").addClass("active");
$(document).ready(function () {
$('.editAmount').click(function (e) {
if(typeof isPaymentWithDiscountSelected == 'undefined' || isPaymentWithDiscountSelected == false){
$("#err_txtPaymentAmount").html("");
e.preventDefault();
var text = $('#payAmountLable').text().replace('$', '').replace(',', '');
var input = $('<input id="attribute" class="fixed2Decimal form-control text-center w-75 mx-auto" style="font-size:16px;" type="number" onKeyDown = "if(this.value.length==8 && event.keyCode!=8) return false;" value="' + text + '" />')
$('#payAmountLable').text('').append(input);
input.select();
input.blur(function () {
var text = $('#attribute').val();
if (text == "") {text= 38.80;}
$('#attribute').parent().text("$" + text);
if (38.80<text || text == 0) {
verifyamount();
}
else {
$("#err_txtPaymentAmount").html("");
}
$('#attribute').remove();
$("#txtPaymentAmount").val(text);
});
}
});
$("#SendReceipt").click(function () {
var transaction_code = $(".transaction_code").html();
var PRemail = $("#PREmailId").val();
if (PRemail == "") {
$("#err_PRerror").html("Please enter e-mail address");
return false;
}
else if (validateEmail(PRemail) == false) {
$('#err_PRerror').html('Enter valid email address.');
return false;
}
else {
$('#err_PRerror').html('');
}
var ResponseString = $("#hidResponse").val();
var PracticeName = $("#hidPracticeName").val();
$('#SendReceipt').html('<i class="fa fa-spinner fa-spin"></i> Processing..');
$("#SendReceipt").css("pointer-events", "none");
$.ajax({
url: '/PayBill/EmailPaymentReceipt',
dataType: "json",
type: "POST",
cache: false,
data: { responseString: ResponseString, emailaddress: PRemail, practiceName: PracticeName},
success: function (data) {
if (data.success) {
$('#SendReceipt').html('Receipt Sent');
$("#emailsentpopup").show();
$("#errorpopup").hide();
}
else {
$('#SendReceipt').html('success, but an error occurred');
$("#emailsentpopup").hide();
$("#errorpopup").show();
}
},
error: function (xhr) {
//alert(data);
$('#SendReceipt').html('an AJAX Error Occured');
$("#emailsentpopup").hide();
$("#errorpopup").show();
}
});
});
$("#PREmailId").on("keyup", function () {
var email = $(this).val();
if (email == "") {
$("#err_PRerror").html("Please enter e-mail address");
return false;
}
else if (validateEmail(email) == false) {
$('#err_PRerror').html('Enter valid e-mail address.');
return false;
}
else {
$('#err_PRerror').html('');
}
});
});
$("#closemodal").click(function () {
$('#SendReceipt').html('Send Receipt');
//window.self.close();
$("#emailsentpopup").hide();
});
$("#vherrorclose").click(function () {
$("#errorpopup").hide();
$("#SendReceipt").css("pointer-events", "");
});
</script>
<script>
$('#txtCardNameOnAccount, #nameOnAccount').keypress(function (e) {
var key = e.keyCode;
if (key >= 48 && key <= 57) {
e.preventDefault();
}
});
function onlyNumeric(e) {
if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
return false;
}
return true;
};
$('#payBillModel_EmailAddress').on('keyup',function(){
var eml=$(this).val();
if(validateEmail(eml)==false)
{
$('#err_payBillEmail').html('Enter valid email address.');;
}
else
{
$('#err_payBillEmail').html('');
}
});
function verifyamount() {
var pAmount = $('#payAmountLable').text().replace('$', '').replace(',', '');
var totalpayAmount=38.80;
pAmount = round2Fixed(pAmount);
if(isNaN(pAmount))
{
return false;
}
else if (pAmount == "" || pAmount == null || pAmount <= 0 ) {
$("#err_txtPaymentAmount").html("Please enter valid amount").append("<br/>");
return false;
}
else if (totalpayAmount < pAmount) {
$("#err_txtPaymentAmount").html("Please enter amount not in excess of your current balance.").append("<br/>");
return false
}
return true
}
$('.groupOfTexbox').keypress(function (event) {
return isNumber(event, this)
});
function isNumber(evt, element) {
var charCode = (evt.which) ? evt.which : event.keyCode
if (
(charCode != 45 || $(element).val().indexOf('-') != -1) && // “-†CHECK MINUS, AND ONLY ONE.
(charCode != 46 || $(element).val().indexOf('.') != -1) && // “.†CHECK DOT, AND ONLY ONE.
(charCode < 48 || charCode > 57))
return false;
return true;
}
function round2Fixed(value) {
value = +value;
if (isNaN(value))
return NaN;
// Shift
value = value.toString().split('e');
value = Math.round(+(value[0] + 'e' + (value[1] ? (+value[1] + 2) : 2)));
// Shift back
value = value.toString().split('e');
return (+(value[0] + 'e' + (value[1] ? (+value[1] - 2) : -2))).toFixed(2);
}
// Function for payment amount only enter two decimal point
function fixed2Decimal(event,value) {
if ((event.which != 46 || value.indexOf('.') != -1) && (event.which < 48 || event.which > 57)) {
if ((event.which != 46 || value.indexOf('.') != -1)) {
//alert('Multiple Decimals are not allowed');
}
event.preventDefault();
}
if (value.indexOf(".") > -1 && (value.split('.')[1].length > 1)) {
//alert('Two numbers only allowed after decimal point');
event.preventDefault();
}
}
/*
$(document).on("keyup change",".fixed2Decimal",function(){
var val = this.value;
var re = /^([0-9]+[\.]?[0-9]?[0-9]?|[0-9]+)$/g;
var re1 = /^([0-9]+[\.]?[0-9]?[0-9]?|[0-9]+)/g;
if (re.test(val)) {
//do something here
} else {
val = re1.exec(val);
if (val) {
this.value = val[0];
} else {
this.value = "";
}
}
});
*/
$(document).on("keyup change",".fixed2Decimal",function(){
var val = this.value;
var arrVal = val.split(".");
if(arrVal.length > 1){
var leftPart = arrVal[0];
var rightPart = arrVal[1];
if(rightPart.length > 2){
this.value = leftPart + "." + rightPart.substr(0,2);
}
}
});
function validateEmail(emailField) {
var reg = /^([A-Za-z0-9_\-\.])+\x40([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
if (reg.test(emailField) == false) {
return false;
}
return true;
}
</script>
<script async="" src="https://pay.google.com/gp/p/js/pay.js" onload="onGooglePayLoaded()"></script>
<script>
/**
* Define the version of the Google Pay API referenced when creating your
* configuration
* see link https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataRequest|apiVersion in PaymentDataRequest */
const baseRequest = {
apiVersion: 2,
apiVersionMinor: 0
};
/**
* Card networks supported by your site and your gateway
*see link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters
*todo confirm card networks supported by your site and gateway */
const allowedCardNetworks = ["AMEX", "DISCOVER", "MASTERCARD", "VISA"];
/**
* Card authentication methods supported by your site and your gateway
* see link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters
* todo confirm your processor supports Android device tokens for your
* supported card networks */
const allowedCardAuthMethods = ["PAN_ONLY", "CRYPTOGRAM_3DS"];
/**
* Identify your gateway and your site's gateway merchant identifier
*
* The Google Pay API response will return an encrypted payment method capable
* of being charged by a supported gateway after payer authorization
* todo check with your gateway on the parameters to pass
* see link https://developers.google.com/pay/api/web/reference/request-objects#gateway|PaymentMethodTokenizationSpecification */
const tokenizationSpecification = {
type: 'PAYMENT_GATEWAY',
parameters: {
'gateway': 'authorizenet',
'gatewayMerchantId': '1964299'
}
};
/**
* Describe your site's support for the CARD payment method and its required fields
* see link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters */
const baseCardPaymentMethod = {
type: 'CARD',
parameters: {
allowedAuthMethods: allowedCardAuthMethods,
allowedCardNetworks: allowedCardNetworks
}
};
/**
* Describe your site's support for the CARD payment method including optional fields
* see link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters */
const cardPaymentMethod = Object.assign(
{},
baseCardPaymentMethod,
{
tokenizationSpecification: tokenizationSpecification
}
);
/**
* An initialized google.payments.api.PaymentsClient object or null if not yet set
* see link getGooglePaymentsClient */
let paymentsClient = null;
/*************************START OF ON PAGE LOAD**********************************/
/**
* Initialize Google PaymentsClient after Google-hosted JavaScript has loaded
* Display a Google Pay payment button after confirmation of the viewer's ability to pay. */
//First
function onGooglePayLoaded() {
//alert("onGooglePayLoaded");
const paymentsClient = getGooglePaymentsClient();
paymentsClient.isReadyToPay(getGoogleIsReadyToPayRequest())
.then(function(response) {
if (response.result) {
addGooglePayButton();
// todo prefetch payment data to improve performance after confirming site functionality
// prefetchGooglePaymentData();
}
})
.catch(function(err) {
// show error in developer console for debugging
console.error(err);
});
}
/**
* Configure your site's support for payment methods supported by the Google Pay
* API.
*
* Each member of allowedPaymentMethods should contain only the required fields,
* allowing reuse of this base request when determining a viewer's ability
* to pay and later requesting a supported payment method
*
* returns {object} Google Pay API version, payment methods supported by the site */
function getGoogleIsReadyToPayRequest() {
//alert("getGoogleIsReadyToPayRequest");
return Object.assign(
{},
baseRequest,
{
allowedPaymentMethods: [baseCardPaymentMethod]
}
);
}
/**
* Add a Google Pay purchase button alongside an existing checkout button
* see link https://developers.google.com/pay/api/web/reference/request-objects#ButtonOptions|Button options
* see link https://developers.google.com/pay/api/web/guides/brand-guidelines|Google Pay brand guidelines */
// https://developers.google.com/pay/api/web/guides/brand-guidelines
// buttonColor: (black, white)
// buttonType: (long, short) (Long is "Buy with G Pay" button, and Short is "G Pay" pay mark)
function addGooglePayButton() {
//alert("addGooglePayButton");
const paymentsClient = getGooglePaymentsClient();
const button = paymentsClient.createButton({onClick: onGooglePaymentButtonClicked, buttonColor: 'black', buttonType: 'short'} );
document.getElementById('btnGooglePay').appendChild(button);
}
/////////**
//////// * Prefetch payment data to improve performance
//////// *
//////// * ATsee {ATlink https://developers.google.com/pay/api/web/reference/client#prefetchPaymentData|prefetchPaymentData()}
//////// */
////////function prefetchGooglePaymentData() {
//////// const paymentDataRequest = getGooglePaymentDataRequest();
//////// // transactionInfo must be set but does not affect cache
//////// paymentDataRequest.transactionInfo = {
//////// totalPriceStatus: 'NOT_CURRENTLY_KNOWN',
//////// currencyCode: 'USD'
//////// };
//////// const paymentsClient = getGooglePaymentsClient();
//////// paymentsClient.prefetchPaymentData(paymentDataRequest);
////////}
/**
* Return an active PaymentsClient or initialize
* see link https://developers.google.com/pay/api/web/reference/client#PaymentsClient|PaymentsClient constructor
* returns {google.payments.api.PaymentsClient} Google Pay API client */
function getGooglePaymentsClient() {
//alert("getGooglePaymentsClient");
if ( paymentsClient === null ) {
paymentsClient = new google.payments.api.PaymentsClient({environment: 'PRODUCTION'});
}
return paymentsClient;
}
/*************************END ON PAGE LOAD**********************************/
/*************************START Buy with GPay Button Click**********************************/
/**
* Show Google Pay payment sheet when Google Pay payment button is clicked */
function onGooglePaymentButtonClicked() {
//alert("onGooglePaymentButtonClicked");
const paymentDataRequest = getGooglePaymentDataRequest();
paymentDataRequest.transactionInfo = getGoogleTransactionInfo();
const paymentsClient = getGooglePaymentsClient();
paymentsClient.loadPaymentData(paymentDataRequest)
.then(function(paymentData) {
// handle the response
processPayment(paymentData);
})
.catch(function(err) {
// show error in developer console for debugging
console.error(err);
});
}
/**
* Configure support for the Google Pay API
* see link https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataRequest|PaymentDataRequest
* returns {object} PaymentDataRequest fields */
function getGooglePaymentDataRequest() {
//alert("getGooglePaymentDataRequest");
const paymentDataRequest = Object.assign({}, baseRequest);
paymentDataRequest.allowedPaymentMethods = [cardPaymentMethod];
paymentDataRequest.transactionInfo = getGoogleTransactionInfo();
paymentDataRequest.emailRequired = true;
paymentDataRequest.merchantInfo = {
// todo a merchant ID is available for a production environment after approval by Google
// See link https://developers.google.com/pay/api/web/guides/test-and-deploy/integration-checklist|Integration checklist
merchantId: 'BCR2DN6T7OCP34S4'
};
return paymentDataRequest;
}
/**
* Provide Google Pay API with a payment amount, currency, and amount status
* see link https://developers.google.com/pay/api/web/reference/request-objects#TransactionInfo|TransactionInfo
* returns {object} transaction info, suitable for use as transactionInfo property of PaymentDataRequest */
function getGoogleTransactionInfo() {
//fires when the user clicks the CONTINUE Button on the Google Popup Form
//alert("getGoogleTransactionInfo");
return {
countryCode: 'US',
currencyCode: 'USD',
totalPriceStatus: 'FINAL',
// set to cart total
totalPrice: $("#txtPaymentAmount").val()
};
}
/**
* Process payment data returned by the Google Pay API
* param {object} paymentData response from Google Pay API after user approves payment
* see link https://developers.google.com/pay/api/web/reference/response-objects#PaymentData|PaymentData object reference */
function processPayment(paymentData) {
//alert("processPayment");
// show returned data in developer console for debugging
//console.log(paymentData);
// todo pass payment token to your gateway to process payment
//google's oringal code
//paymentToken = paymentData.paymentMethodData.tokenizationData.token;
let token = paymentData.paymentMethodData.tokenizationData.token;
var enc = window.btoa(token);
var EmailAddress = '';
EmailAddress = paymentData.email;
if(EmailAddress == undefined){
EmailAddress = '';
}
var PaymentAmount = $("#txtPaymentAmount").val();
var NameOnAccount = '';
var PaymentCode = $("#hidPaymentCode").val();
var PracticeID = $("#hidPracticeID").val();
var PracticeName = $("#hidPracticeName").val();
var CustomerProfileID = $("#hidCustomerProfileID").val();
var SelectedInvoices = '';
var DiscountedBalancePaid = IsPaymentWithDiscount();
var DiscountedBalanceAmount = $("#hidDiscountedBalance").val();
var DiscountAmount = 0;
if(DiscountedBalancePaid == true && round2Fixed(DiscountedBalanceAmount) == round2Fixed(PaymentAmount)){
DiscountAmount = $("#hidDiscountAmount").val();
}
$.ajax({
url: '/PayBill/CreateTransaction',
cache: false,
data: {practiceID: PracticeID, practiceName: PracticeName, customerProfileID: CustomerProfileID, paymentCode: PaymentCode, nameOnAccount: NameOnAccount, dataDesc: 'COMMON.GOOGLE.INAPP.PAYMENT', dataValue: enc , createPaymentProfile: 0, paymentAmount: PaymentAmount, billingZipCode: null, emailAddress: EmailAddress, Code: 000, transSource: 6, selectedInvoices: SelectedInvoices, discountedBalancePaid: DiscountedBalancePaid, discountAmount: DiscountAmount},
success: function (data) {
if (data.success) {
messageFunc(data.value, "CC");
}
else{
loading("payment"); loading("payment1");
}
},
error: function (xhr) {
//alert("jquery error");
alert(xhr.responseText);
loading("payment"); loading("payment1");
}
});
}
/*************************END Buy with GPay Button Click**********************************/
</script>
<script src="https://applepay.cdn-apple.com/jsapi/v1.1.0/apple-pay-sdk.js"></script>
<iframe src="https://pay.google.com/gp/p/ui/payframe?origin=https%3A%2F%2Fpatientbillhelp.com&mid=" height="0" width="0" allowpaymentrequest="true" style="display: none; visibility: hidden;"></iframe><script type="text/javascript">
if (window.ApplePaySession) {
var promise = ApplePaySession.canMakePaymentsWithActiveCard('merchant.com.patientbillhelp');
promise.then(function(canMakePayments) {
if (canMakePayments)
{
document.getElementById("applePay").style.display = "block";
}
else
{
document.getElementById("got_notactive").style.display = "block";
document.getElementById("applePay").style.display = "block"; //TODO::::::: SHOULD THIS BE SET TO NONE????????
}
});
} else {
$("#divAppleTab").hide();
}
document.getElementById("applePay").onclick = function(evt) {
var paymentAmount = $("#txtPaymentAmount").val()
var subTotalDescr = $("#hidPracticeName").val();
var paymentRequest = {
countryCode: 'US',
currencyCode: 'USD',
supportedNetworks: ['amex', 'masterCard', 'visa', 'discover' ],
merchantCapabilities: [ 'supports3DS'],
total: {
label: 'https://patientpmt.com',
amount: paymentAmount
}
};
var session = new ApplePaySession(3, paymentRequest);
/** ON VALIDATE MERCHANT **/
session.onvalidatemerchant = function(event) {
fetch('/Mobile/GetApplePaymentSession', {
method: 'POST',
headers:
{
'Content-Type': 'application/json'
},
body: JSON.stringify({ validationURL: 'apple-pay-gateway.apple.com' })
}).then(function(response) {
if (!response.ok) {
throw new Error('Network response was not okay!');
}
return response.json();
}).then(function(merchantSession) {
session.completeMerchantValidation(merchantSession)
}).catch(function(error){
console.log('validate merchant failure')
console.log(error)
})
}
/** ON PAYMENT AUTHORIZED **/
session.onpaymentauthorized = function(event) {
var token = event.payment.token.paymentData;
var promise = sendPaymentToken(token);
promise.then(function(success) {
var status;
if (success) {
status = ApplePaySession.STATUS_SUCCESS;
//document.getElementById("applePay").style.display = "none";
//document.getElementById("appleSuccess").style.display = "block";
} else {
status = ApplePaySession.STATUS_FAILURE;
}
/** COMPLETE PAYMENT **/
session.completePayment(status);
});
}
/** ON CANCEL **/
session.oncancel = function(event) {
console.log(event)
}
/** BEGIN **/
session.begin();
function sendPaymentToken(paymentToken) {
return new Promise(function(resolve, reject) {
var EmailAddress = $("#payBillModel_EmailAddress").val();
if(EmailAddress == undefined){
EmailAddress = '';
}
var PaymentAmount = $("#txtPaymentAmount").val();
var NameOnAccount = '';
var PaymentCode = $("#hidPaymentCode").val();
var PracticeID = $("#hidPracticeID").val();
var PracticeName = $("#hidPracticeName").val();
var CustomerProfileID = $("#hidCustomerProfileID").val();
var SelectedInvoices = '';
var DiscountedBalancePaid = IsPaymentWithDiscount();
var DiscountedBalanceAmount = $("#hidDiscountedBalance").val();
var DiscountAmount = 0;
if(DiscountedBalancePaid == true && round2Fixed(DiscountedBalanceAmount) == round2Fixed(PaymentAmount)){
DiscountAmount = $("#hidDiscountAmount").val();
}
var enc = window.btoa(JSON.stringify(paymentToken));
$.ajax({
url: '/PayBill/CreateTransaction',
type: 'POST',
cache: false,
data: {
practiceID: PracticeID,
practiceName: PracticeName,
customerProfileID: CustomerProfileID,
paymentCode: PaymentCode,
nameOnAccount: NameOnAccount,
dataDesc: 'COMMON.APPLE.INAPP.PAYMENT',
dataValue: enc ,
createPaymentProfile: 0,
paymentAmount: PaymentAmount,
billingZipCode: null,
emailAddress: EmailAddress,
Code: 000,
transSource: 6,
selectedInvoices: SelectedInvoices,
discountedBalancePaid: DiscountedBalancePaid,
discountAmount: DiscountAmount
},
success: function(data) {
if (data.success) {
messageFunc(data.value, "CC");
resolve(true);
} else {
loading("payment"); loading("payment1");
reject;
}
},
error: function(xhr) {
alert(xhr.responseText);
loading("payment"); loading("payment1");
reject;
}
});
});
}
};
</script>
</body></html>