• 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

"cannot list resources" error from WooCommerce REST API

How can I get a div content in php

SendGrid: Sending an email to multiple recipients without other emails being shown on the "to" field

Why i get wrong output for html markdown?

Can I use a WooCommerce function without any WooCommerce page?

Warning file_get_contents () failed to open stream: HTTP request failed! HTTP/1.0 402 Payment Required

protect images from being copied

Sentry + Laravel: how to log an already catched Exception?

Artisan, creating tables in database

Laravel Mix Uncaught ReferenceError: $ is not defined

Can't remotely connect to MySQL error (13) with PHP script, connecting through CLI works

Error converting docx to pdf using Unoconv

Need to display only array value in JSON output

How can I stop a symfony process which is listening on http://127.0.0.1:8000

How to edit Records using CodeIgniter

About Contact Privacy policy Terms and conditions