title: Converting PayPal IPN script to Stripe Webhooks
body: <p>I am looking to get away from PayPal IPN, and move towards Stripe.</p>
  
  <p>The point of the script is to send out an email to a customer every time I receive a payment over a certain amount. </p>
  
  <p>The code I have written so far is. For some reason it isn't working.
      
  
  <pre><code>Stripe::setApiKey("XXX");
  
  // Retrieve the request's body and parse it as JSON
  $body = @file_get_contents('php://input');
  $event_json = json_decode($body);
  
  }
  mail "expresspoints@outlook.com";
  $to = $customer-&gt;email;
  if (($event_json-&gt;type == 'charge.succeeded') and ($event_json-&gt;livemode == 'true') and 
  ($event_json-&gt;amount&gt;4))
  {
  </code></pre>
  
  <p>So the point of the script is, all succesful payments, which are done in live mode, and are larger than 4 will receive an email. The rest of the script is just a normal email.</p>
  
  <p>I thinkthere is an error with:</p>
  
  <pre><code>}
  mail "expresspoints@outlook.com";
  $to = $customer-&gt;email;
  if (($event_json-&gt;type == 'charge.succeeded') and ($event_json-&gt;livemode == 'true') and        ($event_json-&gt;amount&gt;4))
  {
  </code></pre>