mollie / PrestaShop

iDEAL, Creditcard, Bancontact, SOFORT, Bank transfer, PayPal & paysafecard for Prestashop
http://www.mollie.com
BSD 2-Clause "Simplified" License
69 stars 42 forks source link

Webhook Error 500 in Backoffice Mollie since version 4.*.* #173

Closed hknobbe closed 4 years ago

hknobbe commented 4 years ago

I know this has been handled before in 2019 ( #118 ), however after updating to 4.0.* versions I noticed that I kind of have the same problem.

From mollie backoffice payment details: Every time someone does a payment the first webhook call fails with error 500, then mollie sends the payment notification to the email and after that the webhook succeeds. Post 4 0 0

However last weekend I had one that kept failing! And therefore the order status wasn’t updated.

Didn’t had this problem with the 3.. versions. pre 4 0 0

Already reinstalled the module, no luck. Any suggestions or people with the same experience?

Environment

SimonasB88 commented 4 years ago

Hello @hknobbe thanks for message, sorry to hear about this, Can you provide some more visual material about this error (screenshots and videos of Prestashop side might be helpful also).

Best Regards.

hknobbe commented 4 years ago

hi @SimonasB88 There is not much to see from the backoffice, however this is what i can show you:

First of all; the logs from Mollie: As you can see, they do connect, however as shown in the mollie dashboard only after at least 1 try. log

From the order self: There is not much to see here; however on the one that failed I saw that it missed the transactionID and it showed mollie instead of iDeal in the payment overview.

Failed: transdetails

However! The mollie payment info (that comes from the plugin) does show the right transactionID

transdetails2

Good one: transdetail pre

Also everytime someone pays you can see the forward to the return url; that was missing in this one

source

Also; the info from the mollie dashboard: Failed one: failed

Good one (pre 4.x.x): good-one

Let me know if you need anything else!

Best Regards,

SimonasB88 commented 4 years ago

Hey @hknobbe thank you very much for the visuals and the steps, we really appreciate your insights and work. Could you please tell us, if it happens the same on the newest v4.0.4 verified release (not pre-release) https://github.com/mollie/PrestaShop/releases/download/4.0.4/mollie.zip

Best Regards.

hknobbe commented 4 years ago

Hey @SimonasB88, Thanks! i'll give it a try. As soon as I have some results (will try with 2-3 payments, just to be sure) i'll post the results!

Thanks and best regards,

pswaab commented 4 years ago

Hi,

All updates to version 4.0.x gave me also a 500 error after selecting payment method and clicking the order button. After uninstalling module completely (including removal of folder), and installing version 4.0.4 again it did work. (backup all mollie tables in Mysql before uninstalling, so you can place them back after installing the new module) So may be this it the fix for hknobbe as well.

But I noticed it creates an order before making the payment, which the older module did not do. Now I get a notice a new order is placed every time someone clicks the order button but does not finish the payment. The status of the order is Awaiting Mollie payment, but I really liked it that there were no unpaid orders, which also made it easier to explain that all orders are paid. Is there an option in the module to not create an order before payment is finished?

And sorry for hijacking this thread.

Kind regards,

Patrick

hknobbe commented 4 years ago

hi @SimonasB88, new day, new results; Updated to 4.0.4, problems persists, however; I wanted to try someting else. (@pswaab I've tried a full reinstall already, so no luck for me).

After @pswaab talked about the order being created before payment, I wanted to try what happend after a order failed.

I saw these results from Mollie dashboard: error500-4 0 4 So, a failed (also expired, canceld) payment directly get a webhook, however a good payment failes on first the try, and usualy succeeds on seccond.

Als regarding @pswaab's comment about the order being created before payment; We use the notification plugin so as soon as a order has been made we receive an email that we've received a new order. Because of this problem we get notified of a new order; even if it fails on payment (without a notice of failure etc). So yea, would be awesome if this could be fixed?

Hope you've got some new insights with this info! Let me know if i need to try something else.

hknobbe commented 4 years ago

So, just another update from me:

Today we started the Klarna Pay Later option; as advised we use the orders-api for this one instead of the Payment-API in all the other payments.

This resulted in a total fail on test:

orders-api

Kinda at a loss, might even try to reinstall the whole plugin again, nuke and pave it. But i'm wondering if the error is with the server, or code in plugin? what are your guys opinion? Is it worth trying to reinstall it again?

pswaab commented 4 years ago

Hi,

What do your apache server logs say on this? Do you see warning/errors in there?

Regards,

Patrick

hknobbe commented 4 years ago

hi @pswaab, To keep everyone a bit sane; https://paste.ofcode.org/TPyQtKc9dk6dMkxmSsjZwF (accesslog)

I couldn't find anything strange, however i'm not really that of an expert so hope you may spot something!

edit, i wasn't reading.. error log shows:

[Fri Jun 12 09:43:07.852315 2020] [proxy_fcgi:error] [pid 22962] [client 77.167.120.118:65365] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught  --> Smarty: 0():Missing '$template' parameter <-- \n  thrown in /var/www/html/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php on line 177\n', referer: https://domain.shop/bestelling

[Fri Jun 12 09:43:18.132962 2020] [proxy_fcgi:error] [pid 23091] [client 77.167.120.118:65381] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught  --> Smarty: 0():Missing '$template' parameter <-- \n  thrown in /var/www/html/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php on line 177\n', referer: https://domain.shop/bestelling

[Fri Jun 12 09:44:03.868760 2020] [proxy_fcgi:error] [pid 22459] [client 77.167.120.118:65438] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught  --> Smarty: 0():Missing '$template' parameter <-- \n  thrown in /var/www/html/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php on line 177\n', referer: https://domain.shop/order-bevestiging?id_cart=149&id_module=151&id_order=62&key=0216907e047d5f31d26cc8b4a74d3379

[Fri Jun 12 09:44:28.396362 2020] [proxy_fcgi:error] [pid 22519] [client 87.233.229.26:32942] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught _PhpScoper5eddef0da618a\\Mollie\\Api\\Exceptions\\ApiException: Error executing API call (404: Not Found): Order ord_a9ftre exists, but the wrong mode is used. Try switching live / test API keys.. Documentation: https://docs.mollie.com/guides/handling-errors in /var/www/html/modules/mollie/vendor/mollie/mollie-api-php/src/Exceptions/ApiException.php:78\nStack trace:\n#0 /var/www/html/modules/mollie/vendor/mollie/mollie-api-php/src/MollieApiClient.php(418): _PhpScoper5eddef0da618a\\Mollie\\Api\\Exceptions\\ApiException::createFromResponse(Object(_PhpScoper5eddef0da618a\\GuzzleHttp\\Psr7\\Response))\n#1 /var/www/html/modules/mollie/vendor/mollie/mollie-api-php/src/MollieApiClient.php(395): _PhpScoper5eddef0da618a\\Mollie\\Api\\MollieApiClient->parseResponseBody(Object(_PhpScoper5eddef0da618a\\GuzzleHttp\\Psr7\\Response))\n#2 /var/www/html/modules/mollie/vendor/mollie/mollie-api-php/src/MollieApiClient.php(356): _PhpScoper5eddef0da618a\\Mollie\\Api\\MollieApiClient->performHttpCallToFullUrl('...\n'

Thanks!

best regards, Henk-Jan

pswaab commented 4 years ago

Hi,

Do you also have the error.log? This is the access log.

Regards,

Patrick

hknobbe commented 4 years ago

Hi @pswaab,

Yeah just edited the last post.

That is from the failed test order.

Just got a new live order via payment API, same problem as always however only line in error.log is: [Fri Jun 12 11:03:04.523750 2020] [proxy_fcgi:error] [pid 25473] [client 31.21.228.186:45537] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught --> Smarty: 0():Missing '$template' parameter <-- \n thrown in /var/www/html/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php on line 177\n', referer: https://domain.shop/module/mollie/return?cart_id=150&utm_nooverride=1&rand=1591952552

margud commented 4 years ago

mollie.zip Hi @hknobbe,

Could you please try installing this zip and try creating an order? And could you give us feedback if it helped or not.

hknobbe commented 4 years ago

@margud Yes, this solves the problem!

However; the change seems to make another plugin (https://addons.prestashop.com/en/analytics-statistics/18623-premium-google-analytics-enhanced-ecommerce.html) not function anymore. Worked fine in 4.0.4 now in 4.0.5 it doesn't wanna send data anymore

Docs: https://docs.reactioncode.com/en/modules/prestashop/premium-google-analytics-enhanced-ecommerce/#pgaee-orders-not-sent-to-ga

Hope it helps you, because for me, and I think a lot of other people it would be really annoying if GA doesn't work anymore.

Thanks anyway!

margud commented 4 years ago

We will investigate it but its really strange that it had an impact on the ga module. We will try to fix it as fast as possible but in the best case scenario it will be added in 4.0.6 release.

hknobbe commented 4 years ago

@margud I understand, i know they look for certain pages and webhooks to call the send action.

In the mean time I tried:

But i still shows up as not sending to GA. Thanks for checking it out.

Best regards, Henk-Jan

loetje88 commented 4 years ago

Great.

After 6 on friday, so no support for the upcoming 3 days.

The new module is unusable for me as well - prestashop 1.6.8, as it gives a 500 error as well. So, down for the weekend since payments cannot be made, which result in money loss.

Shame mollie!

pswaab commented 4 years ago

Hi,

Just install module 3.5.5

Regard,

Patrick

Frankyet commented 4 years ago

But I noticed it creates an order before making the payment, which the older module did not do. Now I get a notice a new order is placed every time someone clicks the order button but does not finish the payment. The status of the order is Awaiting Mollie payment, but I really liked it that there were no unpaid orders, which also made it easier to explain that all orders are paid. Is there an option in the module to not create an order before payment is finished?

And sorry for hijacking this thread.

Kind regards,

Patrick

Hello Patrick, I agree this is not the only problem that give this issue also if the customer want to select another payment after all, Mollie Module will cancel the order and he will loss his shopping-cart, he have to create a new one, most customer will quit and so you lose money. I have told them but do don’t see it like this, As long this will not fix this I have to stay at 3.5.5. Version 4.x.x. it an half step forward and 3 steps backward unfortunately. 4.0.4. have more problems,

No conform e-mail send if order is placed, only e-mail when payment is done. No conform e-mail send if order is placed when articles are in back order and no e-mail send when order is paid and there are back-orders, customer paid but non e-mail *In the invoice there is state Mollie as payment method i.s.o. ideal or Bancontact, etc.

Why do they release this version? Before testing.

hknobbe commented 4 years ago

Great.

After 6 on friday, so no support for the upcoming 3 days.

The new module is unusable for me as well - prestashop 1.6.8, as it gives a 500 error as well. So, down for the weekend since payments cannot be made, which result in money loss.

Shame mollie!

@loetje88 I understand how frustrating this is, however this tread isn't about the error 500 on payment; this is about the hook to the backoffice, you might want to check out #167 ? Also might be good practice to test it first in a testing enviorment?

SimonasB88 commented 4 years ago

Hey guys, wow that's a lot of community action is going on right now, we really appreciate your insights.

@hknobbe thank you for your feedback, we really appreciate this information, I can say that we are on this issue investigation right now.

@Frankyet thank you for your insights once again, we will implement controllable switch option, that merchants could use in order to disable/enable confirmation email sending.

@pswaab @loetje88 thank you for your insights, could you please raise the separate tickets with additional screenshots or video-screen issue reproduction captures in order to be more effective in solving.

Thank you guys, we are looking forward to hearing from you!

Best Regards, Invertus Support Team

hknobbe commented 4 years ago

@SimonasB88 no problem, let me know if and what you need from me!

Best regards, Henk-Jan

hknobbe commented 4 years ago

@margud, @SimonasB88 I think I've found a small bug in 4.0.5. (settings are the same in 4.0.4 with that version all went well):

As soon as mollie returns order/payment accepted it changes the status of the order 2 times and sends out the mail 2 times:

Screenshot_2

&

Screenshot_3

Settings: Screenshot_4 Screenshot_5

SimonasB88 commented 4 years ago

Hey @hknobbe ! Thanks for your query, we have captured a duplication like this while refunding the orders also. This case is rather similar, but we will check this and fix. This bug is definitely in our TODO list.

Could you please raise separate ticket with this issue? Thank you.


Best Regards, Invertus Support Team

margud commented 4 years ago

Issue was resolved in 4.0.6 release.