mollie / Shopware

Official Mollie extension for Shopware
16 stars 18 forks source link

GetComment Error #205

Closed githuphub closed 3 years ago

githuphub commented 3 years ago

Hi,

Today we did an update from 1.7.0 to 1.8.3, but soon as the payment is completed and people return to our shop it shows a error 500, when I press try again it works fine. The error in my server logs shows the following (removed IPs+our live domain):

 2021/05/21 10:29:32 [error] 87581#101767: *14548 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to a member function getComment() on bool in /pool/home/test.domain.nl/htdocs/custom/plugins/MollieShopware/Components/Order/OrderUpdater.php:181
Stack trace:
#0 /pool/home/test.domain.nl/htdocs/custom/plugins/MollieShopware/Components/Order/OrderUpdater.php(89): MollieShopware\Components\Order\OrderUpdater->updateOrderHistoryComment(Object(Shopware\Models\Order\Order))
#1 /pool/home/test.domain.nl/htdocs/custom/plugins/MollieShopware/Facades/FinishCheckout/FinishCheckoutFacade.php(258): MollieShopware\Components\Order\OrderUpdater->updateShopwarePaymentStatus(Object(Shopware\Models\Order\Order), 'paid')
#2 /pool/home/test.domain.nl/htdocs/custom/plugins/MollieShopware/Controllers/Frontend/Mollie.php(271): MollieShopware\Facades\FinishCheckout\FinishCheckoutFacade->finishTransaction(947)
#3 /pool/home/test.domain.nl/htdocs/engine/Library/Enlight/Controller/Action.php(192): Shopware_Controllers_Frontend_Mollie->finishAction()
#4 /pool/home/test.domain.nl/htdocs/eng" while reading response header from upstream, client: XXX.158.XX.216, server: test.domain.nl, request: "GET /Mollie/finish/transactionNumber/947 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/hxb.socket:", host: "test.domain.nl", referrer: "https://www.mollie.com/"

Would be great if you can help us find a solution. Thanks!

boxblinkracer commented 3 years ago

Hi

thank you for this so first thing is, i will add something to avoid that error, thats not a problem (ill show u in the pull request if done)

what i am more curious is this.... this is done in the process when the order is being updated...the status history entries in shopware have "notes" where we add a note that mollie did do that update

somehow the last status history of the order affected, is NOT EXISTING it seems. but at that time, shopware should have a new row in its default behaviour

do you know anything that might be different in your shop (plugins, configuration, adjustments) that might affect that part?

thank you

boxblinkracer commented 3 years ago

Hi there this might be a fix to avoid the exception: https://github.com/mollie/Shopware/pull/207 but its not completely "verified"...still waiting for your answer, but just to leat you know in case its a big problem for you

githuphub commented 3 years ago

Hi,

Sorry for my slow reply. The only unique settings/changes I can think off is that we the last step before people go to Mollie is different. The /confirm step is removed from our checkout. We directly redirect people from /shippingpayment to Mollie.

Thanks for the fix! No more error now :)

boxblinkracer commented 3 years ago

Hi

no worries :) ok that could indeed make sense

so downside could be, that you dont have a first transition, where a Mollie logo is shown in shopware backend (order transition history)...because shopware has no transition at that time probably due to the changes

all in all no big deal, great that it works for you now

ill add the fix to the next release and will close this ticket now, happy weekend