Skip to content

A node.js interface to the BluePay api. Where neatness and correctness counts.

License

Notifications You must be signed in to change notification settings

timemachine3030/kosher-bluepay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Why kosher-? This software does its best to conform to all the holy best practices of JavaScript; including proper style, linting, and testing. It aims to be an acceptable tool as well as an exemplar for learning and instructing good style.

Quick start

Store Payment Information

Send the Credit Card information and returns a Transaction ID, which you can use as a token for future transactions.

var BluePay = require('kosher-bluepay');
var connection = BluePay.connect({
    accountId: 'ACCOUNT_ID',
    secretKey: 'SECRET_KEY',
    mode: 'TEST'
});

connection
.setCustomerInformation()
.setCardInformation()
.makeToken()
.process()
.then(function (status, transaction) {

}, function (err) {

});

Charge a Customer

// Continuing with the example above, using the same customer information.
connection
.sale('3.00')
.process()
.then(function (status, transaction) {

}, function (err) {

});

or reuse a transaction token

// Clear the transaction specific data from connection
connection.reset();
// Load the transaction and complete the sale.
connection.sale('1.99', token).process();

Check If a Customer Has Enough Credit Available

Determine if customer has enough credit available without charging card.

connection.auth('1.99').process();

Return Funds to a Customer

connection.refund('1.99', token).process();

Cancel a Transaction

You can cancel a transaction if it has not yet been settled. If a transaction has already been settled, then you must issue a refund instead.

This code cancels single transactions; it doesn't cancel recurring payments.

connection.void(transactionId).process();

About

A node.js interface to the BluePay api. Where neatness and correctness counts.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published