GithubHelp home page GithubHelp logo

neon_api's Introduction

Gem Version

NeonApi

Gem used to integrate any rails system to Bank NeonApi

Installation

Add this line to your application's Gemfile:

gem 'neon_api'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install neon_api

Usage

Initialize the system on its own initializer file:

config/initializer/neon_api.rb

NeonApi.configure do |config|
  config.token = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
  config.username = '[email protected]'
  config.password = 'password'
  config.proxy        = 'http://dasd:[email protected]:80'      # neon needs a fixed outbound ip
  config.encrypt_pem  = 'public_encrypt.pem'                  # path to your encryption pem 
  config.decrypt_pem  = 'public_decrypt.pem'                  # path to your decryption pem
  config.environment  = :development                          # environment :development of :production
end

PS: YOU WILL NEED TO CHANGE YOUR KEYS FROM XML TO PEM!!! THIS IS IMPORTANT! you can use this(https://superdry.apphb.com/tools/online-rsa-key-converter) for this purpose.

Use the bank methods in order to create or manage your transactions:

Get Balance:

NeonApi::Balance.get_balance

Create Payer:

NeonApi::CreatePayer.create(bank_acc_id, name, cpf, email, address, number, complement, zipcode, city, state, country)

CancelPayment:

NeonApi::CancelPayment.create(list_uniq_id)

ConfirmPayment

NeonApi::ConfirmPayment.create(list_uniq_id)

Generate Payment Slip

GeneratePaymentSlipToPayer.create(bank_acc_id, name, cpf, email, address, number, complement, zipcode, city, state, country)

More methods (and their arguments) can be found on methods folder

Development

I made this for myself, in a hurry. It works but it's not tested or well documented. Sorry for that.

Contributing

BUUUUUT... You can help!!!! Help me to test and document it. It's good for everybody. (please rspec)

Bug reports and pull requests are welcome on GitHub at https://github.com/Hamdan85/neon_api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

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

Code of Conduct

Everyone interacting in the NeonApi project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

neon_api's People

Contributors

brunobrgs avatar guivinicius avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.