Git Product home page Git Product logo

kosher-bluepay's Introduction

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();

kosher-bluepay's People

Contributors

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