title: Stripe Webhook not working
body: <p>So I'm trying to do a simple Stripe Webhook. Ideally this shouldn't be to difficult. </p>
  
  <p>I'm using this <a href="https://gist.github.com/boucher/1708172" rel="noreferrer">webhook</a> </p>
  
  <p>So here is my code: </p>
  
  <pre><code>  &lt;?php
  
  require_once('lib/Stripe.php');
  
  // Replace "xyz" with your Stripe Secret Live Key //
  Stripe::setApiKey("xxx");
  
  $body = @file_get_contents('php://input');
  $event_json = json_decode($body);
  
  
  // SETUP:
  // 1. Customize all the settings (stripe api key, email settings, email text)
  // 2. Put this code somewhere where it's accessible by a URL on your server.
  // 3. Add the URL of that location to the settings at https://manage.stripe.com/#account/webhooks
  // 4. Have fun!
  // set your secret key: remember to change this to your live secret key in production
  // see your keys here https://manage.stripe.com/account
  // retrieve the request's body and parse it as JSON
  $body = @file_get_contents('php://input');
  $event_json = json_decode($body);
  
  // for extra security, retrieve from the Stripe API
  $event_id = $event_json-&gt;id;
  $event = Stripe_Event::retrieve($event_id);
  
  // This will send receipts on succesful invoices
  if ($event-&gt;type === 'invoice.payment_succeeded') {
      email_invoice_receipt($event-&gt;data-&gt;object);
  }
  
  function email_invoice_receipt($invoice) {
      $customer = Stripe_Customer::retrieve($invoice-&gt;customer);
  
  //Make sure to customize your from address
      $subject = 'Your payment has been received';
      $headers = 'From: "MyApp Support" &lt;support@myapp.com&gt;';
  
      mail($customer-&gt;email, $subject, message_body(), $headers);
  }
  
  function format_stripe_amount($amount) {
      return sprintf('$%0.2f', $amount / 100.0);
  }
  
  function format_stripe_timestamp($timestamp) {
      return strftime("%m/%d/%Y", $timestamp);
  }
  
  function payment_received_body($invoice, $customer) {
      $subscription = $invoice-&gt;lines-&gt;subscriptions[0];
      return &lt;&lt;&lt;EOF
  Dear {$customer-&gt;email}:
  
  This is a receipt for your subscription. This is only a receipt,
   no payment is due. Thanks for your continued support!
  -------------------------------------------------
  SUBSCRIPTION RECEIPT
  
  Email: {$customer-&gt;email}
  Plan: {$subscription-&gt;plan-&gt;name}
  Amount: {format_stripe_amount($invoice-&gt;total)} (USD)
  
  For service between {format_stripe_timestamp($subscription-&gt;period-&gt;start)} and {format_stripe_timestamp($subscription-&gt;period-&gt;end)}
  
  -------------------------------------------------
  
  EOF;
  }
  
  ?&gt;
  </code></pre>
  
  <p>The sign up page is here: <a href="http://www.strategic-options.com/trade/sign_up" rel="noreferrer">http://www.strategic-options.com/trade/sign_up</a>
  Webhook here: <a href="http://www.strategic-options.com/trade/3_party/Simple-Bootstrap-Stripe-Payment-Form/stripe_webhook.php" rel="noreferrer">http://www.strategic-options.com/trade/3_party/Simple-Bootstrap-Stripe-Payment-Form/stripe_webhook.php</a></p>
  
  <p>My transactions are going thru, casue I see them in the dashboard. I have set the webhook on the dashboard appropriately to the right link. So when I try to test on webhook feature I always get a fail because evt_000000000 doesn't get a response. I don't know of any other way to test this webhook, other than the using the dashboard? </p>
  
  <pre><code>&lt;br/&gt;
  &lt;b&gt;Fatal error&lt;/b&gt;: Uncaught exception 'Stripe_InvalidRequestError' with message 'No such event: evt_00000000000000' in /home/strategicoptions/strategic-options.com/trade/3_party/Simple-Bootstrap-Stripe-Payment-Form/lib/Stripe/ApiRequestor.php:152
  Stack trace:
  #0 /home/strategicoptions/strategic-options.com/trade/3_party/Simple-Bootstrap-Stripe-Payment-Form/lib/Stripe/ApiRequestor.php(212): Stripe_ApiRequestor-&amp;gt;handleApiError('{\n &amp;quot;error&amp;quot;: {\n...', 404, Array)
  #1 /home/strategicoptions/strategic-options.com/trade/3_party/Simple-Bootstrap-Stripe-Payment-Form/lib/Stripe/ApiRequestor.php(114): Stripe_ApiRequestor-&amp;gt;_interpretResponse('{\n &amp;quot;error&amp;quot;: {\n...', 404)
  #2 /home/strategicoptions/strategic-options.com/trade/3_party/Simple-Bootstrap-Stripe-Payment-Form/lib/Stripe/ApiResource.php(24): Stripe_ApiRequestor-&amp;gt;request('get', '/v1/events/evt_...', Array)
  #3 /home/strategicoptions/strategic-options.com/trade/3_party/Simple-Bootstrap-Stripe-Payment-Form/lib/Stripe/ApiResource.php(8): Stripe_ApiResource-&amp;gt;refresh()
  #4 /home/strategicop in &lt;b&gt;/home/strategicoptions/strategic-options.com/trade/3_party/Simple-Bootstrap-Stripe-Payment-Form/lib/Stripe/ApiRequestor.php&lt;/b&gt; on line &lt;b&gt;152&lt;/b&gt;&lt;br/&gt;
  </code></pre>