CodeIgniter Forums
Stripe Webhook help - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Stripe Webhook help (/showthread.php?tid=78180)



Stripe Webhook help - biggunn - 12-10-2020

I am trying to work with webhooks from Stripe but cannot get past the issue of it returning 302  Found as the header response.
Stripe is sending a POST with json data.

I have tried both locally and on live and it comes up with the same response.

Severity: Notice
Message: Undefined index: HTTP_REFERER
Filename: html/error_general.php
Line Number: 4


If I remove the:  require_once BASEPATH.'core/CodeIgniter.php';  
in index.php, I can get a 200 response, but it still never hits my controller.

This is my controller: (webhook_controller.php)

Code:
defined('BASEPATH') OR exit('No direct script access allowed');
class Webhook_controller extends Home_Core_Controller
{
    public function webhook()
    {
        }
}
**I also tried my webhook method in Auth_controller and Home_controller but it didn't make any difference.


This is my route:  

Code:
$route['webhook']['post'] = 'webhook_controller/webhook';

I have excluded my webhook_controller from csrf

Code:
$config['csrf_exclude_uris'] = array('ajax_admin_controller.*', 'ajax_controller.*', 'webhook_controller.*' );

I tried adding the Stripe IP in .htaccess, but it didnt change anything.

[font=Menlo, Consolas, monospace]Obviously there is some security issue I am running up against, but cannot figure out how to get around.[/font]

[font=Menlo, Consolas, monospace]I have been banging my head against this wall for two days, so if anyone has any suggestions, I would really appreciate it.[/font]

[font=Menlo, Consolas, monospace]Thanks in advance.[/font]