0

In my PayPal Pro credit card payment system, I use the Luhn algorithm function given in the first answer to this question. However, I have several US clients who apparently tried to pay with their credit cards and their details were rejected by the function (return false), although my script allows them to try any number of times.

At the same time, I know other clients' CC details were indeed accepted by the function and payments were successful.

I conclude there must be something wrong with the function itself. Is that possible?

Community
  • 1
  • 1
drake035
  • 3,955
  • 41
  • 119
  • 229

1 Answers1

0

To answer your question I'd have to get a look at your function. You didn't include that here for review.

That said, I'm curious why you're messing with that at all..?? If the credit card is invalid the PayPal API will return an error that informs the user of this. Let their system handle it for you. No need to add extra checks of your own.

Drew Angell
  • 25,968
  • 5
  • 32
  • 51
  • 1
    I did include it :) You must click on the link in the second line of the body of my question. I used this because I understood it was standard practice to check CC numbers before sending them to PayPal or whatever. But you're right, why bothering if they do it for us anyway? In other words, what is the point of the Luhn algorithm, at least when doing PayPal Pro payment? – drake035 Mar 17 '13 at 20:22