839 error validating cardaccount number checksum
The algorithm to validate a credit card number starts by adding the value of every other digit, starting from the right-most digit and working left.
Next, you do the same thing with the digits skipped in the first step, but this time you double the value of each digit and add the value of each digit in the result.
In this post we have mentioned How to Validate Credit Card Number Using PHP.So another task that can be useful is determining the credit card type.Listing 3: Determining a credit card's type method simply loops through this array, looking for the first description that would match the credit card number being tested.Finally, you add both totals together and if the result is evenly divisible by 10, then the card has passed validation.Of course, this would be clearer with a bit of code and Listing 1 shows my method assumes that all spaces and other non-digit characters have been stripped from the card number string.
Writing code to process credit cards involves a number of issues that need to be addressed.