dotpay / magento2-payment

New payment module for Magento 2
2 stars 11 forks source link

Phone numbers with state codes form USA not accepted #11

Closed spwebini closed 3 years ago

spwebini commented 3 years ago

When trying to proceed payment with shipping adress from USA, with phone number with us format (+1 (xxx) xxx -xxxx) i'm getting error like this:

1 exception(s): Exception #0 (Dotpay\Exception\BadParameter\PhoneException): Dotpay\Exception\BadParameter\PhoneException: Incorrect phone number: +1 (xxx) xxx-xxxx

Exception #0 (Dotpay\Exception\BadParameter\PhoneException): Dotpay\Exception\BadParameter\PhoneException: Incorrect phone number: +1 (809) 704-1583

#1 Dotpay\Payment\Model\Factory\AbstractFactory->getCustomer() called at [vendor/dotpay/magento2-payment/Model/Factory/AbstractFactory.php:434]
#2 Dotpay\Payment\Model\Factory\AbstractFactory->getTransaction() called at [vendor/dotpay/magento2-payment/Model/Factory/WidgetFactory.php:38]
#3 Dotpay\Payment\Model\Factory\WidgetFactory->getChannel() called at [vendor/dotpay/magento2-payment/Controller/Payment/Preparing.php:85]
#4 Dotpay\Payment\Controller\Payment\Preparing->execute() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#5 Dotpay\Payment\Controller\Payment\Preparing\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#6 Dotpay\Payment\Controller\Payment\Preparing\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/App/Action/Plugin/ActionFlagNoDispatchPlugin.php:51]
#7 Magento\Framework\App\Action\Plugin\ActionFlagNoDispatchPlugin->aroundExecute() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#8 Dotpay\Payment\Controller\Payment\Preparing\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#9 Dotpay\Payment\Controller\Payment\Preparing\Interceptor->___callPlugins() called at [generated/code/Dotpay/Payment/Controller/Payment/Preparing/Interceptor.php:23]
#10 Dotpay\Payment\Controller\Payment\Preparing\Interceptor->execute() called at [vendor/magento/framework/App/Action/Action.php:111]
#11 Magento\Framework\App\Action\Action->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#12 Dotpay\Payment\Controller\Payment\Preparing\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#13 Dotpay\Payment\Controller\Payment\Preparing\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#14 Dotpay\Payment\Controller\Payment\Preparing\Interceptor->___callPlugins() called at [generated/code/Dotpay/Payment/Controller/Payment/Preparing/Interceptor.php:32]
#15 Dotpay\Payment\Controller\Payment\Preparing\Interceptor->dispatch() called at [vendor/magento/framework/App/FrontController.php:186]
#16 Magento\Framework\App\FrontController->processRequest() called at [vendor/magento/framework/App/FrontController.php:118]
#17 Magento\Framework\App\FrontController->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#18 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#19 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php:99]
#20 Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#21 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php:75]
#22 Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#23 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#24 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:23]
#25 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:116]
#26 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:23]
#27 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:263]
#28 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:40]
spwebini commented 3 years ago

Additional information: issue affects not only USA phone numbers but all number that have format with additional signs like ['(', ')', '-'].

wpawel commented 3 years ago

fixed in version v1.0.18