If you are using one of Adumo Online's Enterprise solutions and hosting your own payment page, you may find the below code and script examples helpful.
These examples can help to you to develop a more secure payment page and can also enhance the customer payment checkout experience aiding in a higher conversion rate.
The below provides information about identifying a credit card type from a card number's numeric range and number of digits.
First digit must be a 3 and second digit must be a 4 or 7. Valid length: 15 digits.
First digit must be 3 and second digit must be 0, 6, or 8. Valid length: 14 digits.
Valid length: 16 digits. First 8 digits must be in one of the following ranges:
60110000 through 60119999
65000000 through 65999999
62212600 through 62292599
First four digits must be 2014 or 2149. Valid length: 15 digits.
First two digits must be 35. Valid length: 16 digits
First digit must be a 5 and second digit must be in the range 1 through 5 inclusive. Valid length: 16 digits.
First digit must be a 4. Valid length: 13 or 16 digits.
= "51" && $firstTwo <= "55") {
return "MasterCard";
}
if($firstTwo == "34" || $firstTwo == "37") {
return "American Express";
}
if($firstTwo == "36") {
return "Diners Club International";
}
if($firstFour == "2014" || $firstFour == "2149") {
return "Diners Club enRoute";
}
if($firstThree >= "300" && $firstThree <= "305") {
return "Diners Club Carte Blanche";
}
if(($firstFouß≈r == "6011") || ($firstSix >= "622126" && $firstSix <= "622925") || ($firstThree >= "644" && $firstThree <= "649") || ($firstTwo == "65")) {
return "Discover Card";
}
if($firstTwo >= "35") {
return "JCB";
}
//If the above logic does not identify the card number, return this message.
return "Other / Unknown Card Type";
}
else {
//If the incoming card number is not numeric, return this message.
return "Unknown Card Type / Number";
}
}
?>
Download
Credit card number validation can be performed using a check sum that verifies the credit card number is valid and not a random number before sending it for authorization. This self-checking method is referred to as a Luhn Check or Mod-10 Method and is an international standard for validating credit card numbers. All credit cards issued today are based on a modulus 10 algorithm and will pass the Luhn Algorithm. This means a made up credit card number will fail the Luhn Algorithm while a valid one will pass.
Please note: If a credit card number passes the Luhn check this only means the number is in a valid format and does not in any way indicate if the credit card is valid or that the transaction will be approved. transaction must be processed for authorization for approval. Using the Luhn check will enable the error to be displayed to the user faster and reduce the number of unnecessary transactions the merchant has to pay for.
9) {
$digit-=9;
}
}
// Total up the digits
$total+=$digit;
}
//If the total mod 10 equals 0, the number is valid. There can be instances where false credit cards will pass this function (test cards, etc). These will however be declined by the merchant bank during the authorization process.
return ($total % 10 == 0) ? TRUE : FALSE;
}
else {
return FALSE;
}
}
?>
Download
Make it clear to the card holder which box is month and which is year. The recommended option is to have the user select their expiration date from two separate drop down menus. One for month and one for year. If the card holder does not select a month or year, the payment page validation will request them to do so. This will ensure that the card holder makes a selection prior to clicking on "pay now".
Expiration Year
Ensure that you do not offer previous years in your selection menu. This can be automated within your code so that each year you don't have to come back to remove the previous year and add new years.
The card security code (CSC) sometimes called Card Verification Data (CVD), Card Verification Value (CVV or CVV2), Card Verification Value Code(CVVC), Card Verification Code (CVC or CVC2), or Card Code Verification (CCV)[ are different terms for security features for credit or debit card transactions, providing increased protection against credit card fraud.
As additional account security, every credit card comes with a special three- or four-digit code generally known as a CVV2 or CVV number. Cardholders will be requested to enter this when processing an online payment. An identity thief who has come across credit card information illegally will not have access to the CVV number if they do not have physical access of the card.
Visa, MasterCard, and Discover Card use a three digit CVV number and place it on the back of their credit cards. American Express uses a four digit number and places it on the front of their credit cards. The purposes of the below code is to see if CVV number contains the correct amount of digits for its credit card type.
Download
When added between the and tags on your website, this script disables the right mouse button, which adds another element of security to your web pages by restricting access to the source code, properties, and other aspects.
Download
This piece of JavaScript stops people from opening links on your web pages in new browser windows. This is especially useful if you use frames to add another layer of security to your websites.
Download
To prevent users from double clicking the "Pay Now" button on your website and then being billed twice on their credit card, the following JavaScript can be implemented. To prevent users from double clicking the "Pay Now" button on your website and then being billed twice on their credit card, the following JavaScript can be implemented.
This code only allows a button to be clicked once, if clicked again a dialog is displayed and no additional payment is processed.
Download
This script prevents URLs from appearing in the status bar at the bottom of the browser when the mouse is hovering over links. This is especially useful if you use frames to add another layer of security to your websites.
Click here to go to Adumo Online.
Download