• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Debugging Stripe Webhook Event

phpstripe-paymentswebhooks


PHP Snippet 1:

<?php
// Retrieve the request's body and parse it as JSON:
$input = @file_get_contents('php://input');
$event = json_decode($input);

http_response_code(200); // PHP 5.4 or greater

// echo the event id, evt_xxxyyyzzz
echo $event->id;

if($event->type == "charge.succeeded") {
   // you want the id of the charge rather than the event, ch_xxxyyzz
   echo $event->data->object->id;
}

?>

Related Snippets

PHP my timezone is no setting up in PHP.ini File in xampp

Laravel after login Two factor not working

Symfony 4: "Autowire: you should configure its value explicitly."

WHERE IN array binding in DB::raw laravel 5.4

Laravel s3 upload file with metadata using pre-signed url

Unable to uninstall brew php from homebrew

I'm trying to write a clean url for my website using the $_SERVER['REQUEST_URI'] in php

Python - Include another Python script

Inserting Country Selection into MySQL PHP [duplicate]

How can i call a function that executes an fpdf based on the choice of a form selector?

Target class controller does not exist - Laravel 8

Parsing JSON File to array in PHP

Facebook API, get page post link (PHP)

Elastic Beanstalk with Laravel Envoy

How do I upload a laravel project on cPanel shared hosting?

About Contact Privacy policy Terms and conditions