Hi there,
I am kinda new to the yii FrameWork, and i need help.
i need to implement a stripe webhook controller that is used for the subscription event sent by Stripe.
For this controller, there is no view nor model
I can access to the controller, but the $_POST content is empty and i cannot figure why.
Is it possible to use the post verb without a view ?
here’s an example :
class StripeWebhookController extends Controller
{
public function beforeAction($action)
{
if ($action->id == 'index') {
$this->enableCsrfValidation = false;
}
return parent::beforeAction($action);
}
public function actionIndex()
{
// retrieve the request's body and parse it as JSON
$input = file_get_contents('php://input'); // -> here $input is null
$event_json = json_decode($input, true);
// Do the work...
}
i used the
print_r(Yii::$app->request->post() /*$_POST*/); exit();
and i only got an empty array.
After days of search i found nothing…
If any one has an idea, i will gladly take it
Thanks for reading me
cya