Skip to content

miclf/php-stripe-webhook-tester

 
 

Repository files navigation

PHP Stripe Webhook Tester

Latest Version Software License Build Status Coverage Status Quality Score Total Downloads

The goal of this package is to make testing stripe webhooks easy on a local machine without the use of ngrok or other similar tunneling services. The package will simulate a post request to a specified endpoint with a json containing event data and make sure that your application reacts accordingly.

Install

Via Composer

$ composer require TeamTNT/php-stripe-webhook-tester 1.0.*

Usage

$tester = new TeamTNT\Stripe\WebhookTester();
$tester->setVersion('2014-09-08');
$tester->setEndpoint('http://local.dev/stripe/webhooks');

$response = $tester->triggerEvent('charge.succeeded');

For your convenience you can use chained methods

$tester = new TeamTNT\Stripe\WebhookTester('http://local.dev/stripe/webhooks);
$response = $tester->setVersion('2014-09-08')->triggerEvent('charge.succeeded');

Availabe versions and events

Available versions and events can be found in the webhooks directory

Testing

$ phpunit

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

A PHP package for testing Stripe Webhooks localy

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%