omniauth-boletosimples 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 45d2277bc4a073c872f68f6c851c538c79e39b18
4
- data.tar.gz: 624725b1d81e5ff094bcff8873b4ec65ca9ed8af
3
+ metadata.gz: df37c6d4503c0dd8589559b01925038be6421954
4
+ data.tar.gz: 29d78fc065d2735f285ca2b7f27d24e13841ec07
5
5
  SHA512:
6
- metadata.gz: e86c24ea989775858915598e23ea3f0799c4eb1365f488742043de87b175a405cb4ed7ce9a32f7a2a07c2861a057024a786a7a999fd1df1afe61d01eb79ee49c
7
- data.tar.gz: 946bd51e5631547c896544613cbaffaf2bedd27bbd410ce1d03e076b7352557c060171e1d7474f33cc257aa9fda976834a0cce58a1bba9d1bea4bcbc1eb8b4b8
6
+ metadata.gz: d2b4ce55a0d36183cba35aa694a29234bd5a39b675eef0562dc3c3d24c7a10ff6072d44b7c5fd2d90c0d35218b95bd33bb9264ab94f3491e830fe6a1367fa0cb
7
+ data.tar.gz: e973c4f5a6ab18fd91cd46d06dc7a2d8c3e93527062a68be9be61d53320dec2ce66cffe194d80c3c999a6176b814e2c9b7bd370de86d9f072922c4a7c34a9dd9
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.1.1
1
+ 2.1.2
data/Gemfile CHANGED
@@ -2,5 +2,4 @@ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'omniauth-oauth2', "~>1.1.1", :git => 'git://github.com/intridea/omniauth-oauth2.git'
6
5
  gem 'json'
data/Gemfile.lock CHANGED
@@ -1,18 +1,8 @@
1
- GIT
2
- remote: git://github.com/intridea/omniauth-oauth2.git
3
- revision: a022bc00f5cc08c69043317673f9b8d0542ba15c
4
- specs:
5
- omniauth-oauth2 (1.1.2)
6
- faraday (>= 0.8, < 0.10)
7
- multi_json (~> 1.3)
8
- oauth2 (~> 0.9.3)
9
- omniauth (~> 1.2)
10
-
11
1
  PATH
12
2
  remote: .
13
3
  specs:
14
- omniauth-boletosimples (0.0.5)
15
- omniauth-oauth2 (~> 1.1.2)
4
+ omniauth-boletosimples (0.0.6)
5
+ omniauth-oauth2 (~> 1.2.0)
16
6
 
17
7
  GEM
18
8
  remote: https://rubygems.org/
@@ -20,32 +10,40 @@ GEM
20
10
  diff-lcs (1.2.5)
21
11
  faraday (0.9.0)
22
12
  multipart-post (>= 1.2, < 3)
23
- hashie (2.1.0)
13
+ hashie (3.2.0)
24
14
  json (1.8.1)
25
- jwt (0.1.11)
26
- multi_json (>= 1.5)
27
- multi_json (1.9.2)
15
+ jwt (1.0.0)
16
+ multi_json (1.10.1)
28
17
  multi_xml (0.5.5)
29
18
  multipart-post (2.0.0)
30
- oauth2 (0.9.3)
19
+ oauth2 (1.0.0)
31
20
  faraday (>= 0.8, < 0.10)
32
- jwt (~> 0.1.8)
21
+ jwt (~> 1.0)
33
22
  multi_json (~> 1.3)
34
23
  multi_xml (~> 0.5)
35
24
  rack (~> 1.2)
36
- omniauth (1.2.1)
37
- hashie (>= 1.2, < 3)
25
+ omniauth (1.2.2)
26
+ hashie (>= 1.2, < 4)
38
27
  rack (~> 1.0)
28
+ omniauth-oauth2 (1.2.0)
29
+ faraday (>= 0.8, < 0.10)
30
+ multi_json (~> 1.3)
31
+ oauth2 (~> 1.0)
32
+ omniauth (~> 1.2)
39
33
  rack (1.5.2)
40
34
  rake (10.2.2)
41
- rspec (2.14.1)
42
- rspec-core (~> 2.14.0)
43
- rspec-expectations (~> 2.14.0)
44
- rspec-mocks (~> 2.14.0)
45
- rspec-core (2.14.8)
46
- rspec-expectations (2.14.5)
47
- diff-lcs (>= 1.1.3, < 2.0)
48
- rspec-mocks (2.14.6)
35
+ rspec (3.0.0)
36
+ rspec-core (~> 3.0.0)
37
+ rspec-expectations (~> 3.0.0)
38
+ rspec-mocks (~> 3.0.0)
39
+ rspec-core (3.0.2)
40
+ rspec-support (~> 3.0.0)
41
+ rspec-expectations (3.0.2)
42
+ diff-lcs (>= 1.2.0, < 2.0)
43
+ rspec-support (~> 3.0.0)
44
+ rspec-mocks (3.0.2)
45
+ rspec-support (~> 3.0.0)
46
+ rspec-support (3.0.2)
49
47
 
50
48
  PLATFORMS
51
49
  ruby
@@ -53,6 +51,5 @@ PLATFORMS
53
51
  DEPENDENCIES
54
52
  json
55
53
  omniauth-boletosimples!
56
- omniauth-oauth2 (~> 1.1.1)!
57
54
  rake
58
- rspec (~> 2.14)
55
+ rspec (~> 3.0.0)
data/README.md CHANGED
@@ -14,7 +14,7 @@ gem "omniauth-boletosimples"
14
14
 
15
15
  Then:
16
16
 
17
- $ bundle install
17
+ $ bundle install
18
18
 
19
19
  ## Usage
20
20
 
@@ -22,7 +22,7 @@ Here's a quick example, adding the middleware to a Rails app in `config/initiali
22
22
 
23
23
  ```ruby
24
24
  Rails.application.config.middleware.use OmniAuth::Builder do
25
- provider :boletosimples, ENV['APP_ID'], ENV['APP_TOKEN'], environment: :sandbox, scope: "profile email", user_agent: 'Your App (yourapp@example.com)'
25
+ provider :boletosimples, ENV['APP_ID'], ENV['APP_SECRET'], environment: :sandbox, scope: "profile email write", user_agent: 'Your App (yourapp@example.com)'
26
26
  end
27
27
  ```
28
28
 
@@ -66,16 +66,16 @@ extra['business_cnpj']
66
66
  The actual set of attributes returned depends on the scopes set. The currently available scopes are:
67
67
 
68
68
  ```
69
- login
70
- profile
71
- email
72
- phone
73
- address
74
- banking
75
- business
76
- write
77
- read
78
- webhook
69
+ login (Autenticar com seu usuário)
70
+ email (Visualizar ao seu endereço de e-mail)
71
+ profile (Visualizar dados da sua conta)
72
+ address (Visualizar seu endereço)
73
+ phone (Visualizar seu telefone)
74
+ banking (Visualizar seus dados bancários)
75
+ business (Visualizar seus dados da empresa)
76
+ write (Criar e visualizar boletos bancários e clientes)
77
+ read (Visualizar boletos bancários, clientes e extrato de transações)
78
+ webhook (Receber notificações a cada mudança de status dos boletos)
79
79
  ```
80
80
 
81
81
  ## Registering for an API key
@@ -97,6 +97,9 @@ info:
97
97
  date_of_birth: '1987-04-01'
98
98
  email: 'henry@example.com'
99
99
  cpf: '139.586.432-21'
100
+ mother_name: 'Maria Leonardo Barros'
101
+ father_name: 'José Leonardo Barros'
102
+ sex: 'male'
100
103
  credentials:
101
104
  token: <token>
102
105
  refresh_token: <refresh token>
@@ -119,10 +122,11 @@ extra:
119
122
  banking_person_type: 'individual'
120
123
  banking_person_name: 'Henry Renato Leonardo Barros'
121
124
  banking_cnpj_cpf: '139.586.432-21'
122
- business_name: 'Boleto Simples Cobranças Ltda'
125
+ business_name: 'Boleto Simples'
126
+ business_legal_name: 'Boleto Simples Cobranças Ltda'
123
127
  business_cnpj: '05.813.794/0001-26'
128
+ send_email_on_creation: true
124
129
  ```
125
-
126
130
  ## Issues
127
131
 
128
132
  If you have problems, please create a [Github Issue](https://github.com/BoletoSimples/omniauth-boletosimples/issues).
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module BoletoSimples
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
@@ -24,13 +24,16 @@ module OmniAuth
24
24
  info do
25
25
  {
26
26
  person_type: raw_info['person_type'],
27
- first_name: raw_info[':first_name'],
28
- middle_name: raw_info[':middle_name'],
29
- last_name: raw_info[':last_name'],
30
- full_name: raw_info[':full_name'],
31
- date_of_birth: raw_info[':date_of_birth'],
27
+ first_name: raw_info['first_name'],
28
+ middle_name: raw_info['middle_name'],
29
+ last_name: raw_info['last_name'],
30
+ full_name: raw_info['full_name'],
31
+ date_of_birth: raw_info['date_of_birth'],
32
32
  email: raw_info['email'],
33
- cpf: raw_info['cpf']
33
+ cpf: raw_info['cpf'],
34
+ mother_name: raw_info['mother_name'],
35
+ father_name: raw_info['father_name'],
36
+ sex: raw_info['sex'],
34
37
  }
35
38
  end
36
39
 
@@ -52,8 +55,10 @@ module OmniAuth
52
55
  banking_person_type: raw_info['banking_person_type'],
53
56
  banking_person_name: raw_info['banking_person_name'],
54
57
  banking_cnpj_cpf: raw_info['banking_cnpj_cpf'],
58
+ business_legal_name: raw_info['business_legal_name'],
55
59
  business_name: raw_info['business_name'],
56
- business_cnpj: raw_info['business_cnpj']
60
+ business_cnpj: raw_info['business_cnpj'],
61
+ send_email_on_creation: raw_info['send_email_on_creation']
57
62
  }
58
63
  end
59
64
 
@@ -89,4 +94,4 @@ module OmniAuth
89
94
  end
90
95
  end
91
96
 
92
- OmniAuth.config.add_camelization 'boletosimples', 'BoletoSimples'
97
+ OmniAuth.config.add_camelization 'boletosimples', 'BoletoSimples'
@@ -16,8 +16,8 @@ Gem::Specification.new do |s|
16
16
  s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
17
17
  s.require_paths = ['lib']
18
18
 
19
- s.add_runtime_dependency 'omniauth-oauth2', '~> 1.1.2'
19
+ s.add_runtime_dependency 'omniauth-oauth2', '~> 1.2.0'
20
20
 
21
- s.add_development_dependency 'rspec', '~> 2.14'
21
+ s.add_development_dependency 'rspec', '~> 3.0.0'
22
22
  s.add_development_dependency 'rake'
23
23
  end
@@ -11,41 +11,41 @@ describe OmniAuth::Strategies::BoletoSimples do
11
11
  describe '#client' do
12
12
  it 'has correct BoletoSimples site' do
13
13
  subject.setup_phase
14
- subject.client.site.should eq('https://boletosimples.com.br')
14
+ expect(subject.client.site).to eq('https://boletosimples.com.br')
15
15
  end
16
16
 
17
17
  it 'has correct BoletoSimples sandbox site' do
18
18
  @options = { :environment => :sandbox }
19
19
  subject.setup_phase
20
- subject.client.site.should eq('https://sandbox.boletosimples.com.br')
20
+ expect(subject.client.site).to eq('https://sandbox.boletosimples.com.br')
21
21
  end
22
22
 
23
23
  it 'has correct authorize url' do
24
24
  subject.setup_phase
25
- subject.client.options[:authorize_url].should eq('https://boletosimples.com.br/api/v1/oauth2/authorize')
25
+ expect(subject.client.options[:authorize_url]).to eq('https://boletosimples.com.br/api/v1/oauth2/authorize')
26
26
  end
27
27
 
28
28
  it 'has correct sandbox authorize url' do
29
29
  @options = { :environment => :sandbox }
30
30
  subject.setup_phase
31
- subject.client.options[:authorize_url].should eq('https://sandbox.boletosimples.com.br/api/v1/oauth2/authorize')
31
+ expect(subject.client.options[:authorize_url]).to eq('https://sandbox.boletosimples.com.br/api/v1/oauth2/authorize')
32
32
  end
33
33
 
34
34
  it 'has correct token url' do
35
- subject.client.options[:token_url].should eq('/api/v1/oauth2/token')
35
+ expect(subject.client.options[:token_url]).to eq('/api/v1/oauth2/token')
36
36
  end
37
37
 
38
38
  it 'has correct connection_opts' do
39
39
  @options = { :user_agent => 'email@example.com' }
40
40
  subject.setup_phase
41
- subject.client.options[:connection_opts].should eq({:headers=>{:"User-Agent"=>"email@example.com"}})
41
+ expect(subject.client.options[:connection_opts]).to eq({:headers=>{:"User-Agent"=>"email@example.com"}})
42
42
  end
43
43
 
44
44
  end
45
45
 
46
46
  describe '#callback_path' do
47
47
  it "has the correct callback path" do
48
- subject.callback_path.should eq('/auth/boletosimples/callback')
48
+ expect(subject.callback_path).to eq('/auth/boletosimples/callback')
49
49
  end
50
50
  end
51
51
 
@@ -3,35 +3,35 @@ shared_examples 'an oauth2 strategy' do
3
3
  describe '#client' do
4
4
  it 'should be initialized with symbolized client_options' do
5
5
  @options = { :client_options => { 'authorize_url' => 'https://example.com' } }
6
- subject.client.options[:authorize_url].should == 'https://example.com'
6
+ expect(subject.client.options[:authorize_url]).to eq('https://example.com')
7
7
  end
8
8
  end
9
9
 
10
10
  describe '#authorize_params' do
11
11
  it 'should include any authorize params passed in the :authorize_params option' do
12
12
  @options = { :authorize_params => { :foo => 'bar', :baz => 'zip' } }
13
- subject.authorize_params['foo'].should eq('bar')
14
- subject.authorize_params['baz'].should eq('zip')
13
+ expect(subject.authorize_params['foo']).to eq('bar')
14
+ expect(subject.authorize_params['baz']).to eq('zip')
15
15
  end
16
16
 
17
17
  it 'should include top-level options that are marked as :authorize_options' do
18
18
  @options = { :authorize_options => [:scope, :foo], :scope => 'bar', :foo => 'baz' }
19
- subject.authorize_params['scope'].should eq('bar')
20
- subject.authorize_params['foo'].should eq('baz')
19
+ expect(subject.authorize_params['scope']).to eq('bar')
20
+ expect(subject.authorize_params['foo']).to eq('baz')
21
21
  end
22
22
  end
23
23
 
24
24
  describe '#token_params' do
25
25
  it 'should include any token params passed in the :token_params option' do
26
26
  @options = { :token_params => { :foo => 'bar', :baz => 'zip' } }
27
- subject.token_params['foo'].should eq('bar')
28
- subject.token_params['baz'].should eq('zip')
27
+ expect(subject.token_params['foo']).to eq('bar')
28
+ expect(subject.token_params['baz']).to eq('zip')
29
29
  end
30
30
 
31
31
  it 'should include top-level options that are marked as :token_options' do
32
32
  @options = { :token_options => [:scope, :foo], :scope => 'bar', :foo => 'baz' }
33
- subject.token_params['scope'].should eq('bar')
34
- subject.token_params['foo'].should eq('baz')
33
+ expect(subject.token_params['scope']).to eq('bar')
34
+ expect(subject.token_params['foo']).to eq('baz')
35
35
  end
36
36
  end
37
37
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-boletosimples
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rafael Lima
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-13 00:00:00.000000000 Z
12
+ date: 2014-07-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth-oauth2
@@ -17,28 +17,28 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 1.1.2
20
+ version: 1.2.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: 1.1.2
27
+ version: 1.2.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rspec
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '2.14'
34
+ version: 3.0.0
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '2.14'
41
+ version: 3.0.0
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rake
44
44
  requirement: !ruby/object:Gem::Requirement