Node Client Library
Installation
npm install braintree
Updates
Current version: 0.5.1. Released February 01, 2012.
Fill out this form to receive emails when we release updates to the Node.js library.
Source Code
Integration Examples
None Yet
Bugs
If you run into a bug, email us at support@braintreepayments.com or create an issue on the github issue tracker.
Quick Start Example
var sys = require('sys'),
braintree = require('braintree');
var gateway = braintree.connect({
environment: braintree.Environment.Sandbox,
merchantId: 'your_merchant_id',
publicKey: 'your_public_key',
privateKey: 'your_private_key'
});
gateway.transaction.sale({
amount: '5.00',
creditCard: {
number: '5105105105105100',
expirationDate: '05/12'
}
}, function (err, result) {
if (err) throw err;
if (result.success) {
sys.puts('Transaction ID: ' + result.transaction.id);
} else {
sys.puts(result.message);
}
});