• 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

Symfony 4: "Autowire: you should configure its value explicitly."

How do I truncate a decimal in PHP?

insert multiple rows in a saveall in cakephp

How can I easily switch between PHP versions on Mac OSX?

Group rows by column and sum another column within groups [duplicate]

How to skip cart page on woocomerce for certain products only?

PHP - Check if string contains words longer than 4 characters, then include "+ *", and for those shorter than 4 characters include only "*"

NGINX: connect() to unix:/var/run/php7.2-fpm.sock failed (2: No such file or directory)

Unable to match results of php hash_hmac() and coldfusion hmac()

Using if(isset($_POST['submit'])) to not display echo when script is open is not working

Limit WooCommerce products in cart only from one custom taxonomy

how to sort by a custom appended relation to model

jwt decode throws Invalid argument supplied for foreach() on php-jwt and codeignitor 4

Merge key and value of array index [duplicate]

php mysql + create a friend request system

About Contact Privacy policy Terms and conditions