Gem

NubankSdk (Work in progress)

A gem to make it ease to monitorize your Nubank account.

Installation

Add this line to your application's Gemfile:

gem 'nubank_sdk'

And then execute:

$ bundle

Or install it yourself as:

$ gem install nubank_sdk

Usage

require 'nubank_sdk'

# instance a nubank account object
user = NubankSdk::User.new(cpf: '12345678909')
password = 'dracarys'

First time?

authenticate the account

# request an email code
 = user.auth.request_email_code(password)

# get the email code from the user
puts "Enter the code sent to #{}: "
email_code = gets.chomp
user.auth.exchange_certs(email_code, password)

Has a certificate?

generate a access token

user.auth.authenticate_with_certificate(password)

get the account balance

user..balance # => 77.0

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/viserion77/nubank_sdk.

This project was based on the python implementation in this project: andreroggeri/pynubank