Created
January 20, 2015 18:43
-
-
Save rootedsoftware/6e610514705c503c1118 to your computer and use it in GitHub Desktop.
Balanced debit get
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Import the official balanced nodejs package | |
var balanced = require('balanced-official'); | |
// Create a new API Key and configure the client with it | |
// The client automatically creates a new test marketplace for us | |
// if a marketplace does not exist for the api key | |
balanced.configure(apikey); | |
// Create a customer with some dummmy data | |
balanced.get('https://api.balancedpayments.com/debits/WD5rJ4kojAowU1YW4pz86Tb').then(function(debit) { | |
// Prints the debit | |
print(debit); | |
}, function(err) { | |
print('Error Getting Debit!'); | |
print(err); | |
}); | |
// Nicely print a formatted json representation of the object | |
function print(obj) { | |
console.log('string' === typeof obj ? obj : JSON.stringify(obj, null, 4)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment