• 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

Problem with fetching data from database in Laravel

How to Install Composer Require doctrine/dbal

Get number of working days between two dates in PHP [duplicate]

how to insert data into select2 search input after scan using qrcode

how to get the header value, if we don't know the value because the value is random from the server

How to reset Laravel AuthManager/guards in between API calls in tests?

array_key_exists(): The first argument should be either a string or an integer

Changing font color in javascript

PHP/HTML: Creating A SubMenu

PHP array_filter with arguments

woocommerce change position of price

Batch request Google Calendar php API

Server-sent events in PHP (without echo or print)

How to install LDAP in Docker php-fpm alpine

How to get AJAX to post on second page?

About Contact Privacy policy Terms and conditions