You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was reported by Ken Utting, theme developer at GORUCK:
There's a bug in the Core8 code, which prevents the Month/Year dropdowns from validating correctly when creating a Payment Method on the My Account page.
The method expirationDateInPast incorrectly returns false when validation fails, instead of a string. Also, the method incorrectly treats an empty Month selection as valid, because an empty Month selection can be represented by 0.
The method occurs in the file /scripts/modules/models-paymentmethods.js. Here is the correct code:
expirationDateInPast: function (value, attr, computedState) {
if (!this.selected) return undefined;
var expMonth = this.get('expireMonth'),
expYear = this.get('expireYear'),
exp,
thisMonth,
isValid;
// Fix bugs in Core8: provide better test for expMonth and return string instead of false
if (isNaN(expMonth) || expMonth < 1 || isNaN(expYear))
return Hypr.getLabel('cardExpInvalid');
exp = new Date(expYear, expMonth - 1, 1, 0, 0, 0, 0);
thisMonth = new Date();
thisMonth.setDate(1);
thisMonth.setHours(0, 0, 0, 0);
isValid = exp >= thisMonth;
if (!isValid) return Hypr.getLabel('cardExpInvalid');
},
You can reproduce the bug in our stock Core8 sandbox:
Open https://t13527-s18779.sandbox.mozu.com/myaccount
Log in with credentials [email protected] / fredflint1
Click on 'Fred' or click the link in step 1 to go to My Account
Click on Add New Card
Click on Save
Without the changes above, these steps will cause the Card Type, Card Number and Name on Card fields to display errors, but the Expires dropdowns have no error displayed. In fact, if valid information is placed in the other fields, Mozu will, in fact, save the card, with a month of 0 and no year.
The text was updated successfully, but these errors were encountered:
This was reported by Ken Utting, theme developer at GORUCK:
There's a bug in the Core8 code, which prevents the Month/Year dropdowns from validating correctly when creating a Payment Method on the My Account page.
The method expirationDateInPast incorrectly returns false when validation fails, instead of a string. Also, the method incorrectly treats an empty Month selection as valid, because an empty Month selection can be represented by 0.
The method occurs in the file /scripts/modules/models-paymentmethods.js. Here is the correct code:
You can reproduce the bug in our stock Core8 sandbox:
Open https://t13527-s18779.sandbox.mozu.com/myaccount
Log in with credentials [email protected] / fredflint1
Click on 'Fred' or click the link in step 1 to go to My Account
Click on Add New Card
Click on Save
Without the changes above, these steps will cause the Card Type, Card Number and Name on Card fields to display errors, but the Expires dropdowns have no error displayed. In fact, if valid information is placed in the other fields, Mozu will, in fact, save the card, with a month of 0 and no year.
The text was updated successfully, but these errors were encountered: