mollie / laravel-mollie

Mollie API client wrapper for Laravel & Mollie Connect provider for Laravel Socialite
https://www.mollie.com/
MIT License
326 stars 63 forks source link

Not able to get into webhook #171

Closed XavegX367 closed 3 years ago

XavegX367 commented 3 years ago

I am trying to check my payments by using the webhook, but I don't know how to make it work since I am very new to webhooks. The website itself is a live website, so it is not local or anything

Here is the error in Mollie: image

Here is my MollieController: image

Here the MollieWebhookController: image

I didn't change a single line in the WebhookController, since it doesn't even get there (I think)

and as final the web.php: image

Hopefully this problem can be solved, since I am getting very tired of it :)

Jubeki commented 3 years ago

Could you please share the error which you can find in your log files?

Edit: On the right side of the Mollie Dashboard you can see that the Webhook gets an 500 error which means it is a server side issue on your side.

Jubeki commented 3 years ago

Also you should probably put the webhook Route into the api middleware group instead of web. Because Laravel will try to check the csrf-Token on a post request in the web group. You could also ignore the path in the Middleware app/Http/Middleware/VerifyCsrfToken.php

XavegX367 commented 3 years ago

Also you should probably put the webhook Route into the api middleware group instead of web. Because Laravel will try to check the csrf-Token on a post request in the web group. You could also ignore the path in the Middleware app/Http/Middleware/VerifyCsrfToken.php

I am already ignoring the webhook as shown in the screen below image

When looking at the logs, I am only able to find 1 error and I am not sure if it has something to do with Mollie

But this is the error:

[2021-05-25 16:25:22] local.ERROR: Unresolvable dependency resolving [Parameter #0 [ $method ]] in class GuzzleHttp\Psr7\Request {"exception":"[object] (Illuminate\Contracts\Container\BindingResolutionException(code: 0): Unresolvable dependency resolving [Parameter #0 [ $method ]] in class GuzzleHttp\Psr7\Request at /home/public/sites/webdata/vendor/laravel/framework/src/Illuminate/Container/Container.php:1032) [stacktrace]

If this is not the error, that I should post please tell me what I should be looking for.

Jubeki commented 3 years ago

Do you import Illuminate\Http\Request or GuzzleHttp\Psr7\Request. Otherwise I have no clue right now. Maybe @sandervanhooft can help you.

sandervanhooft commented 3 years ago

Jubeki is asking the right question.

Also, what version are you using of:

? You can use composer show <vendor/package-name> to retrieve local package information.

XavegX367 commented 3 years ago

Do you import Illuminate\Http\Request or GuzzleHttp\Psr7\Request. Otherwise I have no clue right now. Maybe @sandervanhooft can help you.

Oh my bad haha, thanks! I was indeed using the 'GuzzleHttp\Psr7\Request' I changed it and now it works! image

Thank you both for the quick reactions and the help!