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

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

Closed
rafaelxapa opened this issue Nov 11, 2020 · 2 comments
Closed

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

rafaelxapa opened this issue Nov 11, 2020 · 2 comments

Comments

@rafaelxapa
Copy link

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}

@rafaelxapa
Copy link
Author

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

@r-martins
Copy link
Owner

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.

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

No branches or pull requests

2 participants