validateCardExpiry always returns false
mikemand opened this issue · comments
Expected behavior
$.payment.validateCardExpiry(expiry);
should return true if a valid month and year (for example 10/20
) are passed in the expiry
object.
Actual behavior
Using var expiry = $('input.card-expiry').payment('cardExpiryVal');
to get the expiration value, $.payment.validateCardExpiry()
always returns false no matter what format I pass the month and year. Likewise, any month and year combination I have tried fails. Here are some that I've tried:
$.payment.validateCardExpiry(expiry);
$.payment.validateCardExpiry(expiry.month, expiry.year);
$.payment.validateCardExpiry(expiry.month + '', expiry.year + '');
$.payment.validateCardExpiry("'" + expiry.month + "'", "'" + expiry.year + "'");
$.payment.validateCardExpiry(new String(expiry.month), new String(expiry.year));
I have tested on Chrome Version 53.0.2785.143 (64-bit) on OS X 10.11.6 so far.
Steps to reproduce
An example of the problem can be found here: http://jsfiddle.net/gosseti/x9vhpeL7/ (from the article here: http://gosseti.com/demos/a-better-card-payment-form). The Expires
field should be outlined in green when putting in any valid expiration date, but it isn't.
How odd. It appears to be working now. Thank you for working the voodoo and correcting the problem. 😄