• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Problem with credit card validation rule function

Problem with credit card validation rule function 15 years 1 day ago #10344

i made this validation code but is not working. please some one help me.
function validateCC($cardnumber,$CardType) {
 
	if($CardType == "American Express") {
	$denum = "American Express";
	} elseif($CardType == "Dinners") {
	$denum = "Diner's Club";
	} elseif($CardType == "Discover") {
	$denum = "Discover";
	} elseif($CardType == "MasterCard$CardType") {
	$denum = "Master Card";
	} elseif($CardType == "Visa") {
	$denum = "Visa";
	}
 
	if($CardType == "American") {
	$pattern = "/^([34|37]{2})([0-9]{13})$/";//American Express
	if (preg_match($pattern,$cardnumber)) {
	$verified = true;
	} else {
	$verified = false;
	}
 
 
	} elseif($CardType == "Dinners") {
	$pattern = "/^([30|36|38]{2})([0-9]{12})$/";//Diner's Club
	if (preg_match($pattern,$cardnumber)) {
	$verified = true;
	} else {
	$verified = false;
	}
 
 
	} elseif($CardType == "Discover") {
	$pattern = "/^([6011]{4})([0-9]{12})$/";//Discover Card
	if (preg_match($pattern,$cardnumber)) {
	$verified = true;
	} else {
	$verified = false;
	}
 
 
	} elseif($CardType == "Master") {
	$pattern = "/^([51|52|53|54|55]{2})([0-9]{14})$/";//Mastercard
	if (preg_match($pattern,$cardnumber)) {
	$verified = true;
	} else {
	$verified = false;
	}
 
 
	} elseif($CardType == "Visa") {
	$pattern = "/^([4]{1})([0-9]{12,15})$/";//Visa
	if (preg_match($pattern,$cardnumber)) {
	$verified = true;
	} else {
	$verified = false;
	}
 
	}
 
	if($verified == false) {
	//Do something here in case the validation fails
	return false;
 
	} else { //if it will pass...do something
	return true;
	}
 
 
}


This is the error: Warning: Missing argument 2 for validateCC()
The administrator has disabled public write access.

Re:Problem with credit card validation rule function 14 years 11 months ago #10375

I'd like help on the same topic please
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!