Mangopay / mangopay2-php-sdk

PHP SDK for MANGOPAY
https://packagist.org/packages/mangopay/php-sdk-v2
MIT License
123 stars 134 forks source link

Hooks, HTTP code 500 #538

Closed HysteriaKa closed 2 years ago

HysteriaKa commented 2 years ago

Hey everyone, Not sure it's the good place to ask, but we did call MangoPay, and made a lot of researches about our server but we can't find a way out! So, we put our site on line, our hooks got a http code 500, we did test them with postman and everything is fine. We use Plesk Obsidian Version 18.0.40 Mise à jour 1, dernière mise à jour le 14 Déc 2021 14:33. Seems that we are blocking MangoPay, the log appears with unknowned agent. Thanks for all the help

H4wKs commented 2 years ago

Hi @HysteriaKa,

Hey everyone, Not sure it's the good place to ask, but we did call MangoPay, and made a lot of researches about our server but we can't find a way out! So, we put our site on line, our hooks got a http code 500,

Well, this has for sure nothing to do with the MangoPay PHP SDK, but let's try to help you out :)

we did test them with postman and everything is fine. We use Plesk Obsidian Version 18.0.40 Mise à jour 1, dernière mise à jour le 14 Déc 2021 14:33. Seems that we are blocking MangoPay, the log appears with unknowned agent. Thanks for all the help

So, if you were blocking MangoPay request, you should end up with an error code 401, not a 500. 500 usually mean something went really wrong on your end, and that your server do not know how to handle the request.

Now, the problem here is you are talking about Plesk, which is just a GUI to manage your server, but it doesn't tell anything about what system your server is running (Windows ? Linux ? What version ?), which web server (apache ? ngnix ? , IIS ?), neither what is the stack of your webApp ?

MangoPay actually have a user agent set to "MANGOPAY", or at least, there is one set when it call the hook for my service. My guess is Plesk maybe only display user agent he knows.

The log should look about like this :

78.*.*.* - - [17/Dec/2021:18:21:34 +0000] "GET /payment/mp/callback?RessourceId=2064179080&EventType=PAYIN_NORMAL_SUCCEEDED&Date=1639765294 HTTP/1.1" 200 5146 "-" "MANGOPAY"

Can you share some of the code from your controller that take care of the hook callback ? Do you have any extra log in your app when a 500 error occurs ? Since I remember you were asking for help previously here, I guess your site is running PHP. Maybe even using Symfony Framework ? If so can you share the error from the framework log ?

Cheers,

Marc