• 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

WordPress - Dynamically add user ID to the end of a URL

How to install ZeroMQ for PHP on an Alpine Linux container?

Insert And Retrieve Data in MySQL with $.post Noob Question

Handle error for duplicate entries - PHP/MySQL

possible options to create pdf file using html elements to generate invoice in php and codeigniter

Check if my GET request has Header: Token

Log a user out of a website when they put their computer to sleep

Insert multidimensional array to codeigniter cart

I want to store data in new index as per my key in php [duplicate]

Why do I have invalid argument supply for foreach in Laravel for json response? [duplicate]

How to run a shell as root from php (apache)

Get WooCommerce product variation attribute terms in admin products general box

Applying programmatically a coupon to an Order in WooCommerce3

how to create html table in php

"Mixed content blocked" when running an HTTP AJAX operation in an HTTPS page

About Contact Privacy policy Terms and conditions