Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kovbo's avatar
Level 1

Accepting callbacks from external server

Dear community, I'm having problems receiving callbacks from an external server trying to implement the basic payment checkout functionality on my Laravel website.

Checkout SDK asks me to provide the response_url and server_callback_url.

After accepting payments, the payments provider redirects users to the response_url, and submits a callback to the server_callback_url .

I created a dedicated route to accept the callback:

Route::post('/payment/callback', 'PaymentController@callback');

Added an exception to the VerifyCsrfToken:

    protected $except = [
        'payment/*',
    ];

But still cannot catch any callbacks.

Do you have any ideas?

0 likes
3 replies
bugsysha's avatar
bugsysha
Best Answer
Level 61

Is it maybe guarded by authorization? Do php artisan route:list and post that line here. For those purposes, it is better to define a route inside your api.php file.

1 like
Snapey's avatar

Is your site public? have you tested the URL yourself from a different device, preferably off your network.

kovbo's avatar
Level 1

You are a genius! I checked the controller multiple times and did not notice that the route was protected by the "auth" middleware. Your answer saved my day. Thank you!

Please or to participate in this conversation.