Skip to content

Instantly share code, notes, and snippets.

@andrewpthorp
Created November 22, 2013 16:58
Show Gist options
  • Save andrewpthorp/7603223 to your computer and use it in GitHub Desktop.
Save andrewpthorp/7603223 to your computer and use it in GitHub Desktop.
Stripe PHP Webhooks.
try {
$response = Stripe_Event::retrieve($event_json->id);
// If you get to this point, you have a valid Stripe Event.
// You will do something with the response, which will be a Stripe_Event.
} catch (Stripe_InvalidRequestError $e) {
// If you get to this point, you tried to request an invalid Stripe_Event.
// This could be a bogus event id passed from a malicious user. It could
// also be a test webhook that doesn't have a valid event id.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment