πŸͺRegistering Endpoint

The cashier endpoint will already be registered via the standard artisan command. However by default that endpoint only listens to events relating to your own stripe account and will not receive events relating to connected accounts.

In order to register this you must run the following artisan command.

php artisan connect:webhook

There are additioanl paramters avaiable which are mirrored from the original command. The only difference with this command is the endpoint URL and also the connect flag being marked as true. This will tell stripe only to send connected account related events to this endpoint.

Once this has been done you will need to enter the secret into the .env file as follows:

CONNECT_WEBHOOK_SECRET=YOURSECRETHERE

By default the following events will be sent to the endpoint:

'customer.subscription.created',
'customer.subscription.updated',
'customer.subscription.deleted',
'customer.updated',
'customer.deleted',
'invoice.payment_action_required',
'invoice.payment_succeeded',
'charge.succeeded'

This is to receive most events for standard payment flows. This will not automatically handle the events, this just ensures stripe sends them to your app. You must register your own event handlers as outlined in the next page.

If you wish to receive additional events that aren't outlined above you can either add these manually in the stripe dashboard retrospectively. Or, you can publish and override the configuration prior to registeirng your endpoint by simply editing the events array as shown below.

return [

    'webhook' => [
        'secret' => env('CONNECT_WEBHOOK_SECRET'),
        'tolerance' => env('CONNECT_WEBHOOK_TOLERANCE', 300)
    ],

    'events' => [
        // SUBSCRIPTION EVENTS
        'customer.subscription.created',
        'customer.subscription.updated',
        'customer.subscription.deleted',
        'customer.updated',
        'customer.deleted',
        'invoice.payment_action_required',
        'invoice.payment_succeeded',
        // DIRECT CHARGE PAYMENTS
        'charge.succeeded'
    ],

    /** Used when the model doesn't have a currency assigned to it or the currency isn't provided by the function */

    'currency' => env('CASHIER_CONNECT_CURRENCY', 'usd')


];

Last updated