akkroo/stripe-event

This package is abandoned and no longer maintained. No replacement package was suggested.

Stripe webhook integration for PHP

v1.0.1 2013-11-06 10:11 UTC

This package is not auto-updated.

Last update: 2020-01-20 03:32:37 UTC


README

Total Downloads Latest Stable Version

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