Start accepting payments via Settle in seconds ✨
An easy to use SDK for Node.js with all the best practices to kickstart your integration with the Settle Payment Platform.
- Client — Simplifies calling the Settle API by handling request signing and authorization.
- Handler — Express.js compatible middleware that verifies signatures of incoming callbacks from Settle.
Add the settle-sdk-node
NPM package to you project.
npm i settle-sdk-node
In your projects root folder, create a file named config.js
containing the following code:
module.exports = {
environment: string, // 'sandbox' or 'production'
user: string, // can be obtained by contacting Settle
merchantId: string, // can be obtained by contacting Settle
authentication: {
sandbox: {
priv: string, // RSA Private Key
pub: string // RSA Public Key
},
production: {
priv: string, // RSA Private Key
pub: string // RSA Public Key
}
}
}
const { handler } = require('settle-sdk-node')
app.use(handler('sandbox'))
app.post( '/', ( req, res, next ) => {
console.log( 'Settle says:\n%s', req.body );
res.sendStatus( 200 );
});
method.function().then(success, failure)
const settle = require('settle-sdk-node');
const merchant = settle.merchant;
merchant.api_keys.list()
.then((success) => {
console.log(success);
}, (failure) => {
throw new Error(failure)
});
For a full overview of all available Client Functions, see our article on how to use Client Functions in the Settle SDK for Node.js.
The SDK is Open Source, licensed under the Apache 2 license. If you would like to contribute to the SDK, please feel free to fork the repo and send us a pull request. Or if you have a comment, question, or suggestion for improvements, please raise an issue.