Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Yii2 Stripe Webhook testing: "[ERROR] Failed to Post"

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']);
    }
Comment

PREVIOUS NEXT
Code Example
Php :: form_dropdown codeigniter from database is assocative array 
Php :: behamin brequest installation on laravel 
Php :: MForm Attribute für Felder 
Php :: how to claer the input php 
Php :: laravel previous url 
Php :: convert stdclass to json in php 
Php :: create guid in php 
Php :: transaction cakephp 2 
Php :: collection laravel Gets the last key of an array 
Php :: age php datetime 
Php :: php function argument spicific types array check 
Php :: php iterate array 
Php :: check network connection php 
Php :: laravel check old password 
Php :: how handle the number with k in laravel balde 
Php :: acf get sub field 
Php :: what sign is less than or equal to php 
Php :: install symfony ubuntu 
Php :: pathtophp in ubuntu lampp in moodle 
Php :: laravel naming conventions 
Php :: composer require laravel/ui laravel 7 
Php :: laravel descending order paginate eloquent 
Php :: pdo fetchall as object 
Php :: xendit callback 
Php :: composer create-project laravel/laravel --prefer-dist laravel-bootstrap 
Php :: php str_pad not working 
Php :: php trim array to certain length 
Php :: php favicon 
Php :: jquery ajax 500 internal server error php 
Php :: download speed limit php 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =