Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep getting "Card number is invalid" #58

Open
TommyLeong opened this issue Jul 5, 2020 · 3 comments
Open

Keep getting "Card number is invalid" #58

TommyLeong opened this issue Jul 5, 2020 · 3 comments

Comments

@TommyLeong
Copy link

TommyLeong commented Jul 5, 2020

Screenshot 2020-07-05 at 9 46 52 PM

Nothing fancy done on the code. But the **field cardNumber** keeps returning me INVALID even if I key in the following - random 16 digits number - Real VISA / MASTER card number

Am I missing something?

<CreditCardInput
            fieldStyle={
              state.paymentDetailsError ? { border: "1px solid red" } : {}
            }
            cardNumberInputProps={{
              value: state.cardNumber,
              onChange: handleCardNumberChange,
            }}
            cardExpiryInputProps={{
              value: state.expiry,
              onChange: handleCardExpiryChange,
            }}
            cardCVCInputProps={{
              value: state.cvc,
              onChange: handleCardCVCChange,
            }}
            fieldClassName="input"
          />
@olitomas
Copy link

olitomas commented Jan 7, 2021

That is because 4343 4343 4343 4343 is invalid.

See more about valid credit cards here: https://www.validcreditcardnumber.com/

@TommyLeong
Copy link
Author

@olitomas Good info about the link you shared (Luhn Algorithm Check), but I've tried with my actual VISA credit card as well and it didn't get passed either. Why was that?

@olitomas
Copy link

olitomas commented Jan 7, 2021

Thats kind of hard to know without knowing your credit card number.... and sending a stranger on the internet your credit card number is a recipe for a bad time! So you are going to have to figure that one out for your self 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants