Skip to content

mikemaccana/quaderno-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quaderno Server

Build Status

Installation

This is a small module designed for node.js servers to help calculate JSON web tokens (JWTs) for one-off charges in Quaderno JS.

Usage

var quadernoServer = require('quaderno-server')(quadernoSecretKey);

Getting a web token

There are two options:

Run it with:

var jsonWebToken = quadernoServer.getJSONWebToken(amount, currency, description, date)

This will return JSONWebToken:String, which you can use in createCharge() in

Getting a web token for PayPal subscriptions

There are two options:

  • amount Number, required. Whole number, in cents / pence / eurocents etc.
  • currency String, defaults to 'USD'. ISO_4217 currency code. See http://en.wikipedia.org/wiki/ISO_4217
  • unit String, required. Defaults to M. Specify the units of the subscription frequency (D, W, M, Y)
  • duration Number, required. Defaults to 1. Specify the subscription frequency, eg: 1, 2, 3, 6, 12, 18, 24 etc
  • description String, optional. The statement you want to show on your receipt. https://quaderno.io/docs/guides/charge-form/
  • date Date, optional (default current time)

Run it with:

var jsonWebToken = quadernoServer.getJSONPayPalSubWebToken(amount, currency, unit, duration, description, date)

This will return JSONWebToken:String, which you can use in createSubscription() in

Tests

Run mocha

About

Helps calculate JSON web tokens (JWTs) for one-off charges in Quaderno.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published