34 lines
674 B
PHP
34 lines
674 B
PHP
<?php
|
|
|
|
namespace App\Controllers\Frontend;
|
|
|
|
use App\Controllers\BaseController;
|
|
use CodeIgniter\API\ResponseTrait;
|
|
use App\Libraries\Grab;
|
|
use App\Models\LogGrab;
|
|
|
|
class GrabController extends BaseController
|
|
{
|
|
protected $grab;
|
|
use ResponseTrait;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->grab = new Grab();
|
|
}
|
|
|
|
public function webhook()
|
|
{
|
|
$rawBody = file_get_contents('php://input');
|
|
$data = json_decode($rawBody, true);
|
|
if ($data) {
|
|
$this->grab->handleWebhook($data);
|
|
}
|
|
|
|
return $this->respond([
|
|
'status' => 200,
|
|
'message' => 'Webhook received'
|
|
]);
|
|
}
|
|
}
|