Project

neon_api

0.01
No commit activity in last 3 years
No release in over 3 years
Gem to integrate with Bank Neon's API and its encrypted authentication process
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.15
~> 2.0
~> 10.0
~> 3.0

Runtime

~> 0.5.0
 Project Readme

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 = 'user@name.com'
  config.password = 'password'
  config.proxy        = 'http://dasd:asd@asd.asd.com: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 or :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.