npm install mango```
$ npm install mango
var mango = require('mango')({ 'api_key': 'your Mango secret API key'});
`$3
In order to create a Charge, you must call the create() method with the required arguments.`
mango.Charges.create({
'token': 'token_mwhushs06o62aruq9n3pmvu7f0ia696y',
'amount': 2000,
'email': 'test@example.org'
}, function(err, charge) {
console.log(charge);
});
`$3
When you have a charge uid, you can get a full detail using the get() method:
`
mango.Charges.get('charge_1234123141231', function(err, charge) {
console.log(charge);
});
`You can also work with all the other resources authenticated with a secret API Key:
- Charges
- Refunds
- Customers
- Cards
- Queue
- Installments
- Promotions
- Coupons
Tests
Install the module along with the dev dependencies.
`
$ git clone git://github.com/mango/mango-node.git
$ cd mango-node
$ npm install
`To run the tests you'll need Mango API keys (mode Sandbox):
`
export MANGO_SECRET_TEST_KEY='your secret test API key'
export MANGO_PUBLIC_TEST_KEY='your public test API Key'
`$3
`
$ npm test
`$3
`
$ npm run coverage
``Copyright (c) 2014 Mango.