merchantwarrior / magento2

Merchant Warrior Magento 2 Extension
3 stars 1 forks source link

Address Data Builder is not compatible with magneto instance which version greater than 2.4.4-p2 #3

Open MWWeilun opened 1 year ago

MWWeilun commented 1 year ago

Address Data Builder is not compatible with magneto instance which version greater than 2.4.4-p2

getStreet somehow it's a undefined method with Magento Version 2.4.4-p2 We could replicate it by processing payframe purchase within this specific version(2.4.4-p2).

[2023-01-23T04:17:19.169277+00:00] main.CRITICAL: Error: Call to undefined method Magento\Payment\Gateway\Data\Order\AddressAdapter::getStreet() in /home/wliu/magento2-2.4.4-p2/vendor/merchantwarrior/magento2-payment/Gateway/Request/AddressDataBuilder.php:29

Shown Debug Log below ` [2023-01-20T05:04:15.176661+00:00] main.DEBUG: Request validation failed for action "Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor" {"exception":"[object] (Magento\Framework\App\Request\InvalidRequestException(code: 0): Invalid request received at /home/wliu/magento2-2.4.4-p2/app/code/Magento/Backend/App/Request/BackendValidator.php:176)"} [] [2023-01-23T04:17:19.169277+00:00] main.CRITICAL: Error: Call to undefined method Magento\Payment\Gateway\Data\Order\AddressAdapter::getStreet() in /home/wliu/magento2-2.4.4-p2/vendor/merchantwarrior/magento2-payment/Gateway/Request/AddressDataBuilder.php:29 Stack trace:

0 /home/wliu/magento2-2.4.4-p2/app/code/Magento/Payment/Gateway/Request/BuilderComposite.php(50): MerchantWarrior\Payment\Gateway\Request\AddressDataBuilder->build()

1 /home/wliu/magento2-2.4.4-p2/app/code/Magento/Payment/Gateway/Command/GatewayCommand.php(103): Magento\Payment\Gateway\Request\BuilderComposite->build()

2 /home/wliu/magento2-2.4.4-p2/app/code/Magento/Payment/Model/Method/Adapter.php(549): Magento\Payment\Gateway\Command\GatewayCommand->execute()

3 /home/wliu/magento2-2.4.4-p2/app/code/Magento/Payment/Model/Method/Adapter.php(686): Magento\Payment\Model\Method\Adapter->executeCommand()

4 /home/wliu/magento2-2.4.4-p2/app/code/Magento/Sales/Model/Order/Payment/Operations/ProcessInvoiceOperation.php(83): Magento\Payment\Model\Method\Adapter->sale()

5 /home/wliu/magento2-2.4.4-p2/app/code/Magento/Sales/Model/Order/Payment/Operations/SaleOperation.php(46): Magento\Sales\Model\Order\Payment\Operations\ProcessInvoiceOperation->execute()

6 /home/wliu/magento2-2.4.4-p2/app/code/Magento/Sales/Model/Order/Payment.php(466): Magento\Sales\Model\Order\Payment\Operations\SaleOperation->execute()

7 /home/wliu/magento2-2.4.4-p2/app/code/Magento/Sales/Model/Order/Payment.php(385): Magento\Sales\Model\Order\Payment->processAction()

8 /home/wliu/magento2-2.4.4-p2/generated/code/Magento/Sales/Model/Order/Payment/Interceptor.php(122): Magento\Sales\Model\Order\Payment->place()

`

MWWeilun commented 1 year ago

We managed to fix it in Version 2.4.4-p2 refer PullRequest - https://github.com/merchantwarrior/magento2/pull/6/files

Briefly, The new rule would be applied with instance in which magento version >= 2.4.4-p2 and leave it as it is if the version < 2.4.4-p2