var merchantFunction = function(){
console.log(“Close popup!”);
};
KPayment.onClose(merchantFunction);
setTimeout(KPayment.setAmount(500), 5000);
function onKeyupAmount(ele){
var val = document.getElementById(“AMOUNT”).value;
var amt = parseFloat(val).toFixed(2);
KPayment.setAmount(amt);
return true;
}
function onKeyupDescription(ele){
var val = document.getElementById(“Description”).value;
KPayment.setDescription(val);
return true;
}
function onKeyupCusid(ele){
var val = document.getElementById(“Cusid”).value;
KPayment.setCustomerId(val);
return true;
}
function onKeyupName(ele){
var val = document.getElementById(“Name”).value;
KPayment.setName(val);
return true;
}
function onclickCardtype(ele){
var thisid = ele.id;
if(thisid==”cardtype1″){
document.getElementsByClassName(“cardtype1″)[0].style.display=”table-cell”;
document.getElementsByClassName(“cardtype2″)[0].style.display=”none”;
}else{
document.getElementsByClassName(“cardtype2″)[0].style.display=”table-cell”;
document.getElementsByClassName(“cardtype1″)[0].style.display=”none”;
}
return true;
}
function checkAmount(ele){
var val = document.getElementById(“AMOUNT”).value;
var thisID = ele.getAttribute(‘id’);
if(val===”){
alert(“Please insert amount.”);
document.getElementById(“AMOUNT”).focus();
}else{
var amt = parseFloat(val).toFixed(2);
KPayment.setAmount(amt);
if(thisID==”type1″){
KPayment.show();
}else{
document.getElementById(“postForm”).submit();
}
}
return true;
}
.radioBtn{color:black; font-size: 14px; padding: 10px;}
.radioBtn:hover{cursor: pointer;}
.cardicon{width:78px; height:50px;}
Card type:
Visa, MasterCard & JCB
UnionPay
Amount THB:
Message:
Phone number: