Socket
Socket
Sign inDemoInstall

mango

Package Overview
Dependencies
20
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mango

Mango API client for node.js


Version published
Maintainers
1
Install size
636 kB
Created

Readme

Source

Installation

$ npm install mango

Usage

Import the library and set your secret API key:

var mango = require('mango')({ 'api_key': 'your Mango secret API key'});

Create a charge

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);
});

Get single charge

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:

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'

Run the tests

$ npm test

Run code coverage

$ npm run coverage

License

Licensed under the MIT license.

Copyright (c) 2014 Mango.

Keywords

FAQs

Last updated on 20 Jul 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc