-
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Jeferson Alves edited this page Dec 4, 2022
·
3 revisions
Add this line to your application's Gemfile:
gem 'nubank_sdk'
And then execute:
$ bundle
Or install it yourself as:
$ gem install nubank_sdk
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 account_email = user.auth.request_email_code(password) # get the email code from the user puts "Enter the code sent to #{account_email}: " 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.account.balance # => 77.0