No release in over 3 years
Low commit activity in last 3 years
BoletoSimples strategy for OmniAuth
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0

Runtime

 Project Readme

OmniAuth BoletoSimples

Gem Version

This gem contains the Log In With Boleto Simples strategy for OmniAuth.

Installing

Add to your Gemfile:

gem "omniauth-boletosimples"

Then:

$ bundle install

Usage

Here's a quick example, adding the middleware to a Rails app in config/initializers/omniauth.rb.

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :boletosimples, ENV['APP_ID'], ENV['APP_SECRET'], environment: :sandbox, scope: "profile email write", user_agent: 'Your App (yourapp@example.com)'
end

It is important to set user_agent with a valid email address inside, otherwise the integration will not work.

Attributes and Scopes

The possible attributes to be returned at the moment are:

info['person_type']
info['first_name']
info['middle_name']
info['last_name']
info['full_name']
info['date_of_birth']
info['email']
info['cpf']

extra['address_street_name']
extra['address_number']
extra['address_complement']
extra['address_state']
extra['address_city_name']
extra['address_neighborhood']
extra['address_postal_code']
extra['phone_number']
extra['banking_bank_number']
extra['banking_agency_number']
extra['banking_agency_digit']
extra['banking_account_number']
extra['banking_account_digit']
extra['banking_person_type']
extra['banking_person_name']
extra['banking_cnpj_cpf']
extra['business_name']
extra['business_cnpj']

The actual set of attributes returned depends on the scopes set. The currently available scopes are:

login (Autenticar com seu usuário)
email (Visualizar ao seu endereço de e-mail)
profile (Visualizar dados da sua conta)
address (Visualizar seu endereço)
phone (Visualizar seu telefone)
banking (Visualizar seus dados bancários)
business (Visualizar seus dados da empresa)
write (Criar e visualizar boletos bancários e clientes)
read (Visualizar boletos bancários, clientes e extrato de transações)
webhook (Receber notificações a cada mudança de status dos boletos)

Registering for an API key

To register your application for Log In With Boleto Simples open a ticket asking for credentials to your app.

Example of result auth hash

With all scopes requested.

provider: boletosimples
uid: 1
info:
  person_type: 'individual'
  first_name: 'Henry Renato'
  middle_name: 'Leonardo'
  last_name: 'Barros'
  full_name: 'Henry Renato Leonardo Barros'
  date_of_birth: '1987-04-01'
  email: 'henry@example.com'
  cpf: '139.586.432-21'
  mother_name: 'Maria Leonardo Barros'
  father_name: 'José Leonardo Barros'
  sex: 'male'
credentials:
  token: <token>
  refresh_token: <refresh token>
  expires_at: 1355082790
  expires: true
extra:
  address_street_name: 'Rua AS 3'
  address_number: '349'
  address_complement: 'apto 101'
  address_state: 'GO'
  address_city_name: 'Rio Verde'
  address_neighborhood: 'Residencial Água Santa'
  address_postal_code: '75909-517'
  phone_number: '6336151015'
  banking_bank_number: '237'
  banking_agency_number: '3290'
  banking_agency_digit: '1'
  banking_account_number: '1028'
  banking_account_digit: '9'
  banking_person_type: 'individual'
  banking_person_name: 'Henry Renato Leonardo Barros'
  banking_cnpj_cpf: '139.586.432-21'
  business_name: 'Boleto Simples'
  business_legal_name: 'Boleto Simples Cobranças Ltda'
  business_cnpj: '05.813.794/0001-26'
  send_email_on_creation: true

Issues

If you have problems, please create a Github Issue.

Sample Code

Check our Sample Code

Contributing

Please see CONTRIBUTING.md for details.

Credits

OmniAuth BoletoSimples was originally written by Rafael Lima based on omniauth-paypal Thank you to all the contributors.

License

OmniAuth BoletoSimples is Copyright © 2014 Rafael Lima. It is free software, and may be redistributed under the terms specified in the LICENSE file.