Yii2 Stripe Webhook Testing: [ERROR] Failed To Post

[Solved] Yii2 Stripe Webhook Testing: [ERROR] Failed To Post | Php Frameworks Yii - Code Explorer | yomemimo.com
Question : Yii2 Stripe Webhook testing: "[ERROR] Failed to Post"

Answered by : rusik

class CreditCardController extends Controller
{ public function behaviors() { return [ 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ 'webhook' => ['post'], ], ], ]; } public function beforeAction($action) { if ($action->id == 'webhook') $this->enableCsrfValidation = false; return parent::beforeAction($action); } public function actionWebhook() { $payload = file_get_contents('php://input'); ob_start(); var_dump($payload); error_log(ob_get_clean(), 4); echo json_encode(['status' => 'success']); }

Source : https://stackoverflow.com/questions/69892590/yii2-stripe-webhook-testing-error-failed-to-post | Last Update : Sat, 26 Mar 22

Answers related to Yii2 Stripe Webhook testing: [ERROR] Failed to Post

Code Explorer Popular Question For Php Frameworks Yii