hideRecurringBeginDate = "0";
hideRecurringEndDate = 0;
if(typeof String.prototype.endsWith !== 'function') {
String.prototype.endsWith = function(suffix) {
return this.indexOf(suffix, this.length - suffix.length) !== -1;
}
}
// Informational: sample event listener handlers provided for client development ref: IATS_RaiseEvent
//12/22/2018 older ie browsers not currently patched by Microsoft as tested on browserstack do not support window.addEventListener
if (window) { if (!window.addEventListener) { window.addEventListener = function(message, embeddedFunction) { }; } } // work around
window.addEventListener('IATS_TRANSACTIONSUCCESS', function(e){
// console.log(e.data);
// alert("IATS_TRANSACTIONSUCCESS");
});
window.addEventListener('IATS_TRANSACTIONFAILURE', function(e){
// console.log(e.data);
// alert("IATS_TRANSACTIONFAILURE:");
});
window.addEventListener('IATS_RECURRINGTRANSACTIONSUCCESS', function(e){
// alert("IATS_RECURRINGTRANSACTIONSUCCESS");
// console.log(e.data);
});
window.addEventListener('IATS_RECURRINGTRANSACTIONFAILURE', function(e){
// console.log(e.data);
// alert("IATS_RECURRINGTRANSACTIONFAILURE");
});
// IE 8 forEach fix
if (!Array.prototype.forEach)
{
Array.prototype.forEach = function (fn, scope)
{
for (var i = 0, len = this.length; i < len; ++i)
{
fn.call(scope || this, this[i], i, this);
}
}
}
// IE 8 indexOf utility
if (!Array.prototype.indexOf)
{
Array.prototype.indexOf = function(elt /*, from*/)
{
var len = this.length >>> 0;
var from = Number(arguments[1]) || 0;
from = (from < 0)
? Math.ceil(from)
: Math.floor(from);
if (from < 0)
from += len;
for (; from < len; from++)
{
if (from in this &&
this[from] === elt)
return from;
}
return -1;
};
}
var hasCaptcha;
function IATS_RaiseEvent(eventType, transID, amount, errorcode){
var event; // The custom event that will be created
//modern browser
if(typeof CustomEvent === 'function'){
event = new CustomEvent(eventType, {
//details: details,
bubbles: true,
cancelable: true
});
//newest IE
} else if (document.createEvent) {
event = document.createEvent('CustomEvent');
event.initCustomEvent(eventType, true, true,null);
//older version of IE
} else {
event = document.createEventObject();
event.eventType = eventType;
}
event.data = {eventType: eventType, transID:transID, amount:amount, errorcode: errorcode};
event.eventName = eventType;
if (document.createEvent) {
window.dispatchEvent(event);
}
else if (window.fireEvent) {
window.fireEvent("on" + event.eventType, event);
}
}
function IATS_RaiseTransactionSuccessEvent(transID, amount, errorcode){
IATS_RaiseEvent('IATS_TRANSACTIONSUCCESS', transID, amount, errorcode);
}
function IATS_RaiseTransactionFailureEvent(transID, amount, errorcode){
IATS_RaiseEvent('IATS_TRANSACTIONFAILURE', transID, amount, errorcode);
}
function IATS_RaiseTransactionRecurringSuccessEvent(transID, amount, errorcode){
IATS_RaiseEvent('IATS_RECURRINGTRANSACTIONSUCCESS', transID, amount, errorcode);
}
function IATS_RaiseTransactionRecurringFailureEvent(transID, amount, errorcode){
IATS_RaiseEvent('IATS_RECURRINGTRANSACTIONFAILURE', transID, amount, errorcode);
}
// This function will allow or restrict characters per the regex sent at the point
// the control is being built. "Allow" or "restrict" attributes will be added to the controls.
function IATSRestrictCharacters(myfield, e) {
if (!e) var e = window.event
if (e.keyCode) code = e.keyCode;
else if (e.which) code = e.which;
var character = String.fromCharCode(code);
// Get the source element.
var elem;
if (e.srcElement) elem = e.srcElement;
else if (e.target) elem = e.target;
// Get the element's regex value.
var allow = elem.getAttribute("allow");
var restrict = elem.getAttribute("restrict");
if (allow != null) {
var regex = new RegExp(allow);
if (regex.test(e.key)) {
return true;
} else {
//alert("Restricted Character = '" + character + "' \n" + "Code = " + code + "\n" + "e.key = " + e.key);
return false;
}
}
else if (restrict != null) {
var regex = new RegExp(restrict);
//alert("regex = " + regex);
if (regex.test(e.key)) {
//alert("Restricted Character = '" + character + "' \n" + "Code = " + code + "\n" + "e.key = " + e.key);
return false;
} else {
return true;
}
}
}
theIATSPaymentBoxCore = new function IATSPaymentBoxCore()
{
this.titleOptionIndex = -1;
//Add UK version
this.version = "NA";
this.currency = "1";
this.ShowTlsMessage = "False"
//Image URL
this.serverURL = "www.iatspayments.com";
if(this.version=="UK")
this.serverURL = "www.uk.iatspayments.com";
this.getScript = IATSGetScript;
this.Script = this.getScript();
if (this.Script==null)
return;
// Title and Description.
this.Title = "

";
this.Description = "";
this.DirectDebitPage1 = "";
this.DirectDebitPage2 = "";
this.DirectDebitPage3 = "";
this.DirectDebitPage4 = "";
this.DirectDebitPage5 = "";
// For Amount List
this.EventPaymentCurrencySign="$";
this.EventPaymentCurrencySignAfterAmount="";
this.AmountListTitle = "Select Amount";
this.AmountList = [{Desc:" ",Amount:"1000.00",QtyLabel:"",Qty:0,DefaultChecked:"",QtyMax:"0"}
,{Desc:" ",Amount:"500.00",QtyLabel:"",Qty:0,DefaultChecked:"",QtyMax:"0"}
,{Desc:" ",Amount:"250.00",QtyLabel:"",Qty:0,DefaultChecked:"",QtyMax:"0"}
,{Desc:" ",Amount:"100.00",QtyLabel:"",Qty:0,DefaultChecked:"",QtyMax:"0"}
,{Desc:" ",Amount:"75.00",QtyLabel:"",Qty:0,DefaultChecked:"",QtyMax:"0"}
,{Desc:" ",Amount:"50.00",QtyLabel:"",Qty:0,DefaultChecked:"",QtyMax:"0"}
,{Desc:" ",Amount:"25.00",QtyLabel:"",Qty:0,DefaultChecked:"",QtyMax:"0"}
,{Desc:" ",Amount:"10.00",QtyLabel:"",Qty:0,DefaultChecked:"",QtyMax:"0"}
,{Desc:" ",Amount:"5.00",QtyLabel:"",Qty:0,DefaultChecked:"",QtyMax:"0"}
,{Desc:" ",Amount:"1.00",QtyLabel:"",Qty:0,DefaultChecked:"",QtyMax:"0"}
];
this.AmountOtherList = [{Label:"Other ",MinimumLabel1:"Minimum is $1 ",Minimum:1.00,MinimumErrorMessage:"Input amount must be more than the minimum.",Default:""}
];
this.ShoppingCartList = [{"AmountID":1,"AmountLabel":"","Price":1000.00,"SKU":"Quick SKU","QuantityLabel":"Qty","QuantityDefault":0,"Option":[]},{"AmountID":2,"AmountLabel":"","Price":500.00,"SKU":"Quick SKU","QuantityLabel":"Qty","QuantityDefault":0,"Option":[]},{"AmountID":3,"AmountLabel":"","Price":250.00,"SKU":"Quick SKU","QuantityLabel":"Qty","QuantityDefault":0,"Option":[]},{"AmountID":4,"AmountLabel":"","Price":100.00,"SKU":"Quick SKU","QuantityLabel":"Qty","QuantityDefault":0,"Option":[]},{"AmountID":5,"AmountLabel":"","Price":75.00,"SKU":"Quick SKU","QuantityLabel":"Qty","QuantityDefault":0,"Option":[]},{"AmountID":6,"AmountLabel":"","Price":50.00,"SKU":"Quick SKU","QuantityLabel":"Qty","QuantityDefault":0,"Option":[]},{"AmountID":7,"AmountLabel":"","Price":25.00,"SKU":"Quick SKU","QuantityLabel":"Qty","QuantityDefault":0,"Option":[]},{"AmountID":8,"AmountLabel":"","Price":10.00,"SKU":"Quick SKU","QuantityLabel":"Qty","QuantityDefault":0,"Option":[]},{"AmountID":9,"AmountLabel":"","Price":5.00,"SKU":"Quick SKU","QuantityLabel":"Qty","QuantityDefault":0,"Option":[]},{"AmountID":10,"AmountLabel":"","Price":1.00,"SKU":"Quick SKU","QuantityLabel":"Qty","QuantityDefault":0,"Option":[]}];
this.ShoppingCartItemCounter = 0;
this.ShoppingCartTotal = 0.00;
this.EnableShoppingCart = "0";
this.AmountEnableMultiSelection = "0";
this.AmountEnableQty = "0";
this.ProcessButtonLabel = "Process";
this.AgencyCodeHash = "F4BCC9FF23EF8DC34EC48A9DBCF0571B43BB0BF2";
// For Profile Items
this.ProfileListTitle = "Enter Donation Information";
this.PrifileItemList = [{Desc:"Salutation",Name:"Title",Visible:1,Required:1,Type:"Text",MiniLen:1,ErrorMsg:"Title is Required",Value:"",MaxLen:"29"}
,{Desc:"First Name",Name:"FirstName",Visible:1,Required:1,Type:"Text",MiniLen:1,ErrorMsg:"First Name is Required",Value:"",MaxLen:"39"}
,{Desc:"Last Name",Name:"LastName",Visible:1,Required:1,Type:"Text",MiniLen:1,ErrorMsg:"Last Name is Required",Value:"",MaxLen:"39"}
,{Desc:"Company Name",Name:"CompanyName",Visible:1,Required:0,Type:"Text",MiniLen:1,ErrorMsg:"Company Name is Required",Value:"",MaxLen:"100"}
,{Desc:"Address",Name:"Address",Visible:1,Required:1,Type:"Text",MiniLen:1,ErrorMsg:"Address is Required",Value:"",MaxLen:"99"}
,{Desc:"City",Name:"City",Visible:1,Required:1,Type:"Text",MiniLen:1,ErrorMsg:"City is Required",Value:"",MaxLen:"39"}
,{Desc:"Country",Name:"Country",Visible:1,Required:1,Type:"Text",MiniLen:1,ErrorMsg:"Country is Required",Value:"",MaxLen:"39"}
,{Desc:"StateProvince",Name:"State",Visible:1,Required:1,Type:"Text",MiniLen:1,ErrorMsg:"StateProvince is Required",Value:"",MaxLen:"39"}
,{Desc:"ZipPostal Code",Name:"ZipCode",Visible:1,Required:1,Type:"Text",MiniLen:1,ErrorMsg:"ZipPostal Code is Required",Value:"",MaxLen:"10"}
,{Desc:"Phone",Name:"Phone",Visible:0,Required:0,Type:"Text",MiniLen:1,ErrorMsg:"Phone is Invalid",Value:"",MaxLen:"39"}
,{Desc:"Mobile",Name:"Phone2",Visible:1,Required:1,Type:"Text",MiniLen:1,ErrorMsg:"Mobile is Invalid",Value:"",MaxLen:"39"}
,{Desc:"Fax",Name:"Fax",Visible:0,Required:0,Type:"Text",MiniLen:1,ErrorMsg:"Fax is Invalid",Value:"",MaxLen:"39"}
,{Desc:"Email",Name:"EMail",Visible:1,Required:1,Type:"Text",MiniLen:1,ErrorMsg:"Email is Required",Value:"",MaxLen:"256"}
,{Desc:"Re-enter Email",Name:"ReEnterEmail",Visible:1,Required:1,Type:"Text",MiniLen:1,ErrorMsg:"Email address entries must match.",Value:"",MaxLen:"256"}
,{Desc:"Comment",Name:"Comment",Visible:0,Required:0,Type:"Text",MiniLen:1,ErrorMsg:"Comment is Required",Value:"",MaxLen:"250"}
];
this.PrifileItemList_Items = [{Desc:"Honor or Memorial Gift?",Name:"Item1",Visible:1,Required:1,Type:"Text",MiniLen:1,ErrorMsg:"Entry is Required",Value:"",MaxLen:"250",EnableSelect:"1",SelectItems:"No@###@@###@Yes",EnableMoreInfo:"0",MoreInfo:""}
,{Desc:"Type of Tribute?",Name:"Item2",Visible:1,Required:0,Type:"Text",MiniLen:1,ErrorMsg:"Item 2 is Required",Value:"",MaxLen:"250",EnableSelect:"1",SelectItems:"In Honor@###@@###@In Memory",EnableMoreInfo:"0",MoreInfo:""}
,{Desc:"In Honor or In Memory Name?",Name:"Item3",Visible:1,Required:0,Type:"Text",MiniLen:1,ErrorMsg:"Item 3 is Required",Value:"",MaxLen:"250",EnableSelect:"0",SelectItems:"",EnableMoreInfo:"0",MoreInfo:""}
,{Desc:"Item 4",Name:"Item4",Visible:0,Required:0,Type:"Text",MiniLen:1,ErrorMsg:"Item 4 is Required",Value:"",MaxLen:"250",EnableSelect:"0",SelectItems:"",EnableMoreInfo:"0",MoreInfo:""}
,{Desc:"Item 5",Name:"Item5",Visible:0,Required:0,Type:"Text",MiniLen:1,ErrorMsg:"Item 5 is Required",Value:"",MaxLen:"250",EnableSelect:"0",SelectItems:"",EnableMoreInfo:"0",MoreInfo:""}
,{Desc:"Item 6",Name:"Item6",Visible:0,Required:0,Type:"Text",MiniLen:1,ErrorMsg:"Item 6 is Required",Value:"",MaxLen:"250",EnableSelect:"0",SelectItems:"",EnableMoreInfo:"0",MoreInfo:""}
,{Desc:"Item 7",Name:"Item7",Visible:0,Required:0,Type:"Text",MiniLen:1,ErrorMsg:"Item 7 is Required",Value:"",MaxLen:"250",EnableSelect:"0",SelectItems:"",EnableMoreInfo:"0",MoreInfo:""}
,{Desc:"Item 8",Name:"Item8",Visible:0,Required:0,Type:"Text",MiniLen:1,ErrorMsg:"Item 8 is Required",Value:"",MaxLen:"250",EnableSelect:"0",SelectItems:"",EnableMoreInfo:"0",MoreInfo:""}
,{Desc:"Item 9",Name:"Item9",Visible:0,Required:0,Type:"Text",MiniLen:1,ErrorMsg:"Item 9 is Required",Value:"",MaxLen:"250",EnableSelect:"0",SelectItems:"",EnableMoreInfo:"0",MoreInfo:""}
,{Desc:"Item 10",Name:"Item10",Visible:0,Required:0,Type:"Text",MiniLen:1,ErrorMsg:"Item 10 is Required",Value:"",MaxLen:"250",EnableSelect:"0",SelectItems:"",EnableMoreInfo:"0",MoreInfo:""}
,{Desc:"Item 11",Name:"Item11",Visible:0,Required:0,Type:"Text",MiniLen:1,ErrorMsg:"Item 11 is Required",Value:"",MaxLen:"250",EnableSelect:"0",SelectItems:"",EnableMoreInfo:"0",MoreInfo:""}
,{Desc:"Item 12",Name:"Item12",Visible:0,Required:0,Type:"Text",MiniLen:1,ErrorMsg:"Item 12 is Required",Value:"",MaxLen:"250",EnableSelect:"0",SelectItems:"",EnableMoreInfo:"0",MoreInfo:""}
,{Desc:"Item 13",Name:"Item13",Visible:0,Required:0,Type:"Text",MiniLen:1,ErrorMsg:"Item 13 is Required",Value:"",MaxLen:"250",EnableSelect:"0",SelectItems:"",EnableMoreInfo:"0",MoreInfo:""}
,{Desc:"Item 14",Name:"Item14",Visible:0,Required:0,Type:"Text",MiniLen:1,ErrorMsg:"Item 14 is Required",Value:"",MaxLen:"250",EnableSelect:"0",SelectItems:"",EnableMoreInfo:"0",MoreInfo:""}
,{Desc:"Item 15",Name:"Item15",Visible:0,Required:0,Type:"Text",MiniLen:1,ErrorMsg:"Item 15 is Required",Value:"",MaxLen:"250",EnableSelect:"0",SelectItems:"",EnableMoreInfo:"0",MoreInfo:""}
];
this.RejectList = [{Code:"1",Message:"Process permission denied."}
,{Code:"4",Message:"Incorrect expiration date."}
,{Code:"5",Message:"Invalid transaction information. Verify and re-enter information."}
,{Code:"12",Message:"Incorrect CVV2 or expiry date."}
,{Code:"15",Message:"General decline. Please call the number on the back of the credit card."}
,{Code:"19",Message:"Incorrect CVV2 security code."}
,{Code:"40",Message:"Invalid card/account number."}
,{Code:"41",Message:"Invalid expiry date."}
,{Code:"43",Message:"Incorrect card holder's address."}
];
this.RejectDefaultMessage = "General decline.";
this.ClientZipcodeError = "";
this.ClientEmailError = "";
// For Payment Info
this.EventPaymentNote = "
Bold field is required input";
this.PaymentAccountNumberDesc = "Card Number";
this.PaymentExpiryDesc = "Expiry";
this.PaymentCVV2Desc = "CVV2"
this.PaymentCVV2Required = "Checked"
this.AccountNumberErrorMessage="Card Number is Required";
this.CVV2ErrorMessage="CVV2 is Required";
this.ExpiryDateErrorMessage="Expiry is Required";
// For ACH
this.USRoutingNoErrorMessage = "Routing No. is Required";
this.USRoutingNoLabel = "Routing No.";
this.USAccountNoErrorMessage = "Account No. is Required";
this.ReEnterUSAccountNoErrorMessage = "Account number entries must match.";
this.CANTransitNoErrorMessage = "Transit No. is Required";
this.CANBankNoErrorMessage = "Bank No. is Required";
this.CANAccountNoErrorMessage = "Account No. is Required";
this.ReEnterCANAccountNoErrorMessage = "Account number entries must match.";
this.USAccountNoLabel = "Account No.";
this.ReEnterUSAccountNoLabel = "Re-enter Account No.";
this.CANTransitNoLabel = "Transit No.";
this.CANBankNoLabel = "Bank No.";
this.CANAccountNoLabel = "Account No.";
this.ReEnterCANAccountNoLabel = "Re-enter Account No.";
this.UKBankNoErrorMessage = "Bank Code is Required";
this.UKSortNoErrorMessage = "Sort code is Required";
this.UKAccountNoErrorMessage = "Account No. is Required";
this.ReEnterUKAccountNoErrorMessage = "Account number entries must match.";
this.UKBankNoLabel = "Bank Code";
this.UKSortNoLabel = "Sort Code";
this.UKAccountNoLabel = "Account No.";
this.ReEnterUKAccountNoLabel = "Re-enter Account No.";
this.UKSEPABankIdLabel = "";
this.UKSEPABankIdErrorMessage = "";
this.NoDecimal = "Checked";
this.AccountTypeLabel = "Account Type";
this.CheckingLabel = "Checking";
this.SavingLabel = "Savings";
//alert(this.UKBankNoLabel);
this.ConnectingToServerMessage = "Connecting to https://www.iatspayments.com to process.";
this.BackButtonText = "Back";
this.YourDataIsSecureText = "Learn More";
this.YourDataIsSecureImage = "//www.iatspayments.com/paymentbox/img/b_your_data_is_secure.png";
this.ErrorMessage = "Please correct error and resubmit.";
// For layout
this.BasicLayoutClassName = "IATS_PaymentLabelOnTop";
//Option of items using dropdown list and radio buttons
this.ItemFormat = "RadioButtons";
// for Country
// Add international country
this.StateFlag = false;
this.CountryList = [{Name:"United States", Code:"US"},
{Name:"Canada", Code:"CA"},
{Name:"United Kingdom", Code:"GB"},
{Name:"Aaland Islands", Code:"AX"},
{Name:"Afghanistan", Code:"AF"},
{Name:"Albania", Code:"AL"},
{Name:"Algeria", Code:"DZ"},
{Name:"American Samoa", Code:"AS"},
{Name:"Andorra", Code:"AD"},
{Name:"Angola", Code:"AO"},
{Name:"Anguilla", Code:"AI"},
{Name:"Antarctica", Code:"AQ"},
{Name:"Antigua and Barbuda", Code:"AG"},
{Name:"Argentina", Code:"AR"},
{Name:"Armenia", Code:"AM"},
{Name:"Aruba", Code:"AW"},
{Name:"Australia", Code:"AU"},
{Name:"Austria", Code:"AT"},
{Name:"Azerbaijan", Code:"AZ"},
{Name:"Bahamas", Code:"BS"},
{Name:"Bahrain", Code:"BH"},
{Name:"Bangladesh", Code:"BD"},
{Name:"Barbados", Code:"BB"},
{Name:"Belarus", Code:"BY"},
{Name:"Belgium", Code:"BE"},
{Name:"Belize", Code:"BZ"},
{Name:"Benin", Code:"BJ"},
{Name:"Bermuda", Code:"BM"},
{Name:"Bhutan", Code:"BT"},
{Name:"Bolivia", Code:"BO"},
{Name:"Bosnia and Herzegowina", Code:"BA"},
{Name:"Botswana", Code:"BW"},
{Name:"Bouvet Island", Code:"BV"},
{Name:"Brazil", Code:"BR"},
{Name:"British Indian Ocean Territory", Code:"IO"},
{Name:"British Virgin Islands", Code:"VG"},
{Name:"Brunei Darussalam", Code:"BN"},
{Name:"Bulgaria", Code:"BG"},
{Name:"Burkina Faso", Code:"BF"},
{Name:"Burundi", Code:"BI"},
{Name:"Cambodia", Code:"KH"},
{Name:"Cameroon", Code:"CM"},
{Name:"Cape Verde", Code:"CV"},
{Name:"Cayman Islands", Code:"KY"},
{Name:"Central African Republic", Code:"CF"},
{Name:"Chad", Code:"TD"},
{Name:"Chile", Code:"CL"},
{Name:"China", Code:"CN"},
{Name:"Christmas Island", Code:"CX"},
{Name:"Cocos Islands", Code:"CC"},
{Name:"Colombia", Code:"CO"},
{Name:"Comoros", Code:"KM"},
{Name:"Congo Democratic Republic", Code:"CD"},
{Name:"Congo Republic", Code:"CG"},
{Name:"Cook Islands", Code:"CK"},
{Name:"Costa rica", Code:"CR"},
{Name:"Cote divoire", Code:"CI"},
{Name:"Croatia", Code:"HR"},
{Name:"Cuba", Code:"CU"},
{Name:"Cyprus", Code:"CY"},
{Name:"Czech Republic", Code:"CZ"},
{Name:"Denmark", Code:"DK"},
{Name:"Djibouti", Code:"DJ"},
{Name:"Dominica", Code:"DM"},
{Name:"Dominican Republic", Code:"DO"},
{Name:"Ecuador", Code:"EC"},
{Name:"Egypt", Code:"EG"},
{Name:"El Salvador", Code:"SV"},
{Name:"Equatorial Guinea", Code:"GQ"},
{Name:"Eritrea", Code:"ER"},
{Name:"Estonia", Code:"EE"},
{Name:"Ethiopia", Code:"ET"},
{Name:"Falkland Islands", Code:"FK"},
{Name:"Faroe Islands", Code:"FO"},
{Name:"Fiji", Code:"BJ"},
{Name:"Finland", Code:"FI"},
{Name:"France", Code:"FR"},
{Name:"French Guiana", Code:"GF"},
{Name:"French Polynesia", Code:"PF"},
{Name:"French Southern Territories", Code:"TF"},
{Name:"Gabon", Code:"GA"},
{Name:"Gambia", Code:"GM"},
{Name:"Georgia", Code:"GE"},
{Name:"Germany", Code:"DE"},
{Name:"Ghana", Code:"GH"},
{Name:"Gibraltar", Code:"GI"},
{Name:"Greece", Code:"GR"},
{Name:"Greenland", Code:"GL"},
{Name:"Grenada", Code:"GD"},
{Name:"Guadeloupe", Code:"GP"},
{Name:"Guam", Code:"GU"},
{Name:"Guatemala", Code:"GT"},
{Name:"Guinea", Code:"GN"},
{Name:"Guinea-Bissau", Code:"GW"},
{Name:"Guyana", Code:"GY"},
{Name:"Haiti", Code:"HT"},
{Name:"Heard and McDonald Islands", Code:"HM"},
{Name:"Honduras", Code:"HN"},
{Name:"Hong Kong", Code:"HK"},
{Name:"Hungary", Code:"HU"},
{Name:"Iceland", Code:"IS"},
{Name:"India", Code:"IN"},
{Name:"Indonesia", Code:"ID"},
{Name:"Ireland", Code:"IE"},
{Name:"Iran", Code:"IR"},
{Name:"Iraq", Code:"IQ"},
{Name:"Isle of Man", Code:"IM"},
{Name:"Israel", Code:"IL"},
{Name:"Italy", Code:"IT"},
{Name:"Jamaica", Code:"JM"},
{Name:"Japan", Code:"JP"},
{Name:"Jordan", Code:"JO"},
{Name:"Kazakhstan", Code:"KZ"},
{Name:"Kenya", Code:"KE"},
{Name:"Kiribati", Code:"KI"},
{Name:"Kuwait", Code:"KW"},
{Name:"Kyrgyzstan", Code:"KG"},
{Name:"Lao Peoples Democratic Republic", Code:"LA"},
{Name:"Latvia", Code:"LV"},
{Name:"Lebanon", Code:"LB"},
{Name:"Lesotho", Code:"LS"},
{Name:"Liberia", Code:"LR"},
{Name:"Libya", Code:"LY"},
{Name:"Liechtenstein", Code:"LI"},
{Name:"Lithuania", Code:"LT"},
{Name:"Luxembourg", Code:"LU"},
{Name:"Macau", Code:"MO"},
{Name:"Macedonia", Code:"MK"},
{Name:"Madagascar", Code:"MG"},
{Name:"Malawi", Code:"MW"},
{Name:"Malaysia", Code:"MY"},
{Name:"Maldives", Code:"MV"},
{Name:"Mali", Code:"ML"},
{Name:"Malta", Code:"MT"},
{Name:"Marshall Islands", Code:"MH"},
{Name:"Martinique", Code:"MQ"},
{Name:"Mauritania", Code:"MR"},
{Name:"Mauritius", Code:"MU"},
{Name:"Mayotte", Code:"YT"},
{Name:"Mexico", Code:"MX"},
{Name:"Micronesia", Code:"FM"},
{Name:"Moldova", Code:"MD"},
{Name:"Monaco", Code:"MC"},
{Name:"Mongolia", Code:"MN"},
{Name:"Montserrat", Code:"MS"},
{Name:"Morocco", Code:"MA"},
{Name:"Mozambique", Code:"MZ"},
{Name:"Myanmar", Code:"MM"},
{Name:"Namibia", Code:"NA"},
{Name:"Netherlands", Code:"NL"},
{Name:"Netherlands Antilles", Code:"AN"},
{Name:"Republic of Nauru", Code:"NR"},
{Name:"Nepal", Code:"NP"},
{Name:"New Caledonia", Code:"NC"},
{Name:"New Zealand", Code:"NZ"},
{Name:"Nicaragua", Code:"NI"},
{Name:"Niger", Code:"NE"},
{Name:"Nigeria", Code:"NG"},
{Name:"Niue", Code:"NU"},
{Name:"Norfolk Island", Code:"NF"},
{Name:"North Korea", Code:"KP"},
{Name:"Northern Mariana Islands", Code:"MP"},
{Name:"Norway", Code:"NO"},
{Name:"Oman", Code:"OM"},
{Name:"Pakistan", Code:"PK"},
{Name:"Palau", Code:"PW"},
{Name:"Palestinian Territory", Code:"PS"},
{Name:"Panama", Code:"PA"},
{Name:"Papua New Guinea", Code:"PG"},
{Name:"Paraguay", Code:"PY"},
{Name:"Peru", Code:"PE"},
{Name:"Philippines", Code:"PH"},
{Name:"Pitcairn", Code:"PN"},
{Name:"Poland", Code:"PL"},
{Name:"Portugal", Code:"PT"},
{Name:"Puerto Rico", Code:"PR"},
{Name:"Qatar", Code:"QA"},
{Name:"Reunion", Code:"RE"},
{Name:"Romania", Code:"RO"},
{Name:"Russian Federation", Code:"RU"},
{Name:"Rwanda", Code:"RW"},
{Name:"Sehara, Western", Code:"EH"},
{Name:"Saint Barthelemy", Code:"BL"},
{Name:"Saint Helena", Code:"SH"},
{Name:"Saint Kitts and Nevis", Code:"KN"},
{Name:"Saint Lucia", Code:"LC"},
{Name:"Saint Martin", Code:"MF"},
{Name:"S Pierre & Miquelon", Code:"PM"},
{Name:"S Vincent & Grenadines", Code:"VC"},
{Name:"Samoa", Code:"WS"},
{Name:"San Marino", Code:"SM"},
{Name:"Sao Tome and Principe", Code:"ST"},
{Name:"Saudi Arabia", Code:"SA"},
{Name:"Senegal", Code:"SN"},
{Name:"Serbia", Code:"RS"},
{Name:"Seychelles", Code:"SC"},
{Name:"Sierra Leone", Code:"SL"},
{Name:"Singapore", Code:"SG"},
{Name:"Slovakia", Code:"SK"},
{Name:"Slovenia", Code:"SI"},
{Name:"Solomon Islands", Code:"SB"},
{Name:"Somalia", Code:"SO"},
{Name:"South Africa", Code:"ZA"},
{Name:"South Korea", Code:"KR"},
{Name:"S.George & S.Sandwich", Code:"GS"},
{Name:"Spain", Code:"ES"},
{Name:"Sri Lanka", Code:"LK"},
{Name:"Sudan", Code:"SD"},
{Name:"Suriname", Code:"SR"},
{Name:"Svalbard & Jan Mayen Is.", Code:"SJ"},
{Name:"Swaziland", Code:"SZ"},
{Name:"Sweden", Code:"SE"},
{Name:"Switzerland", Code:"CH"},
{Name:"Syrian Arab Republic", Code:"SY"},
{Name:"Taiwan", Code:"TW"},
{Name:"Tajikistan", Code:"TJ"},
{Name:"Tanzania, United Rep. of", Code:"TZ"},
{Name:"Thailand", Code:"TH"},
{Name:"Timor-Leste", Code:"TL"},
{Name:"Togo", Code:"TG"},
{Name:"Tokelau", Code:"TK"},
{Name:"Trinidad & Tobago", Code:"TT"},
{Name:"Tunisia", Code:"TN"},
{Name:"Turkey", Code:"TR"},
{Name:"Turkmenistan", Code:"TM"},
{Name:"Turks and Caicos Islands", Code:"TC"},
{Name:"Tuvalu", Code:"TC"},
{Name:"Tuvalu", Code:"TV"},
{Name:"Uganda", Code:"UG"},
{Name:"Ukraine", Code:"UA"},
{Name:"United Arab Emirates", Code:"AE"},
{Name:"Uruguay", Code:"UY"},
{Name:"US Virgin Islands", Code:"VI"},
{Name:"Uzbekistan", Code:"UZ"},
{Name:"Vanuatu", Code:"VU"},
{Name:"Venezuela", Code:"VE"},
{Name:"Viet Nam", Code:"VN"},
{Name:"Western Sahara", Code:"EH"},
{Name:"Yemen", Code:"YE"},
{Name:"Zambia", Code:"ZM"},
{Name:"Zimbabwe", Code:"ZW"}];
this.CountryList2 = [{Name:"United States", Code:"USA"},
{Name:"Canada", Code:"CAN"}];
// for State
this.USAStateList = [{Name:"Alabama", Code:"AL"},
{Name:"Alaska", Code:"AK"},
{Name:"Arizona", Code:"AZ"},
{Name:"Arkansas", Code:"AR"},
{Name:"California", Code:"CA"},
{Name:"Colorado", Code:"CO"},
{Name:"Connecticut", Code:"CT"},
{Name:"Delaware", Code:"DE"},
{Name:"District of Columbia", Code:"DC"},
{Name:"Florida", Code:"FL"},
{Name:"Georgia", Code:"GA"},
{Name:"Hawaii", Code:"HI"},
{Name:"Idaho", Code:"ID"},
{Name:"Illinois", Code:"IL"},
{Name:"Indiana", Code:"IN"},
{Name:"Iowa", Code:"IA"},
{Name:"Kansas", Code:"KS"},
{Name:"Kentucky", Code:"KY"},
{Name:"Louisiana", Code:"LA"},
{Name:"Maine", Code:"ME"},
{Name:"Maryland", Code:"MD"},
{Name:"Massachusetts", Code:"MA"},
{Name:"Michigan", Code:"MI"},
{Name:"Minnesota", Code:"MN"},
{Name:"Mississippi", Code:"MS"},
{Name:"Missouri", Code:"MO"},
{Name:"Montana", Code:"MT"},
{Name:"Nebraska", Code:"NE"},
{Name:"Nevada", Code:"NV"},
{Name:"New Hampshire", Code:"NH"},
{Name:"New Jersey", Code:"NJ"},
{Name:"New Mexico", Code:"NM"},
{Name:"New York", Code:"NY"},
{Name:"North Carolina", Code:"NC"},
{Name:"North Dakota", Code:"ND"},
{Name:"Ohio", Code:"OH"},
{Name:"Oklahoma", Code:"OK"},
{Name:"Oregon", Code:"OR"},
{Name:"Pennsylvania", Code:"PA"},
{Name:"Rhode Island", Code:"RI"},
{Name:"South Carolina", Code:"SC"},
{Name:"South Dakota", Code:"SD"},
{Name:"Tennessee", Code:"TN"},
{Name:"Texas", Code:"TX"},
{Name:"Utah", Code:"UT"},
{Name:"Vermont", Code:"VT"},
{Name:"Virginia", Code:"VA"},
{Name:"Washington", Code:"WA"},
{Name:"West Virginia", Code:"WV"},
{Name:"Wisconsin", Code:"WI"},
{Name:"Wyoming", Code:"WY"}];
this.CANStateList = [{Name:"Alberta", Code:"AB"},
{Name:"British Columbia", Code:"BC"},
{Name:"Manitoba", Code:"MB"},
{Name:"New Brunswick", Code:"NB"},
{Name:"Newfoundland and Labrador", Code:"NL"},
{Name:"Northwest Territories", Code:"NT"},
{Name:"Nova Scotia", Code:"NS"},
{Name:"Nunavut", Code:"NU"},
{Name:"Ontario", Code:"ON"},
{Name:"Prince Edward Island", Code:"PE"},
{Name:"Quebec", Code:"QC"},
{Name:"Saskatchewan", Code:"SK"},
{Name:"Yukon", Code:"YT"}];
this.UKStateList = [{Name:"Avon", Code:"Avon"},
{Name:"Beds", Code:"Beds"},
{Name:"Berks", Code:"Berks"},
{Name:"Bristol", Code:"Bristol"},
{Name:"Bucks", Code:"Bucks"},
{Name:"Cambridgeshire and Isle of Ely", Code:"Cambridgeshire and Isle of Ely"},
{Name:"Cambs", Code:"Cambs"},
{Name:"Cheshire", Code:"Cheshire"},
{Name:"Cleveland", Code:"Cleveland"},
{Name:"Co Antrim", Code:"Co Antrim"},
{Name:"Co Armagh", Code:"Co Armagh"},
{Name:"Co Down", Code:"Co Down"},
{Name:"Co Durham", Code:"Co Durham"},
{Name:"Co Fermanagh", Code:"Co Fermanagh"},
{Name:"Co Tyrone", Code:"Co Tyrone"},
{Name:"Cornwall", Code:"Cornwall"},
{Name:"Cumberland", Code:"Cumberland"},
{Name:"Cumbria", Code:"Cumbria"},
{Name:"Derbyshire", Code:"Derbyshire"},
{Name:"Devon", Code:"Devon"},
{Name:"Dorset", Code:"Dorset"},
{Name:"Durham", Code:"Durham"},
{Name:"E Sussex", Code:"E Sussex"},
{Name:"East Suffolk", Code:"East Suffolk"},
{Name:"Essex", Code:"Essex"},
{Name:"Glos", Code:"Glos"},
{Name:"Greater London", Code:"Greater London"},
{Name:"Greater Manchester", Code:"Greater Manchester"},
{Name:"Hampshire", Code:"Hampshire"},
{Name:"Hants", Code:"Hants"},
{Name:"Hereford and Worcester", Code:"Hereford and Worcester"},
{Name:"Herefordshire", Code:"Herefordshire"},
{Name:"Hertfordshire", Code:"Hertfordshire"},
{Name:"Herts", Code:"Herts"},
{Name:"Humberside", Code:"Humberside"},
{Name:"Huntingdon and Peterborough", Code:"Huntingdon and Peterborough"},
{Name:"Huntingdonshire", Code:"Huntingdonshire"},
{Name:"Isle of Ely", Code:"Isle of Ely"},
{Name:"Isle of Wight", Code:"Isle of Wight"},
{Name:"Kent", Code:"Kent"},
{Name:"Lancs", Code:"Lancs"},
{Name:"Leics", Code:"Leics"},
{Name:"Lincs", Code:"Lincs"},
{Name:"M Glam", Code:"M Glam"},
{Name:"Merseyside", Code:"Merseyside"},
{Name:"Middx", Code:"Middx"},
{Name:"N Humberside", Code:"N Humberside"},
{Name:"N Yorkshire", Code:"N Yorkshire"},
{Name:"Norfolk", Code:"Norfolk"},
{Name:"Northamptonshire", Code:"Northamptonshire"},
{Name:"Northants", Code:"Northants"},
{Name:"Northd", Code:"Northd"},
{Name:"Notts", Code:"Notts"},
{Name:"Oxon", Code:"Oxon"},
{Name:"Rutland", Code:"Rutland"},
{Name:"S Glam", Code:"S Glam"},
{Name:"S Humberside", Code:"S Humberside"},
{Name:"S Yorkshire", Code:"S Yorkshire"},
{Name:"Shropshire", Code:"Shropshire"},
{Name:"Soke of Peterborough", Code:"Soke of Peterborough"},
{Name:"Somerset", Code:"Somerset"},
{Name:"Staffs", Code:"Staffs"},
{Name:"Suffolk", Code:"Suffolk"},
{Name:"Surrey", Code:"Surrey"},
{Name:"Sussex", Code:"Sussex"},
{Name:"Tyne & Wear", Code:"Tyne & Wear"},
{Name:"Warks", Code:"Warks"},
{Name:"W Glam", Code:"W Glam"},
{Name:"W Midlands", Code:"W Midlands"},
{Name:"W Sussex", Code:"W Sussex"},
{Name:"W Yorkshire", Code:"W Yorkshire"},
{Name:"West Suffolk", Code:"West Suffolk"},
{Name:"Westmorland", Code:"Westmorland"},
{Name:"Wilts", Code:"Wilts"},
{Name:"Worcs", Code:"Worcs"},
{Name:"Yorkshire", Code:"Yorkshire"},
{Name:"OTHER", Code:"OTHER"}];
this.SwitchBinList = [{Num:"4903", Length:16},
{BIN:"4903", Length:18},
{BIN:"4903", Length:19},
{BIN:"4911", Length:16},
{BIN:"4911", Length:18},
{BIN:"4911", Length:19},
{BIN:"4936", Length:16},
{BIN:"4936", Length:18},
{BIN:"4936", Length:19},
{BIN:"564182", Length:18},
{BIN:"564182", Length:19},
{BIN:"6333", Length:16},
{BIN:"6333", Length:18},
{BIN:"6333", Length:19},
{BIN:"6759", Length:16},
{BIN:"6759", Length:18},
{BIN:"6759", Length:19},
{BIN:"6334", Length:16},
{BIN:"6334", Length:18},
{BIN:"6334", Length:19},
{BIN:"6767", Length:16},
{BIN:"6767", Length:18},
{BIN:"6767", Length:19}];
this.PaymentBoxProcessServer = "https://www.iatspayments.com/";
this.PaymentBoxPID = "PA341EF7B5D4C56CE2"
//AURA Template begin
this.PaymentBoxTID = ""
this.ProcessKey = ""
this.ProcessOption = ""
this.SelectedStyleSheet = "https://www.iatspayments.com/PaymentBox/css/Modern-Sleek.css?v=170717";
// For recurring
this.WeekList = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
this.DateList = ["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"];
// Approval Message
this.ApprovalResponseHeader = "Thanks for your support. Here are the transaction details.";
this.ApprovalResponseFooter = "Contributions to CollegeForSureCBO under TIN 30-0704003 are tax-deductible to the extent permitted by law.";
this.ApprovalResponseCodeDesc = "Approval Code:";
this.ApprovalResponseAmountDesc = "You have been charged a total of $";
this.DeclineResponseHeader = "The transaction has been declined.";
this.DeclineResponseFooter = "Please check your payment information and try again.";
this.DeclineResponseCodeDesc = "Decline Reason:";
this.SendEmailConfirmationLabel = "I would like to receive email.";
this.SendEmailConfirmation = "CHECKED";
this.ReoccurringResponseHeader = "The recurring transaction has been set up.";
this.ReoccurringResponseFooter = "Contributions to CollegeForSureCBO under TIN 30-0704003 are tax-deductible to the extent permitted by law.";
this.ReoccurringResponseCodeDesc = "Customer Code:";
this.ReoccurringLabel = "Recurring";
this.ReoccurringVisible = "CHECKED";
this.SinglePaymentVisible = "CHECKED";
this.SinglePaymentLabel = "One Time";
this.MonthlyRecurringBeginDate1 = "";
this.MonthlyRecurringBeginDate2 = "";
this.MonthlyRecurringDate1Visible = "CHECKED";
this.MonthlyRecurringDate2Visible = "CHECKED";
this.WeeklyVisible = "Checked";
this.MonthlyVisible = "Checked";
this.QuarterlyVisible = "Checked";
this.AnnuallyVisible = "Checked";
this.WeeklyLabel = "Weekly";
this.MonthlyLabel = "Monthly";
this.QuarterlyLabel = "Quarterly";
this.AnnuallyLabel = "Annually ";
this.RestrictDates = "";
this.ScheduleTypeDefault = "0";
//console.log("At the start, this.ScheduleTypeDefault = " + this.ScheduleTypeDefault);
// Parameters incoming from the script method, which should be overwritten by their URL version here.
// Note: 'ScheduleType' from script/URL parameters should override the 'ScheduleTypeDefault' setting from the AURA setup page.
//this.ScheduleType = "";
//this.BeginDate= "";
//this.EndDate = "";
//console.log("At the start, we have ScheduleType = " + this.ScheduleType + ", BeginDate = " + this.BeginDate + ", and EndDate = " + this.EndDate);
// Recurring Begin/End date defaults and constraints.
this.UseCurrentDate = [{"useCurrentDate":"ON","scheduleType":"Monthly"},{"useCurrentDate":"ON","scheduleType":"Weekly"},{"useCurrentDate":"ON","scheduleType":"Quarterly"},{"useCurrentDate":"ON","scheduleType":"Annually"}];
this.RecurBeginDates = [{"beginDay":"1","beginMonth":"","scheduleType":"Monthly","dateIndex":1},{"beginDay":"0","beginMonth":"","scheduleType":"Monthly","dateIndex":2},{"beginDay":"1","beginMonth":"","scheduleType":"Weekly","dateIndex":1},{"beginDay":"1","beginMonth":"1","scheduleType":"Quarterly","dateIndex":1},{"beginDay":"0","beginMonth":"1","scheduleType":"Quarterly","dateIndex":2},{"beginDay":"1","beginMonth":"1","scheduleType":"Annually","dateIndex":1},{"beginDay":"0","beginMonth":"1","scheduleType":"Annually","dateIndex":2}];
this.RecurEndDates = [{"endNumber":"50","endType":"2","scheduleType":"Monthly"},{"endNumber":"50","endType":"2","scheduleType":"Weekly"},{"endNumber":"50","endType":"2","scheduleType":"Quarterly"},{"endNumber":"50","endType":"2","scheduleType":"Annually"}];
//console.log("UseCurrentDate: ");
//this.UseCurrentDate.forEach(function (element, index) {
// console.log(element);
//});
//console.log("RecurBeginDates: ");
//this.RecurBeginDates.forEach(function (element, index) {
// console.log(element);
//});
//console.log("RecurEndDates: ");
//this.RecurEndDates.forEach(function (element, index) {
// console.log(element);
//});
//console.log("UseCurrentDate: " + this.UseCurrentDate);
//console.log("RecurBeginDates: " + this.RecurBeginDates);
//console.log("RecurEndDates: " + this.RecurEndDates);
//this.debugLog = "";
//console.log("Debug Log: " + this.debugLog);
this.ReoccurringInformationLabel = "";
this.ReoccurringList = [{Desc:"Schedule Type",Name:"ScheduleType",Visible:1,Required:1,Type:"Text",MiniLen:1,ErrorMsg:"",Value:"",MaxLen:"11"}
,{Desc:"Begin Date",Name:"BeginDate",Visible:1,Required:0,Type:"Text",MiniLen:1,ErrorMsg:"Begin date must be today or later.",Value:"",MaxLen:"11"}
,{Desc:"End Date",Name:"EndDate",Visible:1,Required:0,Type:"Text",MiniLen:1,ErrorMsg:"End date must be later than begin date.",Value:"",MaxLen:"11"}
]; // This contains ScheduleType, BeginDate, and EndDate data extracted from the client parameters using the script method from the .cs script.
this.showReoccurring = showReoccurring;
this.showScheduleDate = showScheduleDate;
this.createReoccurringDiv = IATSCreateReoccurringDiv;
this.createSendEmailDiv = IATSCreateSendEmailDiv;
// CAPTCHA
this.createCAPTCHADiv = IATSCreateCAPTCHADiv;
this.enableCAPTCHA = "1";
this.captchatheme = "light";
this.RecaptchaSiteKey = "6LdEeUwUAAAAACFjx63s6auf9g8PH9QgwmLzJjoi";
//Get Client's Parameters.
this.clientparameters = decodeURIComponent("");
// Processing Fee
this.processingFee_Enabled = "";
this.processingFee_Message = "";
this.processingFee_Percent = "0.00";
this.auraLink_PageTitle = "";
this.auraLink_PageDescription = "";
this.auraLink_FormPosition = "";
this.auraLink_FormColor = "";
this.auraLink_FormTransparency = "1";
this.auraLink_BackgroundColor = "#000000";
this.auraLink_LogoPosition = "";
this.auraLink_BackgroundImagePath = "";
this.auraLink_CustomLogoPath = "";
this.auraLink_BackgroundImgPosition = "";
this.auraLink_BackgroundImgAttachment = "";
this.auraLink_BackgroundImgRepeat = "";
this.auraLink_BackgroundImgHeight = "";
this.auraLink_BackgroundImgWidth = "";
this.auraLink_Header = "";
this.auraLink_HeaderSize = "";
this.auraLink_HeaderFont = "";
this.auraLink_HeaderAlignment = "";
this.auraLink_HeaderColor = "";
this.auraLink_SubHeaderText = "";
this.auraLink_SubHeaderSize = "";
this.auraLink_SubHeaderFont = "";
this.auraLink_SubHeaderAlignment = "";
this.auraLink_SubHeaderColor = "";
this.auraLink_CustomHtml = "";
this.clientCustomFields = [];
this.createUKDirectDebitDiv1 = IATSCreateUKDirectDebitDiv1;
this.createUKDirectDebitDiv2 = IATSCreateUKDirectDebitDiv2;
this.createUKDirectDebitDiv3 = IATSCreateUKDirectDebitDiv3;
this.createUKDirectDebitDiv4 = IATSCreateUKDirectDebitDiv4;
this.createUKDirectDebitDiv5 = IATSCreateUKDirectDebitDiv5;
this.createNACHPolicyDiv = IATSCreateNACHPolicyDiv;
this.closeNACHPolicyStatement = IATSCloseNACHPolicyStatement;
this.closeNACHRecourceStatement = IATSCloseNACHRecourceStatement;
this.createNACHRecourseDiv = IATSCreateNACHRecourseDiv;
this.createShareLinkDiv = IATSCreateShareLinkDiv;
this.checkRecurringBeginDate = IATSCheckRecurringBeginDate;
this.checkRecurringEndDate = IATSCheckRecurringEndDate;
this.checkZipCode = IATScheckZipCode;
this.validEmail = IATSvalidEmail;
this.IsEmailMatch = IATSIsEmailMatch;
// If there are client parameters coming from the "script method", they are coming in here.
this.recurringCheck = false;
//console.log("At the start, this.recurringCheck = " + this.recurringCheck);
this.hideRecurringCheckbox = 0;
this.redirectTime = 7000;
this.hideCVV = 0;
this.bankWithdrawalChecked = 0;
this.HideAmountInfo = "0";
this.TotalAmount = "0";
this.TotalDescription = "Total is";
this.defaultTotal = (Math.round(this.TotalAmount*100)/100).toFixed(2);
this.EventPaymentWidth = "400";
this.EventStyleSheet = "";
this.ThirdStyleSheet = decodeURIComponent("https://www.iatspayments.com/PaymentBox/css/IATSPaymentBoxThird.css%3fPID%3dPA341EF7B5D4C56CE2%26Version%3dNA%26cb%3d20037");
this.EventPostBackURL = "";
this.RedirectURL = "";
// ACH
this.USCheckVisible = "CHECKED";
this.CANCheckVisible = "";
this.UKCheckVisible = "";
this.USCheckLabel = "Bank Withdrawal";
this.UKCheckLabel = "Bank Withdrawal";
this.CANCheckLabel = "Bank Withdrawal";
this.CreditCardLabel = "Credit Card";
this.AgentCode = "3SXW27";
// CC optional
this.CreditCardVisible = "CHECKED";
// Default amount checked.
this.AmountDefaultChecked = "";
this.AmountDefaultCheckedError = "Please select at least one amount item.";
this.DefaultSocialLinks = "";
this.FormURL = "";
this.FormURLTitle = "";
this.EmailFriendMessage = "";
this.AdvancedShare = "";
this.Snippet = "";
this.iatsForm = null;
this.createPaymentBoxScriptDiv = IATSCreatePaymentBoxScriptDiv;
this.createPaymentBoxDiv = IATSCreatePaymentBoxDiv;
this.createPaymentBoxForm = IATSCreatePaymentBoxForm;
this.createPaymentBoxInnerDiv = IATSCreatePaymentBoxInnerDiv;
this.createPaymentBoxHeaderDiv = IATSCreatePaymentBoxHeaderDiv;
this.createPaymentBoxContentDiv = IATSCreatePaymentBoxContentDiv;
this.createPaymentBoxAmountListDiv = IATSCreatePaymentBoxAmountListDiv;
this.createPaymentBoxPaymentDiv = IATSCreatePaymentBoxPaymentDiv;
this.createPaymentBoxErrorMsgDiv = IATSCreatePaymentBoxErrorMsgDiv;
this.createPaymentBoxFooterDiv = IATSCreatePaymentBoxFooterDiv;
this.countryOnSelect = IATSCountryOnSelect;
this.processTransaction = IATSProcessTransaction;
this.backToReInput = IATSBackToReInput;
this.cCNumfieldCheck = IATSCCNumfieldCheck;
this.cCNumfieldCheckIPad = IATSCCNumfieldCheckIPad;
this.iATSAmountQtyCheck = IATSAmountQtyCheck;
this.iATSGetTotal = IATSGetTotal;
this.showAndUpdateResponse = IATSShowAndUpdateResponse;
this.UKDirectDebitGetPayer = IATSUKDirectDebitGetPayer;
this.createPaymentBoxResponseDiv = IATSCreatePaymentBoxResponseDiv;
this.validatePaymentInput = IATSValidatePaymentInput;
this.stringTrim = IATSStringTrim;
this.installEventStyleSheet = IATSInstallEventStyleSheet;
this.LimitCommentText = limitText;
this.showScript = IATSShowScript;
this.iATSGetElementsByNameFilterByValue = IATSGetElementsByNameFilterByValue;
this.iATSTurnOffOtherMinErrors = IATSTurnOffOtherMinErrors;
this.iATSTurnOnOtherMinErrors = IATSTurnOnOtherMinErrors;
this.iATSClearUncheckedOtherBoxes = IATSClearUncheckedOtherBoxes;
this.recurringUpdateBeginEndDateDefaults = IATSRecurringUpdateBeginEndDateDefaults;
this.createElement = IATSCreateElement;
this.OpenCNDHelpImg = IATSOpenCNDHelpImg;
this.OpenUSHelpImg = IATSOpenUSHelpImg;
this.OpenCVV2Img = IATSOpenCVV2Img;
this.OpenUKHelpImg = IATSOpenUKHelpImg;
this.OpenSEPAHelpImg = IATSOpenSEPAHelpImg;
this.openMoreInfoDiv = OpenMoreInfoDiv;
this.ShowText = IATSShowText;
this.HideText = IATSHideText;
//console.log("Before extraction, ReoccurringList: ");
//this.ReoccurringList.forEach(function (element, index) {
// console.log("Name " + element.Name + ", Value = " + element.Value);
//});
//Currently, URL method cannot display all default parameters pre-setup by clients.
//Some parameter values (e.g., TotalDescription, TotalAmount, and HideCVV) are missing on the web page even if clients have set up their default values.
//The reason is because these parameters from URL method are not extracted and handled in this file.
//The code below will extract these parameters such that their default values will be displayed on the web page.
if (this.clientparameters.length > 0)
{
var parameters = ["TotalDescription", "TotalAmount", "RedirectTime", "HideAmountInfo",
"HideWeekly", "HideMonthly", "HideQuarterly", "HideAnnually", "HideCVV", "HideRecurringBeginDate", "HideRecurringEndDate", "RecurringChecked", "BankWithdrawalChecked",
"ScheduleType", "BeginDate", "EndDate"];
for (var i = 0; i < parameters.length; i++)
{
var name = parameters[i];
var index = this.clientparameters.indexOf(name+"=");
var value = "";
if (index >= 0)
{
var next = this.clientparameters.indexOf("&", index);
if (next > 0)
{
value = this.clientparameters.substring(index+name.length+1, next);
}
// If it can't find another "&" sign, it is the last parameter, so read until the end of the 'clientparameter' string.
else
{
value = this.clientparameters.substring(index+name.length+1, this.clientparameters.length);
}
switch (name)
{
case 'TotalDescription':
this.TotalDescription = value;
break;
case 'TotalAmount':
this.TotalAmount = value;
this.defaultTotal = (Math.round(this.TotalAmount*100)/100).toFixed(2);
break;
case 'RedirectTime':
this.redirectTime = value;
break;
case 'HideAmountInfo':
this.HideAmountInfo = value.toUpperCase() == 'TRUE' ? 1 : this.HideAmountInfo;
break;
case 'HideWeekly':
this.WeeklyVisible = value.toUpperCase() == 'TRUE' ? "" : this.WeeklyVisible;
break;
case 'HideMonthly':
this.MonthlyVisible = value.toUpperCase() == 'TRUE' ? "" : this.MonthlyVisible;
break;
case 'HideQuarterly':
this.QuarterlyVisible = value.toUpperCase() == 'TRUE' ? "" : this.QuarterlyVisible;
break;
case 'HideAnnually':
this.AnnuallyVisible = value.toUpperCase() == 'TRUE' ? "" : this.AnnuallyVisible;
break;
case 'HideCVV':
this.hideCVV = value.toUpperCase() == 'TRUE' ? 1 : this.hideCVV;
break;
case "HideRecurringBeginDate":
window.hideRecurringBeginDate = value.toUpperCase() == 'TRUE' ? 1 : window.hideRecurringBeginDate;
break;
case "HideRecurringEndDate":
window.hideRecurringEndDate = value.toUpperCase() == 'TRUE' ? 1 : window.hideRecurringEndDate;
break;
case "RecurringChecked":
this.recurringCheck = value.toUpperCase() == 'TRUE' ? true : false
break;
case "BankWithdrawalChecked":
this.bankWithdrawalChecked = value.toUpperCase() == 'TRUE' ? 1 : this.bankWithdrawalChecked;
break;
case 'ScheduleType':
this.ReoccurringList[0].Value = value;
break;
case 'BeginDate':
this.ReoccurringList[1].Value = value;
break;
case 'EndDate':
this.ReoccurringList[2].Value = value;
break;
default:
break;
}
}
}
}
//console.log("After extraction, ReoccurringList: ");
//this.ReoccurringList.forEach(function (element, index) {
// console.log("Name " + element.Name + ", Value = " + element.Value);
// console.log("Checkdate on above: " + checkdate(element.Value));
//});
//console.log("Checkdate: dog : " + checkdate("dog"));
//console.log("Checkdate: 0101/2020 : " + checkdate("0101/2020"));
//console.log("Checkdate: 01012020 : " + checkdate("01012020"));
//console.log("Checkdate: empty string : " + checkdate(""));
// ACH
this.SelectPaymentType = IATSSelectPaymentType;
this.UKDirectDebit = IATSUKDirectDebit;
this.SelectPaymentFrequency = IATSSelectPaymentFrequency;
this.installEventStyleSheet();
// *** Note: The entire form 'div' is built with this line.
// Anything that references elements inside this should probably be called after it is built.
var div = this.iatsPaymentBoxDiv = this.createPaymentBoxDiv();
this.Script.parentNode.insertBefore(div, this.Script);
// Form building is now done.
var scriptdiv = this.createPaymentBoxScriptDiv();
this.Script.parentNode.insertBefore(scriptdiv, this.Script);
// Note: all BeginDate and EndDate values get set here.
// Use this to update the dropdown lists once the form has been built. If there are script or URL parameters, they will have to get added after this function runs.
IATSRecurringUpdateBeginEndDateDefaults(this);
// At this point we would like to override the MVCWeb parameters with some either the script or URL parameters.
// Set BeginDate and EndDate back to the script/URL parameter if it is not empty and passes validation.
// Set ScheduleType if it matches a valid option value. Otherwise, no option is selected (selectedIndex = -1).
for (var i = 0; i<3; i++)
{
// We should skip the remaining evaluations if the ReoccurringList[i] item is blank. This means no URL or script method value was assigned by the client.
// If we don't skip setting values when we get an empty string, the loop will start assigning empty values and overwriting the desired MVCWeb values.
if (this.ReoccurringList[i].Value.length == 0)
continue;
// Get the field that we will be editing: 'ScheduleType', 'BeginDate', or 'EndDate'.
var field = document.getElementById("IATS_Payment_" + this.ReoccurringList[i].Name);
if (this.ReoccurringList[i].Name == "ScheduleType")
{
// Assign ScheduleType information with no validation. Note: It must match the option case exactly.
field.value = this.ReoccurringList[i].Value;
}
if (this.ReoccurringList[i].Name == "BeginDate" || this.ReoccurringList[i].Name == "EndDate")
{
// If the date passed validation, set the corresponding field to that value. If the string fails validation, do nothing and leave it as the default value given by the Aura Setup Page.
// Note: an empty string will fail validation, but empty strings will also trigger the 'continue' command at the start and will never reach this far into the loop.
if (checkdate(this.ReoccurringList[i].Value))
{
field.value = this.ReoccurringList[i].Value;
}
}
}
// Hide cvv2 when check recurring
if(document.getElementById("IATS_Payment_ReoccurringCheck")!=null)
{
// Don't use the variable from the .cs file ('RecurringDefaultCheck') because it will always return false.
document.getElementById("IATS_Payment_ReoccurringCheck").checked = this.recurringCheck;
if(document.getElementById("IATS_Payment_ReoccurringCheck").checked==true && document.getElementById("IATS_Payment_CVV2Div")!=null)
document.getElementById("IATS_Payment_CVV2Div").style.display="none";
}
if(this.HideAmountInfo==0)
{
IATSGetTotal();
}
// This will show or hide the 'Recurring' input fields when set from "RecurringChecked". Also used with .onclick() for "One Time" and "Recurring" buttons.
showReoccurring();
// This will show the credit card or bank withdrawal div when set from "BankWithdrawalChecked". Also used with .onclick() for "Credit Card" and "Bank Withdrawal" buttons.
IATSSelectPaymentType();
if(document.all) { document.onmousemove = function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}; }
else { document.onmousemove = function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;} }
// Get Client's Parameters - for prepopulating input fields.
for (var i=0; i
=0)
{
var index2 = this.clientparameters.indexOf("&",index1);
if(this.PrifileItemList[i].Name=="State")
var field = document.getElementById("IATS_PaymentItemInput_State2");
else var field = document.getElementById("IATS_PaymentItemInput_" + this.PrifileItemList[i].Name);
if (field!=null)
{
var fieldValue;
var index3 = this.clientparameters.indexOf("=",index1);
if (index2>=0)
fieldValue = this.clientparameters.substring(index3+1,index2);
else
fieldValue = this.clientparameters.substring(index3+1);
//Truncate the field value based on its max length
fieldValue = fieldValue.substring(0,this.PrifileItemList[i].MaxLen)
field.value = fieldValue;
}
if (index2>=0)
{
if (index1==0)
this.clientparameters=this.clientparameters.substring(index2+1);
else
this.clientparameters=this.clientparameters.substring(0,index1-1) + this.clientparameters.substring(index2);
}
else
{
if (index1==0)
this.clientparameters="";
else
this.clientparameters=this.clientparameters.substring(0,index1-1);
}
}
}
// Copy from the previous for loop and loop through the items 1-15
for (var i=0;i=0)
{
var index2 = this.clientparameters.indexOf("&",index1);
var field = document.getElementById("IATS_PaymentItemInput_" + this.PrifileItemList_Items[i].Name);
if (field!=null)
{
var fieldValue;
var index3 = this.clientparameters.indexOf("=",index1);
if (index2>=0)
fieldValue = this.clientparameters.substring(index3+1,index2);
else
fieldValue = this.clientparameters.substring(index3+1);
//Truncate the field value based on its max length
fieldValue = fieldValue.substring(0,this.PrifileItemList_Items[i].MaxLen)
field.value = fieldValue;
}
if (index2>=0)
{
if (index1==0)
this.clientparameters=this.clientparameters.substring(index2+1);
else
this.clientparameters=this.clientparameters.substring(0,index1-1) + this.clientparameters.substring(index2);
}
else
{
if (index1==0)
this.clientparameters="";
else
this.clientparameters=this.clientparameters.substring(0,index1-1);
}
}
}
var EnableMobileCSS = "Checked";
if(EnableMobileCSS.toUpperCase()=="CHECKED"){
installViewPort();
}
}
//Get reject message
function getRejectMessage(rejectcode)
{
var rejectmessage = "";
var flag = false;
for(var i = 0; i < theIATSPaymentBoxCore.RejectList.length; ++i)
{
if(theIATSPaymentBoxCore.RejectList[i].Code == rejectcode)
{
rejectmessage = theIATSPaymentBoxCore.RejectList[i].Message;
flag = true;
break;
}
}
if(flag == false)
rejectmessage = theIATSPaymentBoxCore.RejectDefaultMessage;
return rejectmessage;
}
function installViewPort()
{
var head= document.getElementsByTagName('head')[0];
var meta= document.createElement('meta');
meta.name = 'viewport';
meta.content = 'width=device-width, initial-scale=1';
head.appendChild(meta);
}
// Restrict the dollar amount field to numbers only.
function isNumberKey(evt)
{
evt = evt || window.event;
var charCode = e.keyCode || e.which;
//var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}
function IATSvalidEmail()
{
if(document.getElementById("IATS_PaymentItemInput_EMail")!=null)
{
var email = document.getElementById("IATS_PaymentItemInput_EMail");
var emailError = document.getElementById("IATS_PaymentItemErrorMesssage_EMail");
if (email.value.length == 0) // Empty email. Set client-supplied message and don't check for valid formatting.
{
if (emailError != null)
emailError.innerHTML = theIATSPaymentBoxCore.ClientEmailError;
return true; // This function treats empty emails as valid. Min length checking is done elsewhere.
}
else // Email is not empty. Check for validity.
{
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,100})$/;
if(reg.test(email.value.replace(/^\s*/,"").replace(/\s*$/,"")) == false) // This regex trims the whitespace from the email before validation.
{
if (emailError != null)
emailError.innerHTML = "Please enter a valid email address.";
return false;
}
else return true;
}
}
else return true;
}
function IATSIsEmailMatch()
{
if(document.getElementById("IATS_PaymentItemInput_EMail")!=null && document.getElementById("IATS_PaymentItemInput_ReEnterEmail")!=null)
{
var email1 = document.getElementById("IATS_PaymentItemInput_EMail").value;
var email2 = document.getElementById("IATS_PaymentItemInput_ReEnterEmail").value;
if(email1!=email2)
return false;
else
return true;
}
else return true;
}
function IATSIsSocialSecurityNumber(value)
{
var reg = /\d{3,}-\d{2}-\d{4,}/;
return reg.test(value);
}
function IATSCreateElement(elementtype, name, elementinnerHtml)
{
var IE = false;
var element = null;
if (name!="")
{
try
{
if (IE)
{
try
{
element = document.createElement('<' + elementtype + ' name="' + name + '" />');
}
catch(e)
{
}
if(!element)
{
element = document.createElement(elementtype);
element.setAttribute("name", name);
}
}
else
{
element = document.createElement(elementtype);
element.setAttribute("name", name);
}
}
catch (e)
{
}
}
else
{
element = document.createElement(elementtype);
}
if(!element)
{
return;
}
if (elementinnerHtml!== '')
{
if (elementtype.toUpperCase() == 'OPTION')
element.text = elementinnerHtml;
else
element.innerHTML = elementinnerHtml;
}
return element;
};
function hexToRgb(hex, opacity) {
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
return result ?
'rgba(' + parseInt(result[1], 16).toString() + ',' + parseInt(result[2], 16).toString() + ',' + parseInt(result[3], 16).toString() + ',' + parseFloat(opacity).toString() + ')' : null;
}
function IATSCreatePaymentBoxDiv()
{
var div;
div = this.createElement("div","","");
div.className = "IATS_Div";
div.setAttribute("id", "IATS_PaymentBoxDiv");
if (this.EventPaymentWidth>100)
{
div.style.width = this.EventPaymentWidth+"px";
}
// Only run below code if its a stand alone aura form
var auracont = document.getElementById("auraContainer");
if (auracont && !this.auraLink_CustomHtml) {
if (this.auraLink_PageTitle)
window.document.title = this.auraLink_PageTitle;
if (this.auraLink_SubHeaderText) {
var p2 = this.createElement("p","","");
p2.innerHTML = this.auraLink_SubHeaderText;
if (this.auraLink_SubHeaderSize)
p2.style.fontSize = this.auraLink_SubHeaderSize;
if (this.auraLink_SubHeaderColor)
p2.style.color = this.auraLink_SubHeaderColor;
if (this.auraLink_SubHeaderFont)
p2.style.fontFamily = this.auraLink_SubHeaderFont;
if (this.auraLink_SubHeaderAlignment)
p2.style.textAlign = this.auraLink_SubHeaderAlignment;
div.insertBefore(p2, div.childNodes[0]);
}
if (this.auraLink_CustomLogoPath || this.auraLink_Header) {
var headerdiv = this.createElement("div","","");
headerdiv.style.marginBottom = "10px";
if (this.auraLink_CustomLogoPath) {
var logoImg = this.createElement("img","","");
logoImg.setAttribute("src", this.auraLink_CustomLogoPath);
logoImg.style.maxHeight = "100px";
logoImg.style.maxWidth = "250px";
var dimg = logoImg.cloneNode(true);
dimg.style.visibility = "hidden";
logoImg.style.cssFloat = "Left";
dimg.style.cssFloat = "Right";
if (this.auraLink_LogoPosition == "Right") {
logoImg.style.cssFloat = "Right";
dimg.style.cssFloat = "Left";
}
headerdiv.appendChild(logoImg);
headerdiv.appendChild(dimg);
}
if (this.auraLink_Header) {
var h1 = this.createElement("h1","",this.auraLink_Header);
if (this.auraLink_HeaderColor)
h1.style.color = this.auraLink_HeaderColor;
if (this.auraLink_HeaderSize)
h1.style.fontSize = this.auraLink_HeaderSize;
if (this.auraLink_HeaderFont)
h1.style.fontFamily = this.auraLink_HeaderFont;
if (this.auraLink_HeaderAlignment)
h1.style.textAlign = this.auraLink_HeaderAlignment;
headerdiv.appendChild(h1);
}
auracont.insertBefore(headerdiv, auracont.childNodes[0]);
}
if (this.auraLink_FormPosition && this.auraLink_FormPosition != "Select"){
auracont.style.textAlign = this.auraLink_FormPosition;
div.style.display = "inline-block";
}
if (this.auraLink_FormColor) {
if (this.auraLink_FormTransparency == "1")
div.style.background = this.auraLink_FormColor;
else
div.style.background = hexToRgb(this.auraLink_FormColor, this.auraLink_FormTransparency);
}
if (this.auraLink_BackgroundColor)
document.body.style.backgroundColor = this.auraLink_BackgroundColor;
if (this.auraLink_BackgroundImagePath) {
var imgurl = "url('" + this.auraLink_BackgroundImagePath + "')";
document.body.style.background = imgurl;
var metaTag=document.createElement('meta');
metaTag.name = "viewport"
metaTag.content = "width=device-width, initial-scale=1.0, maximum-scale=1.0"
var headele = document.getElementsByTagName('head')[0];
headele.insertBefore(metaTag, headele.childNodes[0]);
if (this.auraLink_BackgroundImgAttachment && this.auraLink_BackgroundImgAttachment != "")
document.body.style.backgroundAttachment = this.auraLink_BackgroundImgAttachment;
if (this.auraLink_BackgroundImgPosition && this.auraLink_BackgroundImgPosition != "") {
if (this.auraLink_BackgroundImgPosition && this.auraLink_BackgroundImgPosition != "stretch") {
document.body.style.backgroundPosition = this.auraLink_BackgroundImgPosition;
if (this.auraLink_BackgroundImgRepeat && this.auraLink_BackgroundImgRepeat != "select")
document.body.style.backgroundRepeat = this.auraLink_BackgroundImgRepeat;
}
else{
document.body.style.backgroundSize = "100% 100%";
}
} else {
}
}
}
// End stand alone section
var form = this.createPaymentBoxForm();
div.appendChild(form);
if (this.auraLink_CustomHtml && auracont){
document.body.innerHTML = this.auraLink_CustomHtml;
var wm = document.getElementById("wrapperMain");
var wa = document.getElementById("wrapperAura");
wm.replaceChild(div, wa);
return wa;
} else {
return div;
}
}
function CheckScriptLoaded(url, ext) {
var scripts = document.getElementsByTagName('script');
for (var i = scripts.length; i--;) {
if (scripts[i].src.indexOf(url) >= 0 && scripts[i].src.indexOf(ext) >= 0) return true;
}
return false;
}
function IATSCreatePaymentBoxScriptDiv()
{
var div;
div = this.createElement("div","","");
div.setAttribute("id", "IATSPaymentBoxScriptDiv");
div.style.display="none";
return div;
}
function IATSCreatePaymentBoxForm()
{
var form;
if (this.Script==null)
return;
var parentObj = this.Script.parentNode;
var foundForm = 0;
while(parentObj!=null && parentObj!=undefined)
{
if (parentObj.tagName==undefined)
break;
if (parentObj.tagName.toUpperCase()=="BODY")
{
break;
}
if (parentObj.tagName.toUpperCase()=="FORM")
{
foundForm = 1;
break;
}
parentObj = parentObj.parentNode;
}
if (foundForm)
{
form = this.createElement("div","IATSPaymentBoxForm","");
form.setAttribute("id", "IATSPaymentBoxForm");
form.setAttribute("name", "IATSPaymentBoxForm");
//Find the form.
this.iatsForm = parentObj;
var div = this.createPaymentBoxInnerDiv();
form.appendChild(div);
}
else
{
form = this.createElement("form","IATSPaymentBoxForm","");
form.setAttribute("id", "IATSPaymentBoxForm");
form.setAttribute("name", "IATSPaymentBoxForm");
form.setAttribute("action", "javascript:");
//Find the form.
this.iatsForm = form;
var div = this.createPaymentBoxInnerDiv();
form.appendChild(div);
}
return form;
}
function IATSCreatePaymentBoxInnerDiv()
{
var div;
div = this.createElement("div","","");
div.className = "IATS_InnerDiv";
var childDiv;
childDiv = this.createPaymentBoxHeaderDiv();
div.appendChild(childDiv);
childDiv = this.createPaymentBoxContentDiv();
div.appendChild(childDiv);
//add auraid redirect postback.
var auraID = this.createElement("input","IATS_Payment_AuraID","");
auraID.setAttribute("id","IATS_Payment_AuraID");
auraID.setAttribute("name","IATS_Payment_AuraID");
auraID.setAttribute("type","hidden");
auraID.value = this.PaymentBoxPID;
div.appendChild(auraID);
var last4 = this.createElement("input","IATS_Payment_AccountNumber4","");
last4.setAttribute("id","IATS_Payment_AccountNumber4");
last4.setAttribute("name","IATS_Payment_AccountNumber4");
last4.setAttribute("type","hidden");
div.appendChild(last4);
//create UK Direct debit pages for GBP currency only
if(this.version == "UK" && this.currency == "3")
{
childDiv = this.createUKDirectDebitDiv1();
div.appendChild(childDiv);
childDiv = this.createUKDirectDebitDiv2();
div.appendChild(childDiv);
childDiv = this.createUKDirectDebitDiv3();
div.appendChild(childDiv);
childDiv = this.createUKDirectDebitDiv4();
div.appendChild(childDiv);
childDiv = this.createUKDirectDebitDiv5();
div.appendChild(childDiv);
}
var auracont = document.getElementById("auraContainer")
if (this.auraLink_FormColor && auracont) {
if (this.auraLink_FormTransparency == "1")
div.style.background = this.auraLink_FormColor;
else
div.style.background = hexToRgb(this.auraLink_FormColor, this.auraLink_FormTransparency);
}
return div;
}
function IATSCreatePaymentBoxHeaderDiv()
{
var div;
div = this.createElement("div","","");
div.className = "IATS_HeaderDiv";
return div;
}
function showReoccurring()
{
//console.log("showReoccurring ran.");
if(document.getElementById('IATS_Payment_ReoccurringCheck')!=null)
{
//console.log("document.getElementById('IATS_Payment_ReoccurringCheck').checked = " + document.getElementById('IATS_Payment_ReoccurringCheck').checked);
if(document.getElementById('IATS_Payment_ReoccurringCheck').checked)
{
document.getElementById("IATS_Payment_ReoccurringSettingDiv").style.display = 'block';
if(document.getElementById("IATS_Payment_CVV2Div")!=null)
document.getElementById("IATS_Payment_CVV2Div").style.display="none";
if(document.getElementById("IATS_Payment_ACHAgreementDiv")!=null) // Display checkbox only for reoccuring payment
document.getElementById("IATS_Payment_ACHAgreementDiv").style.display="block";
}
else
{
document.getElementById("IATS_Payment_ReoccurringSettingDiv").style.display = 'none';
if(document.getElementById("IATS_Payment_CVV2Div")!=null)
document.getElementById("IATS_Payment_CVV2Div").style.display="block";
if(document.getElementById("IATS_Payment_ACHAgreementDiv")!=null) // Display checkbox only for reoccuring payment
{
document.getElementById("IATS_Payment_ACHAgreementDiv").style.display="none";
document.getElementById("IATS_Payment_ACHAgreementCheckbox").checked = false;
}
}
var _version = "NA";
if(_version == "UK")
IATSUKACHRecurringDisplay();
}
}
function IATSUKACHRecurringDisplay()
{
var _version = "NA";
var _currency = "1";
if(document.getElementById('IATS_Payment_ReoccurringCheck').checked)
{
if(document.getElementById('IATS_Payment_DebitCardPayment').checked && _version == "UK")
{
//Only disable the Weekly and Quarterly options for GBP
if(_currency == "3")
{
var option1 = document.getElementById('IATS_Payment_RecurringWeeklyOption');
var option2 = document.getElementById('IATS_Payment_RecurringQuarterlyOption');
if(option1!=null)
document.getElementById('IATS_Payment_ScheduleType').removeChild(option1);
if(option2!=null)
document.getElementById('IATS_Payment_ScheduleType').removeChild(option2);
}
//Hide the Begin and End date fields for GBP currency only
if(_currency == "3")
{
document.getElementById('IATS_ReoccurringDiv_BeginDate').style.display = "none";
document.getElementById('IATS_ReoccurringDiv_EndDate').style.display = "none";
}
else
{
if(window.hideRecurringBeginDate != 1)
{
document.getElementById('IATS_ReoccurringDiv_BeginDate').style.display = "block";
}
if(window.hideRecurringEndDate != 1)
{
document.getElementById('IATS_ReoccurringDiv_EndDate').style.display = "block";
}
}
}
else
{
if(typeof(theIATSPaymentBoxCore)=="undefined") {return;}
if(document.getElementById('IATS_Payment_RecurringWeeklyOption')==null && theIATSPaymentBoxCore.WeeklyVisible.toUpperCase()=="CHECKED")
{
var option_weekly = document.createElement("OPTION");
option_weekly.value = "Weekly";
option_weekly.text = "Weekly";
option_weekly.setAttribute("id", "IATS_Payment_RecurringWeeklyOption");
document.getElementById('IATS_Payment_ScheduleType').options.add(option_weekly);
}
if(document.getElementById('IATS_Payment_RecurringQuarterlyOption')==null && theIATSPaymentBoxCore.QuarterlyVisible.toUpperCase()=="CHECKED")
{
var option_quarterly = document.createElement("OPTION");
option_quarterly.value = "Quarterly";
option_quarterly.text = "Quarterly";
option_quarterly.setAttribute("id", "IATS_Payment_RecurringQuarterlyOption");
document.getElementById('IATS_Payment_ScheduleType').options.add(option_quarterly);
}
if(window.hideRecurringBeginDate != 1)
{
document.getElementById('IATS_ReoccurringDiv_BeginDate').style.display = "block";
}
if(window.hideRecurringEndDate != 1)
{
document.getElementById('IATS_ReoccurringDiv_EndDate').style.display = "block";
}
}
}
}
function showScheduleDate()
{
var selectdate = document.getElementById('IATS_Payment_ScheduleDate'); // This is the only occurance of this ID in this document....
selectdate.options.length=0;
if(document.getElementById('IATS_Payment_ScheduleType').value == 'Weekly')
{
for(i=0;i<7;i++)
{
var pOption=document.createElement("OPTION");
pOption.value=i+1;
pOption.text=theIATSPaymentBoxCore.WeekList[i]
selectdate.options.add(pOption);
}
}
else if(document.getElementById('IATS_Payment_ScheduleType').value == 'Monthly')
{
for(i=1;i<32;i++)
{
var pOption = document.createElement("option");
pOption.value = i;
pOption.text = i;
selectdate.options.add(pOption);
}
}
}
function IATSSelectPaymentType()
{
var paymentType1 = document.getElementById('IATS_Payment_CreditCardPayment');
var paymentType2 = document.getElementById('IATS_Payment_DebitCardPayment');
if(paymentType1!=null && paymentType1.checked)
{
if(document.getElementById('IATS_Payment_CreditCardDiv')!=null)
document.getElementById('IATS_Payment_CreditCardDiv').style.display = "block";
if(document.getElementById('IATS_Payment_DebitDiv')!=null)
document.getElementById('IATS_Payment_DebitDiv').style.display = "none";
}
else if(paymentType2!=null && paymentType2.checked)
{
if(document.getElementById('IATS_Payment_CreditCardDiv')!=null)
document.getElementById('IATS_Payment_CreditCardDiv').style.display = "none";
if(document.getElementById('IATS_Payment_DebitDiv')!=null)
document.getElementById('IATS_Payment_DebitDiv').style.display = "block";
}
var _version = "NA";
if(_version == "UK")
IATSUKACHRecurringDisplay();
}
// This function is called when the buttons "One Time" or "Recurring" are clicked.
// For NA, it loads or hides the 'IATS_Payment_ReoccurringSettingDiv' div.
function IATSSelectPaymentFrequency()
{
var paymentFrquency1 = document.getElementById('IATS_Payment_RecurringPayment');
var paymentFrquency2 = document.getElementById('IATS_Payment_SinglePayment');
if(paymentFrquency1!=null && paymentFrquency1.checked)
{
document.getElementById('IATS_Payment_ReoccurringCheck').checked = true;
showReoccurring();
if(theIATSPaymentBoxCore.UKCheckVisible=="CHECKED" && theIATSPaymentBoxCore.CreditCardVisible=="CHECKED")
document.getElementById("IATS_Payment_AccountTypeDiv").style.display = "block";
IATSSelectPaymentType();
}
else if(paymentFrquency2!=null && paymentFrquency2.checked)
{
document.getElementById('IATS_Payment_ReoccurringCheck').checked = false;
showReoccurring();
if(theIATSPaymentBoxCore.version=="UK")
{
document.getElementById("IATS_Payment_AccountTypeDiv").style.display = "none";
if(document.getElementById('IATS_Payment_DebitDiv')!=null)
{
document.getElementById('IATS_Payment_DebitDiv').style.display = "none";
}
if(theIATSPaymentBoxCore.CreditCardVisible=="CHECKED")
document.getElementById('IATS_Payment_CreditCardDiv').style.display = "block";
}
else
{
if(theIATSPaymentBoxCore.UKCheckVisible=="CHECKED" && theIATSPaymentBoxCore.CreditCardVisible=="CHECKED")
document.getElementById("IATS_Payment_AccountTypeDiv").style.display = "block";
IATSSelectPaymentType();
}
}
document.getElementById('IATS_Payment_PaymentAccountInputDiv').style.display = "block";
}
function IATSUKDirectDebit()
{
if(theIATSPaymentBoxCore.version == "UK" && theIATSPaymentBoxCore.currency == "3" && document.getElementById("IATS_Payment_ACHAgreementCheckbox")!=null )
{
if(document.getElementById("IATS_Payment_ACHAgreementCheckbox").checked)
{
if(IATSValidatePaymentInput()==false)
{
document.getElementById("IATS_Payment_ACHAgreementCheckbox").checked = false;
return;
}
if(document.getElementById("IATS_Payment_DirectDebitPage1Div")!=null)
document.getElementById("IATS_Payment_DirectDebitPage1Div").style.display="block";
if(document.getElementById("IATS_ContentSectionDiv")!=null)
document.getElementById("IATS_ContentSectionDiv").style.display="none";
//Can't use document.location.protocol in template file. must define it in this file
document.getElementById("IATS_Payment_DirectDebitPage1Img1").src="https://"+theIATSPaymentBoxCore.serverURL+"/paymentbox/img/bacs_approved.png";
document.getElementById("IATS_Payment_DirectDebitPage1Img3").src="https://"+theIATSPaymentBoxCore.serverURL+"/paymentbox/img/iats_logo.jpg";
document.getElementById("IATS_Payment_DirectDebitPage1Img2").src="https://"+theIATSPaymentBoxCore.serverURL+"/paymentbox/img/DirectDebit_logo.png";
document.getElementById("IATS_Payment_DirectDebitPage2Img1").src="https://"+theIATSPaymentBoxCore.serverURL+"/paymentbox/img/bacs_approved.png";
document.getElementById("IATS_Payment_DirectDebitPage2Img3").src="https://"+theIATSPaymentBoxCore.serverURL+"/paymentbox/img/iats_logo.jpg";
document.getElementById("IATS_Payment_DirectDebitPage2Img2").src="https://"+theIATSPaymentBoxCore.serverURL+"/paymentbox/img/DirectDebit_logo.png";
document.getElementById("IATS_Payment_DirectDebitPage3Img1").src="https://"+theIATSPaymentBoxCore.serverURL+"/paymentbox/img/bacs_approved.png";
document.getElementById("IATS_Payment_DirectDebitPage3Img3").src="https://"+theIATSPaymentBoxCore.serverURL+"/paymentbox/img/iats_logo.jpg";
document.getElementById("IATS_Payment_DirectDebitPage3Img2").src="https://"+theIATSPaymentBoxCore.serverURL+"/paymentbox/img/DirectDebit_logo.png";
document.getElementById("IATS_Payment_DirectDebitPage4Img1").src="https://"+theIATSPaymentBoxCore.serverURL+"/paymentbox/img/bacs_approved.png";
document.getElementById("IATS_Payment_DirectDebitPage4Img3").src="https://"+theIATSPaymentBoxCore.serverURL+"/paymentbox/img/iats_logo.jpg";
document.getElementById("IATS_Payment_DirectDebitPage4Img2").src="https://"+theIATSPaymentBoxCore.serverURL+"/paymentbox/img/DirectDebit_logo.png";
document.getElementById("IATS_Payment_DirectDebitPage5Img1").src="https://"+theIATSPaymentBoxCore.serverURL+"/paymentbox/img/bacs_approved.png";
document.getElementById("IATS_Payment_DirectDebitPage5Img3").src="https://"+theIATSPaymentBoxCore.serverURL+"/paymentbox/img/iats_logo.jpg";
document.getElementById("IATS_Payment_DirectDebitPage5Img2").src="https://"+theIATSPaymentBoxCore.serverURL+"/paymentbox/img/DirectDebit_logo.png";
scroll(0,0);
}
}
}
// Show help for ACH check format
function IATSOpenCNDHelpImg()
{
var imgurl = "https://www.iatspayments.com/paymentbox/img/CAN.jpg";
var content="
";
window1=window.open("","_blank","menubar=1,resizable=1,width=350,height=250");
window1.document.write(content);
window1.moveTo(550,200);
window1.opener = null;
return false;
}
function IATSOpenUSHelpImg()
{
var imgurl = "https://www.iatspayments.com/paymentbox/img/US.jpg";
var content="
";
var window1=window.open("","_blank","menubar=1,resizable=1,width=350,height=250");
window1.document.write(content);
window1.moveTo(550,200);
window1.opener = null;
return false;
}
function IATSOpenCVV2Img()
{
var imgLang = '';
var imgurl = "https://www.iatspayments.com/paymentbox/img/cvv2.jpg";
if (imgLang.toUpperCase() == "FR")
imgurl = "https://www.iatspayments.com/paymentbox/img/cvv2_fr.jpg";
window1=window.open(imgurl,"_blank","menubar=1,resizable=1,width=350,height=250");
window1.moveTo(550,200);
window1.opener = null;
return false;
}
function IATSOpenUKHelpImg()
{
var imgurl = "https://www.uk.iatspayments.com/paymentbox/img/UK.jpg";
var content="
";
window1=window.open("","_blank","menubar=1,resizable=1,width=350,height=250");
window1.document.write(content);
window1.moveTo(550,200);
window1.opener = null;
return false;
}
function IATSOpenSEPAHelpImg()
{
var imgurl = "https://www.uk.iatspayments.com/paymentbox/img/SEPA.png";
window1=window.open(imgurl,"_blank","menubar=1,resizable=1,width=700,height=400");
window1.moveTo(550,200);
window1.opener = null;
return false;
}
function IATSOpenTLSHelp()
{
settings = "toolbar=no,location=no,directories=no," +
"status=no,menubar=no,scrollbars=yes," +
"resizable=yes,width=800,height=800";
NewWindow=window.open('http://content.iatspayments.com/tls-being-retired', 'TLSWin', settings);
}
function IATSOpenUpgradeBrowserHelp()
{
settings = "toolbar=no,location=no,directories=no," +
"status=no,menubar=no,scrollbars=yes," +
"resizable=yes,width=800,height=800";
NewWindow=window.open('http://content.iatspayments.com/tls-browser-in-need-of-updates','TLSWin',settings);
}
function IATSValidCCNumber(ccNum)
{
if(ccNum.length<2)
return false;
var m = 0;
var n = 0;
for(var i=ccNum.length-2;i>=0;i--)
{
if(n==0)
{
m = m+2*(ccNum.charCodeAt(i)-48);
if (2*(ccNum.charCodeAt(i)-48)>9)
m++;
n++;
}
else
{
m = m +1*(ccNum.charCodeAt(i)-48);
n = 0;
}
}
m = 10 - m % 10;
if (m==10) m=0;
if(m!=ccNum.charCodeAt(ccNum.length-1)-48)
return false;
else return true;
}
function IATSCreatePaymentBoxContentDiv()
{
var div;
div = this.createElement("div","","");
div.className = "IATS_ContentDiv";
div.setAttribute("id", "IATS_ContentSectionDiv");
// form label
var eventTitle = this.createElement("label","",this.Title);
eventTitle.className = "IATS_EventTitle";
div.appendChild(eventTitle);
// event description
var eventdescription = this.createElement("span","",this.Description);
eventdescription.className = "IATS_EventDescription";
div.appendChild(eventdescription);
// amount list
var amountList = this.createPaymentBoxAmountListDiv();
div.appendChild(amountList);
// payment
var paymentlist = this.createPaymentBoxPaymentDiv();
div.appendChild(paymentlist);
// error msg
var errorMsg = this.createPaymentBoxErrorMsgDiv();
div.appendChild(errorMsg);
if(this.SendEmailConfirmation=="CHECKED")
{
var sendemaildiv = this.createSendEmailDiv();
div.appendChild(sendemaildiv);
}
// CAPTCHA
if (this.enableCAPTCHA == "1")
{
var captcha = this.createCAPTCHADiv();
div.appendChild(captcha);
hasCaptcha = true;
}
// action
var action = this.createElement("span","","");
action.className = "IATS_Action";
var classvalue=this.BasicLayoutClassName;
var Inputlabel = this.createElement("label","","");
Inputlabel.className = classvalue;
Inputlabel.setAttribute("for", "IATS_Action_Button");
div.appendChild(Inputlabel);
var actionButton = this.createElement("button","",this.ProcessButtonLabel);
actionButton.className = "IATS_Action";
actionButton.action = "javascript";
actionButton.setAttribute("id", "IATS_ProcessAction_Button");
actionButton.setAttribute("type","button");
actionButton.value = this.ProcessButtonLabel;
actionButton.onclick = this.processTransaction;
action.appendChild(actionButton);
actionButton = this.createElement("button","",this.BackButtonText);
actionButton.className = "IATS_Action";
actionButton.action = "javascript";
actionButton.value = "Back";
actionButton.setAttribute("id", "IATS_BackAction_Button");
actionButton.setAttribute("type","button");
actionButton.style.display="none";
actionButton.onclick = this.backToReInput;
action.appendChild(actionButton);
div.appendChild(action);
//display security message.
var connectmessage = this.createElement("span","",this.ConnectingToServerMessage);
connectmessage.value = this.ConnectingToServerMessage;
connectmessage.style.display = 'none';
connectmessage.setAttribute("id","IATS_Payment_ConnectMessage");
div.appendChild(connectmessage);
// Add Share Link div
var childDiv;
if(this.DefaultSocialLinks=="CHECKED" || this.AdvancedShare=="CHECKED")
{
childDiv = this.createShareLinkDiv();
div.appendChild(childDiv);
}
var _lang = '';
var _imgurl = "";
if (_lang.toUpperCase() == "FR")
_imgurl = "https://www.iatspayments.com/paymentbox/img/b_your_data_is_secure_fr.png";
else
_imgurl = "https://www.iatspayments.com/paymentbox/img/b_your_data_is_secure.png";
var secure=this.createElement("div","","
");
secure.className="IATS_SecureDataDiv";
div.appendChild(secure);
// footer
var footer = this.createPaymentBoxFooterDiv();
div.appendChild(footer);
return div;
}
function IATSCreatePaymentBoxAmountListDiv()
{
var div;
div = this.createElement("div","","");
div.className = "IATS_AmountDiv";
div.setAttribute("id", "IATS_AmountSectionDiv");
var radioDiv;
var RadioButton,RadioButtonlabel;
var OtherInput, otherMinLabel;
var QtyDiv,QtyLabel,QtyInput;
var increaseButton,decreaseButton;
var totalDiv, totalAmount;
var AmountListTitle = this.createElement("span","",this.AmountListTitle);
AmountListTitle.className = "IATS_AmountSectionTitle";
div.appendChild(AmountListTitle);
// Get any custom amounts
if (this.clientCustomFields && this.clientCustomFields.length > 0)
IATSCreateCustomAmountFields(this.clientCustomFields, this.EventPaymentCurrencySign, div);
if(this.HideAmountInfo == 0)
{
//new shopping cart.
if(this.EnableShoppingCart=="1")
{
var shoppingcartDiv = this.createElement("div","","");
shoppingcartDiv.className = "IATS_ShoppingCartItemDiv";
div.appendChild(shoppingcartDiv);
var shoppingcartUl = this.createElement("ul","","");
shoppingcartUl.className = "IATS_ShoppingCartList1";
shoppingcartDiv.appendChild(shoppingcartUl);
for(var i=0;i 0) {
var totalPrice = 0.00;
for(var i = 0; i < priceElements.length; i++) {
totalPrice += parseFloat(priceElements[i].getAttribute("price"));
}
totalPrice = IATSGetProcessingFeeTotal(procFeeEnabled, totalPrice, procFeePercent);
totalPrice = Math.round(totalPrice*100)/100;
document.getElementById("IATS_TotalAmount").innerHTML = totalPrice.toFixed(2);
}
};
tdElement.appendChild(RadioButton);
RadioButton = this.createElement("input","","");
RadioButton.setAttribute("type", "hidden");
RadioButton.setAttribute("id","IATS_ProcessingFee_OrigAmount");
tdElement.appendChild(RadioButton);
RadioButton = this.createElement("input","","");
RadioButton.setAttribute("type", "hidden");
RadioButton.setAttribute("id","IATS_ProcessingFee_Percent");
tdElement.appendChild(RadioButton);
// Label
spanLabel = this.createElement("span","",this.processingFee_Message);
spanLabel.setAttribute("class", "IATS_AmountSpan");
tdElement.appendChild(spanLabel);
}
return div;
}
for (i=0;i max)
{
if(amountQtyMaxError != null)
amountQtyMaxError.style.display = "block"; // Show the error.
}
else
{
if(amountQtyMaxError != null)
amountQtyMaxError.style.display = "none"; // Hide the error.
}
theIATSPaymentBoxCore.iATSGetTotal();
}
})();
QtyDiv.appendChild(QtyInput);
// #4.4 - decrease quantity button
decreaseButton = this.createElement("button","","-");
decreaseButton.setAttribute("type","button");
decreaseButton.className = "IATS_IncreaseQty";
decreaseButton.onclick = (function IATSDecreaseQty()
{
var j = i;
return function(e)
{
var qtyInput = document.getElementById("IATS_Payment_Qty"+j);
if(qtyInput !=null && qtyInput .value>0)
{
document.getElementById("IATS_Payment_Qty"+j).value--;
theIATSPaymentBoxCore.iATSGetTotal();
// Update the error message.
var max = parseInt(theIATSPaymentBoxCore.AmountList[j].QtyMax);
if(isNaN(max))
max = 999999; // Empty string will be parsed to NaN, so make limit 9999.
var amountQtyMaxError = document.getElementById("IATS_Payment_QtyMaxError" + j);
// Set the value to the max if a value larger than the max is entered.
if (qtyInput.value > max)
{
if(amountQtyMaxError != null)
amountQtyMaxError.style.display = "block"; // Show the error.
}
else
{
if(amountQtyMaxError != null)
amountQtyMaxError.style.display = "none"; // Hide the error.
}
}
};
})();
QtyDiv.appendChild(decreaseButton);
// #4.5 - quantity error
var classValue = this.BasicLayoutClassName + " IATS_PaymentItemErrorMessage";
var errorValue = "Maximum is " + this.AmountList[i].QtyMax
var ErrorMsg = this.createElement("span","",errorValue);
ErrorMsg.className = classValue;
ErrorMsg.setAttribute("name", "IATS_Payment_QtyMaxError");
ErrorMsg.setAttribute("id", "IATS_Payment_QtyMaxError" + i);
QtyDiv.appendChild(ErrorMsg);
// #4.6 - max value hidden field
QtyMax = this.createElement("label","",this.AmountList[i].QtyMax);
QtyMax.style.display = "none";
QtyMax.setAttribute("name","IATS_Payment_QtyMax");
QtyMax.setAttribute("value",this.AmountList[i].QtyMax);
QtyDiv.appendChild(QtyMax);
}
// Create entries for all 'Other' amounts stored in an array called 'AmountOtherList'.
for(var i=0;i < this.AmountOtherList.length;i++)
{
// #0 - div
radioDiv = this.createElement("div","","");
radioDiv.className = "IATS_AmountItemDiv";
radioDiv.setAttribute("id", "IATS_AmountListItemDiv_Other"+i); // This id is being made unique, though the 'payment' items have no id for their encapsulating 'div' elements.
div.appendChild(radioDiv);
// #1 - label
RadioButtonlabel = this.createElement("label","","");
RadioButtonlabel.className = "IATS_RadioAmtLabel"; // Regular and 'Other' amounts share the same label.
RadioButtonlabel.setAttribute("for", "IATS_Amount_Other"+i); // Matches radio button ID
RadioButtonlabel.setAttribute("id","IATS_AmountName_Order_Other"+i); // Unique ID
RadioButtonlabel.value = this.AmountOtherList[i].Label; // I don't think this value is used. Only checkbox and textbox values are used.
radioDiv.appendChild(RadioButtonlabel);
// #2 - input: checkbox or radio button
RadioButton = this.createElement("input","IATS_NewAmountListItem","");
RadioButton.className = "IATS_RadioAmtButton";
if(this.AmountEnableMultiSelection == "1")
RadioButton.setAttribute("type", "checkbox");
else
RadioButton.setAttribute("type", "radio");
RadioButton.setAttribute("name", "IATS_NewAmountListItem"); // This name is used by regular and 'Other' amounts.
RadioButton.setAttribute("id", "IATS_Amount_Other"+i);
RadioButton.setAttribute("value", "OtherAmount"); // This value is only used for branching in logic, so we will leave it the same for all 'Other' items.
if(this.AmountDefaultChecked.toUpperCase()=="CHECKED" && this.AmountOtherList[i].Default.toUpperCase()=="CHECKED")
RadioButton.defaultChecked = true;
RadioButton.onclick = function IATSClickOtherCheckbox() // On a click of the checkbox you need to clear unchecked boxes and update total.
{
theIATSPaymentBoxCore.iATSClearUncheckedOtherBoxes();
theIATSPaymentBoxCore.iATSGetTotal();
};
RadioButtonlabel.appendChild(RadioButton);
// #2.1 - span
spanLabel = this.createElement("span","",this.AmountOtherList[i].Label);
spanLabel.setAttribute("class", "IATS_AmountSpan");
RadioButtonlabel.appendChild(spanLabel);
// #3 - input - textbox
OtherInput = this.createElement("input","IATS_AmountListItem_NewOtherAmount","");
OtherInput.className = "IATS_OtherAmount";
OtherInput.setAttribute("id", "IATS_AmountListItem_NewOtherAmount"+i); // Unique ID
OtherInput.onblur = (function IATSClickOtherAmount() // Check the associated checkbox if input text box is clicked.
{
var j = i; // Necessary to capture this snapshot of 'i'.
return function (e) // Extra reading: javascript closure.
{
document.getElementById("IATS_Amount_Other"+j).checked = true;
theIATSPaymentBoxCore.iATSClearUncheckedOtherBoxes(); // This is necessary to clear unchecked boxes when radio buttons are enabled.
theIATSPaymentBoxCore.iATSGetTotal();
}
})();
OtherInput.onkeypress = function isNumberKey(evt) // Restrict non-numbers and minus (-) symbol.
{
evt = evt || window.event;
var charCode = evt.keyCode || evt.which;
if (charCode > 31 && (charCode < 46 || charCode > 57 || charCode==47))
return false;
return true;
};
OtherInput.onkeyup = this.iATSGetTotal; // Updates total as customer types amount into box.
var procFeeEnabled = this.processingFee_Enabled;
var procFeePercent = this.processingFee_Percent;
OtherInput.onfocusout = function() {
var totalPrice = parseFloat(IATSGetProcessingFeeTotal(procFeeEnabled, document.getElementById("IATS_Payment_TotalAmount").innerHTML, procFeePercent).toFixed(2));
totalPrice = Math.round(totalPrice*100)/100;
document.getElementById("IATS_Payment_TotalAmount").innerHTML = totalPrice;
document.getElementById("IATS_Payment_TotalAmount").setAttribute("value",totalPrice.toFixed(2));
}
radioDiv.appendChild(OtherInput);
// #4 - minimum label
if(this.AmountOtherList[i].Minimum != "0" ) // If there is no minimum, don't write a minimum label.
{
otherMinLabel = this.createElement("span","",this.AmountOtherList[i].MinimumLabel1);
var classvalue = this.BasicLayoutClassName;
classvalue = classvalue + " IATS_OtherAmtMinimum";
otherMinLabel.className = classvalue;
radioDiv.appendChild(otherMinLabel);
}
// #5 - minimum error message
otherMinError = this.createElement("span","",this.AmountOtherList[i].MinimumErrorMessage);
otherMinError.className = this.BasicLayoutClassName + " IATS_PaymentMinimumErrorMessage";;
otherMinError.setAttribute("id", "IATS_PaymentItemErrorMesssage_Min"+i); // This id has to be unique so that the error can be turned on and off.
radioDiv.appendChild(otherMinError);
} // end of 'Other' for-loop
}
if (this.processingFee_Enabled == "1") {
radioDiv = this.createElement("div","","");
radioDiv.className = "IATS_AmountItemDiv";
div.appendChild(radioDiv);
// #0.1 - table
tableElement = this.createElement("table","","");
tableElement.setAttribute("width", "100%");
radioDiv.appendChild(tableElement);
trElement = this.createElement("tr","","");
tableElement.appendChild(trElement);
tdElement = this.createElement("td","","");
// Spacer
RadioButtonlabel = this.createElement("label","","");
RadioButtonlabel.className = "IATS_RadioAmtLabel";
RadioButtonlabel.setAttribute("for", "IATS_ProcessingFee");
RadioButtonlabel.setAttribute("id", "IATS_ProcessingFee");
tdElement.appendChild(RadioButtonlabel);
trElement.appendChild(tdElement);
// #2 - input
RadioButton = this.createElement("input","IATS_ProcessingFeeCheck","");
RadioButton.className = "IATS_RadioAmtButton";
RadioButton.setAttribute("type", "checkbox");
RadioButton.setAttribute("name", "IATS_ProcessingFeeCheck");
RadioButton.setAttribute("id", "IATS_ProcessingFeeCheck");
RadioButton.onclick = function IATSClickProcFee() // This is necessary to clear 'Other' boxes when a regular amount is clicked in radio button mode.
{
theIATSPaymentBoxCore.iATSGetTotal();
};
tdElement.appendChild(RadioButton);
RadioButton = this.createElement("input","","");
RadioButton.setAttribute("type", "hidden");
RadioButton.setAttribute("id","IATS_ProcessingFee_OrigAmount");
tdElement.appendChild(RadioButton);
RadioButton = this.createElement("input","","");
RadioButton.setAttribute("type", "hidden");
RadioButton.setAttribute("id","IATS_ProcessingFee_Percent");
tdElement.appendChild(RadioButton);
// Label
spanLabel = this.createElement("span","",this.processingFee_Message);
spanLabel.setAttribute("class", "IATS_AmountSpan");
tdElement.appendChild(spanLabel);
}
if(this.HideAmountInfo == 0)
{
totalDiv = this.createElement("div","","Total: "+this.EventPaymentCurrencySign);
totalDiv.className = "IATS_TotalDiv";
if(this.AmountEnableQty == "1" || this.AmountEnableMultiSelection == "1" || this.processingFee_Enabled == "1" || (this.clientCustomFields && this.clientCustomFields != ""))
totalDiv.style.display = "block";
else totalDiv.style.display = "none";
div.appendChild(totalDiv);
totalAmount = this.createElement("span","","0.00");
totalAmount.setAttribute("id","IATS_Payment_TotalAmount");
totalAmount.setAttribute("value","0.00");
totalDiv.appendChild(totalAmount);
var currency = this.createElement("span",""," " + GetCurrency());
totalDiv.appendChild(currency);
var iatsTotalAmount = this.createElement("input","","");
iatsTotalAmount.setAttribute("name","IATS_AmountListItem");
iatsTotalAmount.setAttribute("id","IATS_AmountListItem");
iatsTotalAmount.style.display = "none";
iatsTotalAmount.value = 0.00;
totalDiv.appendChild(iatsTotalAmount);
var iatsOtherAmount = this.createElement("input","","");
iatsOtherAmount.setAttribute("name","IATS_AmountListItem_OtherAmount");
iatsOtherAmount.setAttribute("id","IATS_AmountListItem_OtherAmount");
iatsOtherAmount.style.display = "none";
totalDiv.appendChild(iatsOtherAmount);
}
else
{
totalDiv = this.createElement("div","", this.TotalDescription+" "+this.EventPaymentCurrencySign);
totalDiv.className = "IATS_DefaultTotalDiv";
div.appendChild(totalDiv);
totalAmount = this.createElement("span","",this.defaultTotal);
totalAmount.setAttribute("id","IATS_Payment_TotalAmount");
totalAmount.setAttribute("value",this.defaultTotal);
totalAmount.innerHTML = this.defaultTotal+" "+this.EventPaymentCurrencySignAfterAmount;
totalDiv.appendChild(totalAmount);
var iatsTotalAmount = this.createElement("input","","");
iatsTotalAmount.setAttribute("name","IATS_AmountListItem");
iatsTotalAmount.setAttribute("id","IATS_AmountListItem");
iatsTotalAmount.style.display = "none";
iatsTotalAmount.value = 0.00;
totalDiv.appendChild(iatsTotalAmount);
var iatsOtherAmount = this.createElement("input","","");
iatsOtherAmount.setAttribute("name","IATS_AmountListItem_OtherAmount");
iatsOtherAmount.setAttribute("id","IATS_AmountListItem_OtherAmount");
iatsOtherAmount.style.display = "none";
totalDiv.appendChild(iatsOtherAmount);
}
var nonAmountErrorMsg = this.createElement("span","",this.AmountDefaultCheckedError);
nonAmountErrorMsg.className = this.BasicLayoutClassName+" IATS_PaymentMinimumErrorMessage";;
nonAmountErrorMsg.setAttribute("id", "IATS_PaymentItemErrorMesssage_NonAmount");
div.appendChild(nonAmountErrorMsg);
return div;
}
// Iterate through all 'Other' amounts and clear input fields for unchecked boxes.
function IATSClearUncheckedOtherBoxes()
{
var otherCheckboxes = IATSGetElementsByNameFilterByValue("IATS_NewAmountListItem","OtherAmount"); // Get all checkbox elements belonging to an 'OtherAmount'.
var otherInputs = document.getElementsByName("IATS_AmountListItem_NewOtherAmount"); // Get all input elements belonging to an 'OtherAmount'.
if(otherCheckboxes.length == otherInputs.length) // Should always be equal.
{
for(var i=0; i12 || parseFloat(monthfield)<=0 || parseFloat(dayfield)<=0 ||
parseFloat(yearfield)>2100 || parseFloat(yearfield)<=2009)
return false;
else
{
if(parseFloat(monthfield)==1 || parseFloat(monthfield)==3 || parseFloat(monthfield)==5 || parseFloat(monthfield)==7 || parseFloat(monthfield)==8 || parseFloat(monthfield)==10 || parseFloat(monthfield)==12)
{
if(parseInt(dayfield)>31)
return false;
else returnval=true;
}
else if(parseFloat(monthfield)==4 || parseFloat(monthfield)==6 || parseFloat(monthfield)==9 || parseFloat(monthfield)==11)
{
if(parseInt(dayfield)>30)
return false;
else returnval=true;
}
else if(parseFloat(monthfield)=='2' && parseInt(yearfield)%4==0)
{
if(parseInt(dayfield)>29)
return false;
else returnval=true;
}
else if(parseInt(dayfield)>28)
return false;
else returnval=true;
}
}
if (returnval==false) input.select();
return returnval;
}
// Check for valid zip/postal code.
function IATScheckZipCode()
{
var country;
if(document.getElementById("IATS_PaymentItemDiv_Country").style.display=="none")
country = null;
else country = document.getElementById("IATS_PaymentItemInput_Country");
var zipCode = document.getElementById("IATS_PaymentItemInput_ZipCode");
var zipError = document.getElementById("IATS_PaymentItemErrorMesssage_ZipCode");
if(zipCode==null || country==null)
return true;
// Empty zipcode. Set client-supplied message and don't check for country.
if (zipCode.value.length == 0)
{
if (zipError != null)
zipError.innerHTML = theIATSPaymentBoxCore.ClientZipcodeError;
return true; // This function treats empty zipcodes as valid. Min length checking is done elsewhere.
}
else if (country.value.toUpperCase()=="UNITED STATES" || country.value.toUpperCase()=="US")
{
// Valid case 1: Five-digit US zipcode, i.e. 12345
if (zipCode.value.length == 5 && IsNumeric(zipCode.value))
return true;
// Valid case 2: Zip+4 format, i.e. 12345-6789
else if (zipCode.value.length == 10 && IsNumeric(zipCode.value.substring(0,5)) && zipCode.value.charAt(5) == '-' && IsNumeric(zipCode.value.substring(6)))
return true;
// Invalid U.S. Zipcode
else
{
if (zipError != null)
zipError.innerHTML = "ZIP Code must be '12345' or '12345-6789' format.";
return false;
}
}
else if (country.value.toUpperCase()=="CANADA" || country.value.toUpperCase()=="CA")
{
var tempZipCode = zipCode.value.split(' ').join(''); // Remove whitespace without modifying original value.
if(tempZipCode.length == 6 &&
IsNumeric(tempZipCode.charAt(1)) && IsNumeric(tempZipCode.charAt(3)) && IsNumeric(tempZipCode.charAt(5)) &&
IsAlphabetic(tempZipCode.charAt(0)) && IsAlphabetic(tempZipCode.charAt(2)) && IsAlphabetic(tempZipCode.charAt(4)))
{
return true;
}
else
{
if (zipError != null)
zipError.innerHTML = "Postal Code must be A1B 2C3 format.";
return false;
}
}
else return true; // All other countries
}
function IsNumeric (text)
{
var validExp = /^[0-9]+$/;
var validText = true;
if(!text.match(validExp))
validText = false;
return validText;
}
function IsAlphabetic (text)
{
var validExp = /^[a-zA-Z]+$/;
var validText = true;
if(!text.match(validExp))
validText = false;
return validText;
}
function IATSShowSecurityForm(lang)
{
var content="";
}
else
{
content += "
Transaction Security
";
content += "All Communications initiated by this form are transmitted via Secure Sockets Layer (SSL). ";
content += "The SSL protocol is the industry standard method for creating an encrypted, secure connection between your web browser and a web server.";
content += "";
content += "About This Form
This form is issued by iATS Payments, Inc. to process transactions.
";
content += "About iATS Payments, Inc";
content += "
iATS Payments is a Level 1 Payment Card Industry (PCI) certified company and ensures all transactions are handled with absolute security.";
content += "
Suite 600-1188 West Georgia Street, Vancouver, BC";
content += "
Email: iats@iatspayments.com";
content += "
Toll Free: 1-888-955-5455 (Option 1)";
content += "
Fax: 604-682-1715
";
content += "www.iatspayments.com";
content += "
";
}
var window1=window.open("","_blank","location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,width=400,height=600");
window1.document.write(content);
window1.moveTo(550,200);
window1.opener = null;
return false;
}
function IATSShowScript()
{
if(document.getElementById("IATS_EmbedScript").style.display=="none")
{
document.getElementById("IATS_EmbedScript").style.display="block";
document.getElementById("IATS_EmbedScriptButton").style.display="none";
}
else
{
document.getElementById("IATS_EmbedScript").style.display="none";
document.getElementById("IATS_EmbedScriptButton").style.display="block";
}
}
function IATSCreateShareLinkDiv()
{
var shareLinkDiv = this.createElement("div","IATS_Payment_ShareLinkDiv","");
shareLinkDiv.setAttribute("id","IATS_Payment_ShareLinkDiv");
shareLinkDiv.className="IATS_SocialMediaDiv";
if(this.DefaultSocialLinks=="CHECKED")
{
var _child = this.createElement("a","","SHARE: ");
shareLinkDiv.appendChild(_child);
var _url = this.FormURL;
var _title = this.FormURLTitle;
var _email = this.EmailFriendMessage;
_titel = _title.replace(/