"Arthur Pratz" <AP****@worldnet.att.net> wrote in message
news:JS***********************@bgtnsc04-news.ops.worldnet.att.net...
Hi all,
I have been working on this site for a while now.
I am posting on this newsgroup for honest reviews please.
I will be working on the store link with accepting credit cards online. So
any tips for making an online checkout would be helpful. I will be using
Miva Merchant to do that.
Thanks for your time,
Mike Pratz
http://www.chowardcompany.com
One thing no one has seemed to touch on is the "credit card" part of the
request in your post...
I can assist in one direction--here is a simple function that will validate
a credit card number using the Visa/Mastercard verification formula
(written several years ago when working for a credit card company):
function Verify_Account_Number(ysacctnum) {
var temp_string="";
var temp_num=0;
var wloop=0;
var wtemparray=new Array();
var wremainder = 0;
var leftdigit = 0;
var rightdigit = 0;
var stempacct = "";
var wlength = 0;
var stemp ="";
stempacct=ysacctnum.toString();
if (stempacct.length != 16) return false;
for (wloop = 0; wloop < stempacct.length-1; wloop++) {
temp_string = stempacct.substr(wloop,1);
temp_num=temp_string.valueOf();
wremainder = wloop % 2;
if (wremainder == 0){
//odd
wtemparray[wloop] = temp_num * 2;
if (wtemparray[wloop] >= 10) {
temp_string = wtemparray[wloop].toString();
leftdigit = temp_string.substr(0,1);
rightdigit = temp_string.substr(1,1);
wtemparray[wloop] = (1*leftdigit.valueOf()) +
(1*rightdigit.valueOf());
}
}
else {
//EVEN
wtemparray[wloop] = (temp_num*1);
}
}
temp_num = 0;
for(wloop=0;wloop<stempacct.length-1;wloop++) {
temp_num = wtemparray[wloop].valueOf() + temp_num.valueOf();
}
temp_string = temp_num.toString();
switch (temp_string.substr(0,1)) {
case '1':
temp_num = 20 - temp_num.valueOf();
break;
case '2':
temp_num = 30 - temp_num.valueOf();
break;
case '3':
temp_num = 40 - temp_num.valueOf();
break;
case '4':
temp_num = 50 - temp_num.valueOf();
break;
case '5':
temp_num = 60 - temp_num.valueOf();
break;
case '6':
temp_num = 70 - temp_num.valueOf();
break;
case '7':
temp_num = 80 - temp_num.valueOf();
break;
case '8':
temp_num = 90 - temp_num.valueOf();
break;
case '9':
temp_num = 100 - temp_num.valueOf();
break;
}
if (temp_num == 10) temp_num = 0;
temp_string = ysacctnum.toString();
wlength = temp_string.length;
temp_string = temp_num.toString();
if (temp_string == ysacctnum.substr(wlength-1,1)) {
return true;
}
else {
return false;
}
}
This function will only validate Visa and Mastercard account numbers, so if
your site accepts other types of credit cards, you will have to contact
their issuers to determine the validation routine.