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.
paystack
Advanced tools
Readme
Nodejs API wrapper for Paystack.
npm install paystack
// Require the library
var paystack = require('paystack')('secret_key');
The resource methods accepts are promisified, but can receive optional callback as the last argument.
// First Option
// paystack.{resource}.{method}
paystack.customer.list(function(error, body) {
console.log(error);
console.log(body);
});
// Second Option
// paystack.{resource}
paystack.customer.list()
.then(function(body) {
console.log(body);
})
.catch(function(error) {
console.log(error);
});
For resource methods that use POST or PUT, the JSON body can be passed as the first argument.
paystack.plan.create({
name: 'API demo',
amount: 10000,
interval: 'monthly'
})
.then(function(error, body) {
console.log(error);
console.log(body);
});
For GET, you can pass the required ID as string and optional parameters as an optional object argument.
paystack.plan.get(90)
.then(function(error, body) {
console.log(error);
console.log(body);
});
paystack.transactions.list({perPage: 20})
.then(function(error, body) {
console.log(error);
console.log(body);
});
To run tests, add your Paystack test secret key to package.json
. (The test line should look something like this: env KEY=sk_test_1a68ac96a0171fb72111a24295d8d31d41c28eed ./node_modules/.bin/mocha...
). Now run:
npm test
If you are contributing to the repo, kindly update the necessary test file in /test
or add a new one and ensure all tests are passed before sending a PR.
FAQs
Paystack API wrapper
The npm package paystack receives a total of 1,383 weekly downloads. As such, paystack popularity was classified as popular.
We found that paystack 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.