Created
November 22, 2013 16:58
-
-
Save andrewpthorp/7603223 to your computer and use it in GitHub Desktop.
Stripe PHP Webhooks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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