Skip to content

Commit 26283c8

Browse files
Merge remote-tracking branch 'remotes/github/MAGETWO-91784' into EPAM-PR-19
2 parents a7a9100 + 34af04f commit 26283c8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-number-validator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ define([
3636
return resultWrapper(null, false, false);
3737
}
3838

39-
value = value.replace(/\-|\s/g, '');
39+
value = value.replace(/|\s/g, '');
4040

4141
if (!/^\d*$/.test(value)) {
4242
return resultWrapper(null, false, false);

app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/validator.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
}(function ($, cvvValidator, creditCardNumberValidator, yearValidator, monthValidator, creditCardData) {
2424
'use strict';
2525

26+
$('.payment-method-content input[type="number"]').on('keyup', function () {
27+
if ($(this).val() < 0) {
28+
$(this).val($(this).val().replace(/^-/, ''));
29+
}
30+
});
31+
2632
$.each({
2733
'validate-card-type': [
2834
function (number, item, allowedTypes) {

0 commit comments

Comments
 (0)