Skip to content

kodyl/paymill-nodejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

paymill-nodejs

Node.js wrapper for Paymill API/V2.x.

This module as been created as a drop in replacement for komola's paymill-node which does not support the latest features in the Paymill API/V2.1

Installation

npm install paymill

Usage

The first thing to do, is create a paymill instance using your Paymill private key and an optional apiVersion (which can be either v2 or v2.1, with the last one being the default, if the argument is omitted).

var paymill = require('paymill')('apiKey'[, 'apiVersion']);

We can now access the API using a generic pattern, either with a callback as the last argument otherwise a Promise is returned.

Using callback

paymill.{resourceName}.{method}([arguments], function (err, response) {
	// ...
});

Using Promise

paymill.{resourceName}.{method}([arguments])
  .then(function (response) {
    // ...
  })
  .catch(function (err) {
    // ...
  });

API endpoints

Plain JavaScript object, e.g. { key: 'value' } is expected as data and as the argument in all create-method

TODO

  • Add unit and integration tests
  • Add examples to show how to use the wrapper in various cases

Author

Written by Daniel Juhl. Inspiration from Ask Bjørn Hansen and komola's paymill-node.

About

Paymill API wrapper

Resources

License

Stars

Watchers

Forks

Packages

No packages published