• 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

PHPUnit gives error: Target [IlluminateContractsViewFactory] is not instantiable

generate an Excel file using PHP

Can I use a WooCommerce function without any WooCommerce page?

how to validate form data in codeigniter 4

Magento 2 - How to add new block to admin panel in product page?

Is it possible to re-use an array taken from PHP via JSON in a $.ajax function?

Laravel set default language not working

retrieve data from database using session

Need to display only array value in JSON output

How do I truncate a decimal in PHP?

Apply filter array/return terms

Yii2: How do I debug console commands?

How to write PHP in XSLT

could not find driver Debian SQL Server PHP

Connecting an HTML webpage to a SQL Server

About Contact Privacy policy Terms and conditions