Gateway.charge()

Charge Credit Card

Usage

Hover over inputs/exits for more info.

var Gateway = require('machinepack-gateway');


// Charge Credit Card

Gateway.charge({

credential: '...{"apiLogin": "this info"}...',

transaction: '...{"firstname": "John"}...',

gateway: 'Authorize.Net',

testMode: 'false',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// Could not parse provided credential string- must be a valid JSON string.

couldNotParse: function () {

 

},

// OK.

success: function () {

 

},

});

Inputs

credential required

Username and / pasword / token etc required to access your gateway account

'...{"apiLogin": "this info"}...'
transaction required

Credit Card Sale info

'...{"firstname": "John"}...'
gateway required

Code name of gateway to use

'Authorize.Net'
testMode

is this a test?

'false'

Exits

error

An unexpected error occurred.

couldNotParse

Could not parse provided credential string- must be a valid JSON string.

success

OK.