Getnet-Brasil / payment-magento

Módulo de Pagamento para lojas Magento Adobe Commerce
https://getnet.loja.ninja/
Open Software License 3.0
6 stars 5 forks source link

[Bug]: Missing required argument $formBlockType of PaymentMagentoBaseFacade. #41

Closed warleyelias closed 1 year ago

warleyelias commented 1 year ago

Detalhes de contato

warleyelias@gmail.com

O que aconteceu?

Houve um erro ao abrir a tela de checkout "Exception #0 (BadMethodCallException): Missing required argument $formBlockType of PaymentMagentoBaseFacade."

Consegui resolver apenas adicionando os argumentos "formBlockType" e "infoBlockType" usando os mesmo do boleto bancário

Versão do Magento

Magento 2 Versão - 2.4.5-p1 PHP Versão - 7.4.3

O problema pode ter alguma relação com um navegador específico?

Não tem relação com o navegador usado

Há logs relavantes sobre o problema?

1 exception(s):
Exception #0 (BadMethodCallException): Missing required argument $formBlockType of PaymentMagentoBaseFacade.

Exception #0 (BadMethodCallException): Missing required argument $formBlockType of PaymentMagentoBaseFacade.
<pre>#1 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34]
#2 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59]
#3 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:56]
#4 Magento\Framework\ObjectManager\ObjectManager->create() called at [vendor/magento/module-payment/Model/Method/Factory.php:40]
#5 Magento\Payment\Model\Method\Factory->create() called at [vendor/magento/module-payment/Helper/Data.php:136]
#6 Magento\Payment\Helper\Data->getMethodInstance() called at [vendor/magento/module-payment/Model/PaymentMethodList.php:47]
#7 Magento\Payment\Model\PaymentMethodList->Magento\Payment\Model\{closure}()
#8 array_map() called at [vendor/magento/module-payment/Model/PaymentMethodList.php:45]
#9 Magento\Payment\Model\PaymentMethodList->getList() called at [vendor/magento/module-payment/Model/PaymentMethodList.php:88]
#10 Magento\Payment\Model\PaymentMethodList->getActiveList() called at [vendor/magento/module-vault/Plugin/PaymentVaultConfigurationProcess.php:63]
#11 Magento\Vault\Plugin\PaymentVaultConfigurationProcess->beforeProcess() called at [vendor/magento/framework/Interception/Interceptor.php:121]
#12 Magento\Checkout\Block\Checkout\LayoutProcessor\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#13 Magento\Checkout\Block\Checkout\LayoutProcessor\Interceptor->___callPlugins() called at [generated/code/Magento/Checkout/Block/Checkout/LayoutProcessor/Interceptor.php:23]
#14 Magento\Checkout\Block\Checkout\LayoutProcessor\Interceptor->process() called at [vendor/magento/module-checkout/Block/Onepage.php:81]
#15 Magento\Checkout\Block\Onepage->getJsLayout() called at [vendor/magento/module-checkout/view/frontend/templates/onepage.phtml:23]
#16 include() called at [vendor/magento/framework/View/TemplateEngine/Php.php:71]
#17 Magento\Framework\View\TemplateEngine\Php->render() called at [vendor/magento/framework/View/Element/Template.php:263]
#18 Magento\Framework\View\Element\Template->fetchView() called at [vendor/magento/framework/View/Element/Template.php:293]
#19 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1095]
#20 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1099]
#21 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:660]
#22 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor/magento/framework/View/Layout.php:578]
#23 Magento\Framework\View\Layout->_renderBlock() called at [vendor/magento/framework/View/Layout.php:555]
#24 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#25 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#26 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#27 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]
#28 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]
#29 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#30 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#31 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#32 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]
#33 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]
#34 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#35 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#36 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#37 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]
#38 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]
#39 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#40 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#41 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#42 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]
#43 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]
#44 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#45 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#46 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#47 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]
#48 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]
#49 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#50 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#51 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#52 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]
#53 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]
#54 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#55 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#56 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#57 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:975]
#58 Magento\Framework\View\Layout->getOutput() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#59 Magento\Framework\View\Layout\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#60 Magento\Framework\View\Layout\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#61 Magento\Framework\View\Layout\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:347]
#62 Magento\Framework\View\Layout\Interceptor->getOutput() called at [vendor/magento/framework/View/Result/Page.php:260]
#63 Magento\Framework\View\Result\Page->render() called at [vendor/magento/framework/View/Result/Layout.php:171]
#64 Magento\Framework\View\Result\Layout->renderResult() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#65 Magento\Framework\View\Result\Page\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#66 Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#67 Magento\Framework\View\Result\Page\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/View/Result/Page/Interceptor.php:95]
#68 Magento\Framework\View\Result\Page\Interceptor->renderResult() called at [vendor/magento/framework/App/Http.php:120]
#69 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:23]
#70 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:264]
#71 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:30]
</pre>

Meu log não contém informações confidênciais

Qual a severidade do problema?

Nenhum cliente consegue realizar um pagamento

elisei commented 1 year ago

Olá @warleyelias

É preciso compilar a Magento a após a instalação.

Por favor, rode o comando:

bin/magento setup:di:compile
warleyelias commented 1 year ago

Boa Tarde @elisei tudo bem?

Maravilha, realmente funciona mas seria interessante fazer essa correção pois em ambiente de desenvolvimento raramente da para trabalhar com o código compilado.

Além disso @elisei estou tentando fazer uma venda usando as credenciais de sandbox, isso já depois de compilado, e está sempre retornando o erro a seguir, vale ressaltar que eu fiz o teste com as mesmas credenciais no módulo do magento 1 da getnet esta funcionando corretamente. Consegue me ajudar a entender o problema?

==> var/log/payment.log <== [2023-02-28T20:35:35.875449+00:00] main.DEBUG: array ( 'storeId' => 1, 'url' => 'https://api-sandbox.getnet.com.br/v1/payments/boleto', 'auth' => NULL, 'request' => '{"store_id":1,"seller_id":"afc995b4-eb38-401b-a901-4c10d9ca3d7e","amount":10400,"currency":"BRL","order":{"order_id":"000000087","sales_tax":0},"customer":{"customer_id":"warleyelias@gmail.com","first_name":"Warley","last_name":"Elias","name":"Warley Elias","email":"warleyelias@gmail.com","phone_number":"31993005074","billing_address":{"postal_code":"30110017","street":"Av do Contorno","number":"3257","district":"Santa Efig\u00eania","complement":"Sala 501","city":"Belo Horizonte","state":"MG","country":"BR"},"document_type":"CPF","document_number":""},"boleto":{"document_number":"000000087","instructions":"N\u00e3o receber ap\u00f3s vencimento.","expiration_date":"01\/03\/2023"}}', 'response' => '{ "message": "Unauthorized", "name": "GatewayAuthenticationOAuth2ServiceError", "status_code": 401, "details": [ { "status": "DENIED", "error_code": "AUTHENTICATION-401", "description": "Unauthorized", "description_detail": "Invalid client credentials" } ] }', ) [] []

elisei commented 1 year ago

@warleyelias isso é um tipo virtual, um padrão evitar para repetições em códigos. Isso é comum métodos de pagamento.

Sobre o erro de autorização por favor verifique esse tópico aqui.

warleyelias commented 1 year ago

@elisei obrigado pelas explicações.

elisei commented 1 year ago

@warleyelias qualquer outra dificuldade pode reabrir! =)