Git Product home page Git Product logo

paynl's Introduction

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 pay = require('paynl');

var pay = new Pay();

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.

AccountId and token (recommended)

You can authenticate using your API token.

var pay = require('paynl');

var 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 pay = require('paynl');

var 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.

paynl's People

Contributors

rwoverdijk avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.