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

Set card type after card number has been mutated #34

Closed
wants to merge 2 commits into from
Closed

Set card type after card number has been mutated #34

wants to merge 2 commits into from

Conversation

Numan1617
Copy link
Contributor

Resolves #33

@Numan1617
Copy link
Contributor Author

Thanks @tbellenger completely missed that blank check in getType

@olivierbellone
Copy link
Contributor

Hi @Numan1617, sorry for the very late reply! This looks good to me, except I think it'd be cleaner to reset type to null rather than an empty string.

r? @brandur cc @stripe/api-libraries

@Numan1617
Copy link
Contributor Author

@olivierbellone Unfortunately since making this PR I've deleted my repo so I can't update with your requested change. Would you mind if I were to open a new PR to address the original issue and your requested change?

@olivierbellone
Copy link
Contributor

@Numan1617 Absolutely not! Thanks for taking the trouble.

@@ -280,6 +280,8 @@ public String getNumber() {

public void setNumber(String number) {
this.number = number;
this.type = "";
this.type = getType();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty minor, but I think that getType() will always return a value so you can probably just leave out blanking this.type on the previous line completely.

@mrmcduff-stripe
Copy link
Contributor

This has been addressed elsewhere

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

Successfully merging this pull request may close these issues.

Card number validation returns false in various cases it shouldn't
4 participants