mollie / magento2

Mollie Payments for Magento 2
https://www.mollie.com
Other
101 stars 53 forks source link

Fatal error: Uncaught Error: Call to a member function getStreet() #96

Closed chris102948 closed 5 years ago

chris102948 commented 5 years ago

After updating to the newest version of Mollie (1.4.2) we get an error when checking out. We are in testmode. We use virtual products so do not have a shipping address, only a billing address.

I just tested with a normal product, and then the checkout does work. So perhaps the extension is not compatible with virtual/downloadable products? Is there any way to use the billing address instead of shipping address?

Fatal error: Uncaught Error: Call to a member function getStreet() on null in /data/web/magento2_staging/vendor/mollie/magento2/Model/Client/Payments.php:131 Stack trace: #0 /data/web/magento2_staging/vendor/mollie/magento2/Model/Client/Payments.php(97): Mollie\Payment\Model\Client\Payments->getAddressLine(NULL) #1 /data/web/magento2_staging/vendor/mollie/magento2/Model/Mollie.php(237): Mollie\Payment\Model\Client\Payments->startTransaction(Object(Magento\Sales\Model\Order\Interceptor), Object(Mollie\Api\MollieApiClient)) #2 /data/web/magento2_staging/vendor/mollie/magento2/Controller/Checkout/Redirect.php(89): Mollie\Payment\Model\Mollie->startTransaction(Object(Magento\Sales\Model\Order\Interceptor)) #3 /data/web/magento2_staging/vendor/magento/framework/App/Action/Action.php(107): Mollie\Payment\Controller\Checkout\Redirect->execute() #4 /data/web/magento2_staging/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http)) #5 /data in /data/web/magento2_staging/vendor/mollie/magento2/Model/Client/Payments.php on line 131

willemstuursma commented 5 years ago

The shipping address is optional in the Mollie API. If it is empty in Magento, it should not be sent. @Marvin-Magmodules.

Marvin-Magmodules commented 5 years ago

Hi @GetMagented just pushed a fix to the 1.4.3 branch for virtual orders. Street could not be loaded as for virtual orders there is no shipping address object. Can you confirm this on your staging?

Marvin-Magmodules commented 5 years ago

Hi @GetMagented fixed and tested it in Magento 2.2 & Magento 2.3. Just released the new v1.4.3 version. Closing this issue now as this seems resolved, but please feel free to reopen this if you encounter any problems related to this issue.

chris102948 commented 5 years ago

Hi Marvin, sorry didn't have time yet to test the new release, but looks like it will work fine. If we have any more issues with this I will let you know. Thanks!