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

Single face card (front only) fails on isValid() #144

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

caruccio
Copy link

@caruccio caruccio commented Jun 9, 2014

No description provided.

@TheRyanBurke
Copy link

When can we expect a new release with this change?

@estenp
Copy link

estenp commented Apr 28, 2015

Thank you for addressing this issue. I was struggling with validating AmEx. Needs to be merged

I did run into an issue, though, where if you were trying to validate before the card had began rendering, or before this.product exists, as I see it, the validation using card.isValid() would throw an error because this.product cannot be found. For example if you tried to submit before ever touching the "card". I altered your addition like so:

if (this.product) {
     if (this.product.faces === 'both') {
       return !this.el.front.hasClass('invalid') && !this.el.back.hasClass('invalid');
     } else if (this.product.faces === 'front') {
       return !this.el.front.hasClass('invalid');
     } else {
       return !this.el.back.hasClass('invalid');
     }
  } else {
    return false;
  }

This seems to be working for me, so far.

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.

3 participants