r-martins/PagSeguro-Magento-Transparente-M2

Simples menorias na validação de números de data CPF e CCV

Closed this issue · 2 comments

vendor/ricardomartins/pagseguro/view/frontend/web/js/view/payment/method-renderer/rm_pagseguro_ccmethod.js

limitdate: function(data, e) {
if($(e.currentTarget).val().length == 2) {
return false;
}
return true;
},
limityear: function(data, e) {
if($(e.currentTarget).val().length == 4) {
return false;
}
return true;
},
limitcpf: function(data, e) {
if($(e.currentTarget).val().length == 11) {
return false;
}
return true;
},

vendor/ricardomartins/pagseguro/view/frontend/web/template/payment/cc-form.html
event: {keypress: limityear}

faltou o CCV, mas deu pra enteder a lógica

Show, @rafaelxapa .
Desculpe a demora em retornar, mas só hoje estou mexendo justamente nas melhorias do cartão.
Acabei de implementar sua sugestão. Fiz um pouco diferente...

...
event: {
        keypress: function(data, e){ return e.currentTarget.value.length < 11;}
}

Vai sair na 2.8.1.