Adyen / adyen-magento2

Adyen Payment plugin for Magento2
MIT License
155 stars 211 forks source link

[PW-7070] Add CNPJ to Brazilian Social Security Number validation, when payment is boleto #1644

Closed flaviosdev closed 2 years ago

flaviosdev commented 2 years ago

Is your feature request related to a problem? Please describe. Yep. In the last step of checkout, choosing boleto payment, the validation accepts only CPF (Brazilian Social Number), and our clients sometimes uses CNPJ (when they're companies).

Describe the solution you'd like Would be nice if validator for the CPF field accept both formats (000.000.000-00 and 00.000.000/0000-00).

Describe alternatives you've considered Edit the validation rule in vendor/adyen/module-payment/view/frontend/web/js/view/checkout/validator-mixin.js, including the following mask: 00.000.000/0000-00

Additional context image

RokPopov commented 2 years ago

Hi @flaviosans,

Thank you for proposing this enhancement and apologies for not getting back to you. We have introduced a PR with refactored regex that now supports the CNJP for Boleto payment.

What do you think of this approach, would you maybe have any suggestions?

Kind regards, Rok, Adyen

Morerice commented 2 years ago

Hi @flaviosans,

Closing this issue due to aforementioned PR. It will be out on the next release. If there are still issues, feel free to re-open this issue.

Regards, Jean Adyen

flaviosdev commented 2 years ago

Hi @flaviosans,

Thank you for proposing this enhancement and apologies for not getting back to you. We have introduced a PR with refactored regex that now supports the CNJP for Boleto payment.

What do you think of this approach, would you maybe have any suggestions?

Kind regards, Rok, Adyen

Hi, @RokPopov

The solution is perfect, and fits very well with our needs. Thanks for it!