View on GitHub

gn-api-sdk-ruby

Download this project as a .zip file Download this project as a tar.gz file

gn-api-sdk-ruby

A ruby gem for integration of your backend with the payment services provided by Gerencianet.

Build Status Coverage Status Code Climate Gem Version

:warning: Gerencianet API is under BETA version, meaning that it's not available for all users right now. If you're interested, you can always send an email to desenvolvedores@gerencianet.com.br and we'll enable it for your account

Installation

Add this line to your application's Gemfile:

gem 'gerencianet'

And then execute:

$ bundle

Or install it yourself as:

$ gem install gerencianet

Basic usage

require "gerencianet"

options = {
  client_id: "client_id",
  client_secret: "client_secret",
  sandbox: true
}

gerencianet = Gerencianet.new(options)

charge = {
  items: [{
    name: "Product A",
    value: 1000,
    amount: 2
  }]
}

response = gerencianet.create_charge(body: charge)

Examples

You can run the examples inside docs/examples with $ ruby docs/examples/example.rb:

$ ruby docs/examples/create_charge.rb

Just remember to set the correct credentials inside docs/examples/credentials.rb before running.

Tests

To run the tests, just run rspec:

$ rspec

Or use guard to watch files and automatically run rspec

$ guard -n false -c

Additional documentation

Charges

Carnets

Subscriptions

Marketplace

Notifications

Payments

All in one

Changelog

CHANGELOG

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/gerencianet/gn-api-sdk-ruby. This project is intended to be a safe, welcoming space for collaboration.

License

The gem is available as open source under the terms of the MIT License.