Skip to content

A wrapper for Node.js projects to access the Moneris API.

License

Notifications You must be signed in to change notification settings

gabrielsimpsons/moneryze

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

moneryze

Currently only supports vault transactions, more will be added soon

NPM version  Build Status  Coverage Status  License: MIT

A wrapper to access the Moneris API, forked from AlejandroEsquivel's great work (AlejandroEsquivel/moneris-js), forked from shaynair's great work (shaynair/moneris-js)

The hope for this module is to create clean, robust, promise wrapped queries that extend just beyond payments. Shaynair's work supported generalized queries to Moneris, Alejandro's work handled the imperfect formatting. My hope is to extend and complete the wrapper, transforming the project into something easy to implement by any developer.

Installation | Usage | Example |f License

Installation

With npm:

npm install moneryze --save

Note: You need an engine that supports ES6 (e.g. Babel or Node 4.0+).

General Usage

const moneris = require('moneryze');

Queries the Moneris API with the information provided.

  • config: Required. An object with the following fields.
    • app_name: Optional. If given, will add app_name as a prefix to receipt names.
    • api_token: Required. Your API token.
    • store_id: Required. Your store ID.
    • crypt_type: Optional. If given, will set the default crypt_type for all transactions. 7 by default.
    • test: Optional. If true, uses Moneris Test endpoints. You can get a api_token and store_id for this endpoint from Moneris's Documentation. false by default.

.init() must be called before any other operation, otherwise an error will be thrown

Example

.init()

moneris.init({
  app_name: 'Test',
  store_id: 'store5',
  api_token: 'yesguy',
  crypt_type: '7',
  test: true,
});

.resAddCC()

  • pan: Required. card number.
  • expdate: Required. Expiry date of the card.
moneris.resAddCC({
  pan: '4242424242424242',
  expdate: '2011',
});

.resPurchaseCC()

  • token: Required. customer's moneris token.
  • amount: Required. amount to charge
  • description: Optional. A short message attached to the purchase.
moneris.resPurchaseCC({
  token: 'D8WyyItuNb6mHn4biiPqAwM42',
  amount: 11.98,
  description: 'bubble tea',
});

License

MIT

Notes

With love and passion,

wuon

About

A wrapper for Node.js projects to access the Moneris API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%