Version: current

EBANX Node.js

This library enables you to integrate EBANX with any Node.js application.

Requirements

Node.js >= 0.10.x

Installation

npm

The EBANX module is available on npm, therefore you can install it by simply updating your package.json file:

"dependencies": {
"ebanx": "*"
}

You can also install it through the command line:

npm install ebanx

Git Repository

Clone the git repository anywhere you want and include the EBANX module autoloader from ‘index.js’.

Usage

To use the EBANX NodeJS module you need to setup your integration key.

ebanx.configure({
integrationKey : "your-test-integration-key"
});

You can also enable or disable test mode:

ebanx.configure({
integrationKey : "your-production-integration-key",
testMode : false
});

You can change the following settings:

  • integrationKey: your integration key. It will be different in test and production modes.
  • testMode: enable or disable the test mode. The default value is false.

To create a new API request, just call one of the following methods on the module object and supply it with the request parameters:

  • ebanx.cancel()
  • ebanx.capture()
  • ebanx.direct()
  • ebanx.exchange()
  • ebanx.print()
  • ebanx.query()
  • ebanx.refund()
  • ebanx.refundOrCancel()
  • ebanx.request()
  • ebanx.token()
  • ebanx.zipcode()

request command example:

var Ebanx = require('ebanx');
var ebx = new Ebanx();
ebx.configure({
integrationKey : 'fd29a3b39d8f7bffa31cecfe895236ba5b43683e225f9d4de78ac3bdca7dfb184abfed285cc99d5b13813672e586f9cf9eb8',
testMode : true
});
var params = {
'currency_code': 'USD',
'amount': '22.00',
'name': 'Jose da Silva',
'email': 'jose@example.org',
'payment_type_code': '_all',
'merchant_payment_code': "7c667cde1d9"
};
ebx.request(params, function(error, reply) {
if(error) {
console.log(error);
} else {
console.log(reply);
}
});

Contributing

Help us to improve our applications!

If you find a bug or wants to add some new feature, talk with us. Send a pull request to our GitHub repository.

https://github.com/ebanx-integration/ebanx-nodejs

Last updated on by Gabriel Rodrigues