Answers.Body: <p>If CSRF protection is enabled (and it is by default for the latest versions of Craft), Stripe was getting a server error when using the Charge webhook url. The solution is to disable CSRF for the webhook URI - you can read more about it <a href="https://craftcms.stackexchange.com/questions/4553/whats-the-best-way-to-skip-csrf-for-plugin-controllers">here</a></p>
  
  <p>or simply add this to your <code>config/general.php</code> file:</p>
  
  <pre><code>'enableCsrfProtection' =&gt; (!isset($_SERVER['REQUEST_URI']) || $_SERVER['REQUEST_URI'] != '/actions/charge/webhook/callback'),
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-23T23:43:56.113Z
Answers.LastActivityDate: 2017-07-23T23:43:56.113Z
Answers.UserDisplayName: Roi Agneta
Body: <p>Stripe is throwing a server error when trying to access a webhook to the Charge plugin. Some investigation revealed the error is triggered by an 'invalid or missing CSRF token.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-21T17:38:33.840Z
Comments.Text: Hey Roy... thanks for sharing.  Would you mind splitting this up into a question and adding your solution as an official answer? I bet you'll get more reputation that way. :)
Comments.UserDisplayName: Brad Bell
Tags: <plugin-charge><csrf>
Title: Webhook Error with Charge plugin
ThreadText: # Webhook Error with Charge plugin
  
  (Asked by: username_0 on 2017-07-21)
  
  Stripe is throwing a server error when trying to access a webhook to the Charge plugin. Some investigation revealed the error is triggered by an 'invalid or missing CSRF token.
  
  **Tags:** plugin-charge, csrf
  
  > **Comments:**
  > **username_1**: Hey Roy... thanks for sharing.  Would you mind splitting this up into a question and adding your solution as an official answer? I bet you'll get more reputation that way. :)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-07-23. Score: 3
  
  If CSRF protection is enabled (and it is by default for the latest versions of Craft), Stripe was getting a server error when using the Charge webhook url. The solution is to disable CSRF for the webhook URI - you can read more about it [here](https://craftcms.stackexchange.com/questions/4553/whats-the-best-way-to-skip-csrf-for-plugin-controllers)
  
  or simply add this to your `config/general.php` file:
  
  ```
  'enableCsrfProtection' => (!isset($_SERVER['REQUEST_URI']) || $_SERVER['REQUEST_URI'] != '/actions/charge/webhook/callback'),
  
  ```
  
  
  ---
  
  