amzn / amazon-payments-magento-2-plugin

Extension to enable Amazon Pay on Magento 2
https://amzn.github.io/amazon-payments-magento-2-plugin/
Apache License 2.0
109 stars 77 forks source link

Non-static method SerializerInterface::serialize() cannot be called statically in /Model/Alexa.php:157 #1043

Closed tim-breitenstein-it closed 3 years ago

tim-breitenstein-it commented 3 years ago

What I expected

No System Error

What happened instead

System Error:

[2021-04-28 14:13:25] main.CRITICAL: Error: Non-static method Magento\Framework\Serialize\SerializerInterface::serialize() cannot be called statically in /var/www/magento242/htdocs/vendor/amzn/amazon-pay-magento-2-module/Model/Alexa.php:157
Stack trace:
#0 /var/www/magento242/htdocs/vendor/amzn/amazon-pay-magento-2-module/Model/Alexa.php(171): Amazon\Pay\Model\Alexa->getDeliveryCarriers()
#1 /var/www/magento242/htdocs/vendor/amzn/amazon-pay-magento-2-module/Model/Alexa.php(212): Amazon\Pay\Model\Alexa->getCarrierCode(Object(Magento\Sales\Model\Order\Shipment\Track))
#2 /var/www/magento242/htdocs/vendor/amzn/amazon-pay-magento-2-module/Observer/SalesOrderShipmentTrackAfter.php(55): Amazon\Pay\Model\Alexa->addDeliveryNotification(Object(Magento\Sales\Model\Order\Shipment\Track))
#3 /var/www/magento242/htdocs/vendor/magento/framework/Event/Invoker/InvokerDefault.php(88): Amazon\Pay\Observer\SalesOrderShipmentTrackAfter->execute(Object(Magento\Framework\Event\Observer))
#4 /var/www/magento242/htdocs/vendor/magento/framework/Event/Invoker/InvokerDefault.php(74): Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(Object(Amazon\Pay\Observer\SalesOrderShipmentTrackAfter), Object(Magento\Framework\Event\Observer))
#5 /var/www/magento242/htdocs/vendor/magento/framework/Event/Manager.php(66): Magento\Framework\Event\Invoker\InvokerDefault->dispatch(Array, Object(Magento\Framework\Event\Observer))
#6 /var/www/magento242/htdocs/generated/code/Magento/Framework/Event/Manager/Proxy.php(95): Magento\Framework\Event\Manager->dispatch('sales_order_shi...', Array)
#7 /var/www/magento242/htdocs/vendor/magento/framework/Model/AbstractModel.php(829): Magento\Framework\Event\Manager\Proxy->dispatch('sales_order_shi...', Array)
#8 /var/www/magento242/htdocs/vendor/magento/framework/Model/ResourceModel/Db/VersionControl/AbstractDb.php(56): Magento\Framework\Model\AbstractModel->afterSave()
#9 /var/www/magento242/htdocs/vendor/magento/framework/Model/ResourceModel/Db/AbstractDb.php(424): Magento\Framework\Model\ResourceModel\Db\VersionControl\AbstractDb->processAfterSaves(Object(Magento\Sales\Model\Order\Shipment\Track))
#10 /var/www/magento242/htdocs/vendor/magento/module-sales/Model/ResourceModel/Order/Shipment/Relation.php(68): Magento\Framework\Model\ResourceModel\Db\AbstractDb->save(Object(Magento\Sales\Model\Order\Shipment\Track))
#11 /var/www/magento242/htdocs/vendor/magento/framework/Model/ResourceModel/Db/VersionControl/RelationComposite.php(48): Magento\Sales\Model\ResourceModel\Order\Shipment\Relation->processRelation(Object(Magento\Sales\Model\Order\Shipment))
#12 /var/www/magento242/htdocs/vendor/magento/framework/Model/ResourceModel/Db/VersionControl/AbstractDb.php(57): Magento\Framework\Model\ResourceModel\Db\VersionControl\RelationComposite->processRelations(Object(Magento\Sales\Model\Order\Shipment))
#13 /var/www/magento242/htdocs/vendor/magento/framework/Model/ResourceModel/Db/AbstractDb.php(424): Magento\Framework\Model\ResourceModel\Db\VersionControl\AbstractDb->processAfterSaves(Object(Magento\Sales\Model\Order\Shipment))
#14 /var/www/magento242/htdocs/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\Model\ResourceModel\Db\AbstractDb->save(Object(Magento\Sales\Model\Order\Shipment))
#15 /var/www/magento242/htdocs/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Sales\Model\ResourceModel\Order\Shipment\Interceptor->___callParent('save', Array)
#16 /var/www/magento242/htdocs/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Sales\Model\ResourceModel\Order\Shipment\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Sales\Model\Order\Shipment))
#17 /var/www/magento242/htdocs/generated/code/Magento/Sales/Model/ResourceModel/Order/Shipment/Interceptor.php(77): Magento\Sales\Model\ResourceModel\Order\Shipment\Interceptor->___callPlugins('save', Array, Array)
#18 /var/www/magento242/htdocs/vendor/magento/framework/Model/AbstractModel.php(655): Magento\Sales\Model\ResourceModel\Order\Shipment\Interceptor->save(Object(Magento\Sales\Model\Order\Shipment))
#19 /var/www/magento242/htdocs/vendor/magento/framework/DB/Transaction.php(129): Magento\Framework\Model\AbstractModel->save()
...

Steps to reproduce the issue

Your setup

a-litvin commented 3 years ago

Faced the same issue in Magento 2.3.4 and Magento 2.2 versions.

zichicc commented 3 years ago

Hi @tim-breitenstein-it and @a-litvin , this issue has been fixed and it's going to be released this week with plugin version 5.3.0 on Magento Marketplace.

Thanks a lot for reporting it. Best

Christian