akkroo / stripe-event
Stripe webhook integration for PHP
Installs: 929
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/akkroo/stripe-event
Requires
- php: >=5.3.0
Requires (Dev)
- ext-xdebug: *
- phpunit/phpunit: 3.7.*
Suggests
- stripe/stripe-php: The full Stripe API Client
This package is not auto-updated.
Last update: 2020-01-20 03:32:37 UTC
README
Usage
<?php use \Akkroo\StripeEvent\StripeEvent; try { $stripeEvent = new StripeEvent(); } catch(\Akkroo\StripeEvent\Exceptions\StripeEventException $e) { StripeEvent::sendExceptionResponse($e); exit(1); } switch($stripeEvent->getType()) { case 'account.updated': // account updated // perform action break; case 'charge.succeeded': // charge succeeded // perform action break; default: echo 'Unhandled event'; break; } StripeEvent::sendSuccessResponse(); exit(0);
Requirements
- PHP 5.3 or higher
- Xdebug to test the methods which set headers
Submitting bugs and feature requests
Bugs and feature request are tracked on GitHub
License
StripeEvent is licensed under the MIT License - see the LICENSE file for details