Security News
How Threat Actors are Abusing GitHub’s File Upload Feature to Host Malware
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
stripe-mock-webhooks
Advanced tools
Readme
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 48 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
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.