Look at your APP_URL in your .env and update it correctly and then run php artisan config:clear
Jun 9, 2024
4
Level 2
Cashier webhook | URL not public?
I've installed Stripe on my live server and I'm able to see the transaction in Stripe-dahboard. But when I try to install Stripe-webhook I'm getting an error message saying my url is not public. As a result, the tables subscriptions don't get updated via StripeWebhookController.php
I followed Laravel's doc to install Cashier [2] - I didn't install stripe-php like I did for laravel 10
Please help. Many thanks
- Laravel 11
- Stripe: latest (2024-04-10)
- Ubuntu 22.04
cd /home/example.com/../laravel
php artisan cashier:webhook
Stripe\Exception\InvalidRequestException
Invalid URL: URL must be publicly accessible.
cURL is installed:
curl --help
Usage: curl [options...] <url>
-d, --data <data> HTTP POST data
-f, --fail Fail silently (no output at all) on HTTP errors
-h, --help <category> Get help for commands
laravel.log:
{"exception":"[object] (Stripe\Exception\InvalidRequestException(code: 0): Invalid URL: URL must be publicly accessible. ..
/home/bob32/web/example.com/public_html/laravel/vendor/stripe/stripe-php/lib/Exception/ApiErrorException.php:38)
...
.env
STRIPE_KEY= xxxx
STRIPE_SECRET= xxxx
STRIPE_WEBHOOK_SECRET= xxxx
web.php
Route::post('/stripe/webhook', 'App\Http\Controllers\StripeWebhookController@handleWebhook')->name('cashier.webhook')->withoutMiddleware(\App\Http\Middleware\VerifyCsrfToken::class);

Please or to participate in this conversation.

