• 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

Laravel lang slug in url

PHP and WebView - Cookie doesn't are the same

Convert regular text to array using notepad++

Unable to get password for the instance created from AMI

How to average columns of data from multiple, flat arrays?

Clear javascript source cache laravel 5.8

Correct way to use LIKE '%{$var}%' with prepared statements?

Object of class stdClass could not be converted to string error

PHP Slim Framework request using withAttribute error

How to insert Google Adsense Code in PHP script?

Laravel Sanctum CSRF not authenticating

Select option menu read from database and use it's values

Custom Button next to “ADD TO CART” button of WooCommerce based on Product Type

Symfony autowiring issues since docker update

Why does codeigniter & Linux server throws unserialize() session data error when user tries to login

About Contact Privacy policy Terms and conditions