PHPackages                             pandawan-technology/stripe-web-hook - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. pandawan-technology/stripe-web-hook

ActiveLibrary[API Development](/categories/api)

pandawan-technology/stripe-web-hook
===================================

Ease the Stripe' API webhook supports

283PHP

Since Oct 2Pushed 8y ago1 watchersCompare

[ Source](https://github.com/PandawanTechnology/StripeWebHook)[ Packagist](https://packagist.org/packages/pandawan-technology/stripe-web-hook)[ RSS](/packages/pandawan-technology-stripe-web-hook/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

pandawan-technology/stripe-web-hook
===================================

[](#pandawan-technologystripe-web-hook)

[![Build Status](https://camo.githubusercontent.com/392bfb6043a18015b6c238c99e407dde75c9b051336519cccb7ba4c141b9ecf0/68747470733a2f2f7472617669732d63692e6f72672f50616e646177616e546563686e6f6c6f67792f537472697065576562486f6f6b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/PandawanTechnology/StripeWebHook)This library intends to ease the Stripe WebHooks behaviors using the `symfony/event-dispatcher` library.

Installation
============

[](#installation)

In order to install the library, you should simple use the following command:

```
$ composer require pandawan-technology/stripe-web-hook
```

Usage
=====

[](#usage)

To have a better overview of how the library works, let's implement the example provided by Stripe on how to use webhooks [to send an email for failed payments](https://stripe.com/docs/recipes/sending-emails-for-failed-payments)

In our controller, we should have something similar as:

```
        $endpointSecret = ''; // See the doc to get the correct value
        $event = new StripeFactoryEvent($request, Events::INVOICE_PAYMENT_FAILED, $endpointSignature);
        $eventDispatcher->dispatch(Events::STRIPE_WEBHOOK, $event);

        if ($exception = $event->getException()) {
            throw $exception;
        }

        return new Response();
```

Now, we need to create our EventSubscriber:

```
