Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
stripe-mock-webhooks
Advanced tools
Quickly test Stripe Webhooks against your application without hitting Stripe or requiring internet connectivity.
$ npm install stripe-mock-webhooks --save-dev
// Require
var StripeMockWebhooks = require('stripe-mock-webhooks')
// Tell the server where it should send events
var webhooks = new StripeMockWebhooks({
version: '2015-10-01', // Default is latest Stripe API version
url: 'http://localhost:3001/stripe/events'
})
Send a webhook:
webhooks.trigger('invoice.created').then(function (response) {
// success
}).catch(function (err) {
// error
})
Or overwrite values in the response:
webhooks.trigger('invoice.created', {
data: {
object: {
plan: {
id: 'PLAN_IDENTIFIER'
}
}
}
})
Additional options can be turned on / off:
webhooks.trigger('invoice.created', undefined, {
now: false
})
Build JSON
response without triggering an event:
var response = webhooks.build('invoice.created', {
data: {
object: {
plan: {
id: 'PLAN_IDENTIFIER'
}
}
}
})
Supports the same arguments as webhooks.trigger
now
- Updates event created
timestamp to Date.now()
, defaults to true
Look in tests to see example usage.
MIT © Nijiko Yonskai
FAQs
Test Stripe Webhooks, no internet required
The npm package stripe-mock-webhooks receives a total of 43 weekly downloads. As such, stripe-mock-webhooks popularity was classified as not popular.
We found that stripe-mock-webhooks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.