When you say fails to validate, you mean validation says it is an invalid card?
Credit card numbers have a specific format. Do debit cards have the same specific number format, and they differ between Mastercard and other cards.
Correct - it says the credit card number is invalid, the field is outlined in red and my submit button stays disabled as the form is not validated. I haven't actually tried processing a manual transaction with our payment provider. But my partner uses it everywhere else for shopping as a credit card and my understanding is that debit cards are supposed to behave the same as credit cards - just with your own funds and no 'credit'.
The debit card has the same number of digits as my credit card - but I'm not sure of the format that they use.
I think that each type of card has a unique set of starting numbers - eg. Visa starts with 4564 - but this is a big assumption on my part.
If my posts answer your question or help, please mark as such.
To perform the validation, it uses the following guidelines:
- Visa: 13 or 16 digits
- MasterCard: 16 digits
- Discover: 16 digits
- American Express: 15 digits
- Diners Club: 14 digits or 16 digits if it also functions as MasterCard
- Visa: 4
- MasterCard: 51 to 55
- Discover: 6011
- American Express: 34 or 37
- Diners Club: 300 to 305, 36 or 38, 51 to 55
Well that is strange.
This card number is 5163 XXXX XXXX 8040
So 16 digits starting with a prefix of 51 but fails to validate.
It says credit card number is invalid.
Drivin me nuts!
This may be a crazy question, but you do realize that the Flex CreditCardValidator doesn't actually validate that the card has an active account attached to it, it only validates that the number is correct, based on the formats for the various card number formats.
Yep - just doing validation on-change of the textfield - but not actually communicating with the payment provider.
Can you think of any other ways for me to dig deeper?
It seems not all credit card numbers in the full range are valid, so if you try 5100000000000000 it will fail.
It could be that debit cards cannot be validated with CreditCardFormatter.
You could possibly copy some code from the CreditCardValidator.as file in your Flex install to a Flex app and get it to run the algorithm that checks the credit card number and see what it thinks is valid.
I really dislike it when I make a mistake... but yet another lesson learnt.
I had laid out the order of the payment form with the credit card number first, then CVN, then card type.
As the card type had defaulted to Visa the number always failed and when you changed the card type it didn't re-validate the number.
So just need to change the order of the fields!
Thanks for your replies.
Answer: select the card type before entering the card number.
So it appears that the person who starts a discussion can't answer it in this new version of the forum? I select the " " radio button. But it still comes up as not answered... oh well.
Message was edited by: kevnug
Well, I hope my posts helped enough to get the 5 points.
Yeah thanks! Prompted me to look at CreditCardValidator.as which is where I noticed the card type code.