node package manager
Don’t reinvent the wheel. Reuse code within your team. Create a free org »

passwallet

About Build Status

=====

passwallet is a Connect and Express middleware for Attido Mobile's PassWallet API.

Think Apple's iOS Passbook for the rest of us (currently supports Android and BlackBerry, others to follow).

Installation

$ npm install passwallet

Usage

var express = require('express'),
	passwallet = require('passwallet');

var app = express()
		.use(passwallet.middleware());

// when models have loaded
passwallet.loadPass(Pass/*Some model*/);
passwallet.loadPass(Registration/*Some model*/);
passwallet.loadPass(Device/*Some model*/);

Required functions

Pass.pwFind = function ({
	passTypeIdentifier: ?,
	serialNumber: ?
}, function (err, pass));

Registration.pwFind = function ({
	deviceLibraryIdentifier: ?,
	passTypeIdentifier: ?,
	serialNumber: ?
}, function (err, registration));

Registration.pwCreate = function ({
	deviceLibraryIdentifier: ?,
	passTypeIdentifier: ?,
	serialNumber: ?
}, function (err, registration));

Device.pwFind = function ({
	deviceLibraryIdentifier: ?
}, function (err, registration));

Device.pwCreate = function ({
	deviceLibraryIdentifier: ?,
	pushToken: ?,
	pushServiceUrl: ?
}, function (err, registration));

Run tests

$ npm test

Credits