86 lines
3.9 KiB
HTML
86 lines
3.9 KiB
HTML
<div id="dvsnappay_hppform">
|
|
<a src=""> Test </a>
|
|
</div>
|
|
<input id="snappayhppform_response" type="hidden" name="snappayhppform_response" />
|
|
|
|
<script id="snappay_hppform"
|
|
src='https://stage.snappayglobal.com/Areas/Interop/Scripts/HPPForm.js'
|
|
data-target="#snappayhppform_response"
|
|
data-callback="submit_external_ecommerce"
|
|
data-accountid='1003003518'
|
|
data-customerid='100'
|
|
data-currencycode='USD'
|
|
data-transactionamount='123.45'
|
|
data-merchantid='496695144562'
|
|
data-paymentmode='CC' // CC for credit card
|
|
data-cvvrequired='Y'
|
|
data-enableemailreceipt='Y'
|
|
data-redirectionurl='https://northpass.com'
|
|
data-snappayurl='https://stage.snappayglobal.com/Interop/HostedPaymentPage'
|
|
data-firstname='John'
|
|
data-lastname='Smith'
|
|
data-addressline1='850 Maple Ave'
|
|
data-city='Aurora'
|
|
data-state='IL'
|
|
data-zip='60504'
|
|
data-country='US'
|
|
data-email='john.smith@abcd.com'
|
|
data-phonenumber='6301234567'
|
|
data-signature='ccq3/65vra5FuhV++oFZxBdIvKn9W8PCsd@OIdDHIE='>
|
|
</script>
|
|
|
|
|
|
<!-- From Srinavas -->
|
|
|
|
<script type="text/javascript">
|
|
function myclick() {
|
|
var isCVV = "N";
|
|
var isEmail = "N";
|
|
var abcd = document.getElementsByClassName('cvvreq');
|
|
if (abcd[0].checked) {
|
|
isCVV = "Y";
|
|
}
|
|
var pqrs = document.getElementsByClassName('emailrecep');
|
|
if (pqrs[0].checked) {
|
|
isEmail = "Y";
|
|
}
|
|
var pm = document.getElementsByName('paymentmode');
|
|
var selectedPM = "CC";
|
|
for (i = 0; i < pm.length; i++) {
|
|
if (pm[i].checked)
|
|
selectedPM = pm[i].value;
|
|
}
|
|
var mylink = document.getElementById('mylink');
|
|
mylink.onclick = function () {
|
|
var t = document.createElement("script");
|
|
t.setAttribute("id", "snappay_hppform");
|
|
t.setAttribute("src", "https://stage.snappayglobal.com/Areas/Interop/Scripts/HPPForm.js");
|
|
t.setAttribute("data-target", "#snappayhppform_response");
|
|
t.setAttribute("data-callback", "submit_external_ecommerce");
|
|
t.setAttribute("data-accountid", document.getElementById("accountid").value);
|
|
t.setAttribute("data-customerid", document.getElementById("customerid").value);
|
|
t.setAttribute("data-merchantid", document.getElementById("merchantid").value);
|
|
t.setAttribute("data-transactionamount", document.getElementById("transactionamount").value);
|
|
t.setAttribute("data-currencycode", document.getElementById("currencycode").value);
|
|
t.setAttribute("data-paymentmode", selectedPM);
|
|
t.setAttribute("data-cvvrequired", isCVV);
|
|
t.setAttribute("data-emailreceipt", isEmail);
|
|
t.setAttribute("data-udf0", document.getElementById("udf0").value);
|
|
t.setAttribute("data-udf1", document.getElementById("udf1").value);
|
|
t.setAttribute("data-udf2", document.getElementById("udf2").value);
|
|
t.setAttribute("data-udf3", document.getElementById("udf3").value);
|
|
t.setAttribute("data-udf4", document.getElementById("udf4").value);
|
|
t.setAttribute("data-udf5", document.getElementById("udf5").value);
|
|
t.setAttribute("data-udf6", document.getElementById("udf6").value);
|
|
t.setAttribute("data-udf7", document.getElementById("udf7").value);
|
|
t.setAttribute("data-udf8", document.getElementById("udf8").value);
|
|
t.setAttribute("data-udf9", document.getElementById("udf9").value);
|
|
t.setAttribute("data-redirectionurl", "https://www.google.com");
|
|
t.setAttribute("data-snappayurl", "https://stage.snappayglobal.com/Interop/HostedPaymentPage");
|
|
document.getElementsByTagName("head")[0].appendChild(t);
|
|
return false;
|
|
}
|
|
document.getElementById('mylink').click();
|
|
}
|
|
</script>
|