paynl
A pay.nl API convenience layer for nodeJS.
Last updated 6 years ago by rwoverdijk .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install paynl 
SYNC missed versions from official npm registry.

Paynl

This is a very simple (both built, and to use) module to communicate with the PayNL API.

Installation

Super simple. Just do the following:

npm install paynl --save

Usage

Usage is pretty straight forward. There aren't that many methods, which is what makes this module so easy to use.

No handshake

If you don't need to use methods that require a handshake, you can create a new instance like so:

var Paynl = require('paynl')
  , pay   = new Paynl();

pay.invoke('Validate/getPayServerIps/v1').done(function(response) {
  console.log(response);
});

Handshake

If you wish to use methods that require authentication you must instantiate Paynl with params.

TokenId and token (recommended)

You can authenticate using your API token.

var Paynl = require('paynl')
  , pay;

pay = new Paynl({
  tokenId : 'AT-1234-9876',
  token   : '7110eda4d09e062aa5e4a390b0a572ac0d2c0220'
});

pay.invoke('Session/getPaymentOptions/v2', {
  programId : 1234,
  websiteId : 1234
}).then(function(response) {
  console.log(response);
}, function(error) {
  console.log('We got an error!', error);
});

AccountId and token

You can authenticate using your API token.

var Paynl = require('paynl')
  , pay;

pay = new Paynl({
  accountId : '1234',
  token     : '7110eda4d09e062aa5e4a390b0a572ac0d2c0220'
});

pay.invoke('Session/getPaymentOptions/v2', {
  programId : 1234,
  websiteId : 1234
}).then(function(response) {
  console.log(response);
}, function(error) {
  console.log('We got an error!', error);
});

Username, password and companyId

It's also possible to login using your credentials.

var Paynl = require('paynl')
  , pay;

pay = new Paynl({
  username  : 'YOUR_USERNAME',
  password  : 'YOUR_PASSWORD',
  companyId : 'YOUR_COMPANY_ID'
});

pay.invoke('Session/getPaymentOptions/v2', {
  programId : 1234,
  websiteId : 1234
}).then(function(response) {
  console.log(response);
}, function(error) {
  console.log('We got an error!', error);
});

API

To check out all possible API methods go to the pay.nl API docs.

Note: You can omit the ip-address. This module adds it for you.

Current Tags

  • 0.1.1                                ...           latest (6 years ago)

3 Versions

  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 4
Dependencies (4)
Dev Dependencies (0)
None
Dependents (2)

Copyright 2014 - 2017 © taobao.org |