Stripe Mock Webhooks
Quickly test Stripe Webhooks against your application without hitting Stripe or requiring internet connectivity.
Features & Data
- Customize Webhook response
- Generate Webhook response object without triggering it against your application
- Offline mocking
- Supports multiple versions of the Stripe API
- Promises!
Install
$ npm install stripe-mock-webhooks --save-dev
Usage
// Requirevar StripeMockWebhooks = // Tell the server where it should send eventsvar webhooks = version: '2015-10-01' // Default is latest Stripe API version url: 'http://localhost:3001/stripe/events'
Send a webhook:
webhooks
Or overwrite values in the response:
webhooks
Additional options can be turned on / off:
webhooks
Build JSON
response without triggering an event:
var response = webhooks
Supports the same arguments as webhooks.trigger
Trigger Options
now
- Updates eventcreated
timestamp toDate.now()
, defaults totrue
Examples
Look in tests to see example usage.
License
MIT © Nijiko Yonskai