Created
January 20, 2015 19:20
-
-
Save rserna2010/26ebdd8a3e9511f98e35 to your computer and use it in GitHub Desktop.
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('ak-test-1xGEmbY58peQpnsgKEpgjuXgR1TjYdGpj'); | |
// Create a customer with some dummmy data | |
balanced.get('/debits/WDwXsVosniVmJBcxO7IfTFj').then(function(customer) { | |
// Prints the newly created customer | |
print(customer); | |
}, function(err) { | |
print('Error Creating Customer!'); | |
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