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

kvnkrft's avatar

Cashier - handleInvoicePaymentSucceeded not working

Good morning all,

Any thoughts as to why the invoice.payment_succeeded POST from Stripe isn't "going into" my handleInvoicePaymentSucceeded method?

I checked the docs, and things look right, I just can't figure out what I'm doing wrong (https://laravel.com/docs/5.5/billing#handling-stripe-webhooks)

<?php

namespace App\Http\Controllers\Cashier;

use \Laravel\Cashier\Http\Controllers\WebhookController as BaseController;
use Log;

class WebhookController extends BaseController
{
    // When a first-time or recurring payment is successful

    function __construct()
    {
        Log::debug('In Custom Webhook Controller');
    }

    // Stripe Event: invoice.payment_succeeded
    public function handleInvoicePaymentSucceeded($payload)
    {

        // Problem: Stripe POST does not go into this method
        Log::debug('In handleInvoicePaymentSucceeded');

        // If in production
        // TODO: change 'dev' to 'production'
        if (App::environment('dev')) {

            // Debug Log
            Log::debug('Webhook Notification Received from Stripe');
            Log::debug('Webhook Payload: '.implode( ", ", $payload ) );

            // Look thins up, depending on payload

            // Send details to Google Analytics

            return response('Webhook Handled', 200);
        }


    }

}
0 likes
2 replies
bobbybouwmann's avatar

How does your route look like? Does your application receive any call at all from stripe?

kvnkrft's avatar

Hi @bobbybouwmann it's working now, on the development server, after I added CASHIER_ENV=testing to the env file. I can't find any documentation on CASHIER_ENV=testing and I'm hoping that, it will work in production, without CASHIER_ENV=testing.

Please or to participate in this conversation.