boletosimples 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 97bd8ede5768375b232808e945b760b147961959
4
- data.tar.gz: 96875590bc4ea84c4c0a90860b27939d71c54301
3
+ metadata.gz: 87a25bc0cf4aeb8c63532d6664cd4565427cf12f
4
+ data.tar.gz: fcb04b4a768d980a8d9b0b77560f5bd151cb0142
5
5
  SHA512:
6
- metadata.gz: 8da6e7daf3a4fdd7c297fb321faecc030f40066f7def6c575b12d24776d6da69663c65def3f72c486d0b525dccc866e778f532a283c1832856786bd28967b35a
7
- data.tar.gz: 7f78e9ee55d82a4030ef5107f4018083032f334068dfd741732bf31776cad455f3f7a718d6aad2a6aa3b467982d4a71be8269503d61c33b703e4515ea30dc1b7
6
+ metadata.gz: f9e33c126e1e1fbac9a3c50454192dfbf63915d028f5eca497d0b7bd931163aad347cdc074624308ccae37c3f67a9a8a2b38c0ee8bcdf69842a5e5fb4de63d0f
7
+ data.tar.gz: 2e15cae5d44af832e7543e1505a9a207882348bb61580f77bd002a22ea9dd4fe381dcc1a0569f5fd9cbf55775733b81ed6716d3bea3c17100617b46ebb44e2ff
data/.coveralls.yml ADDED
@@ -0,0 +1,2 @@
1
+ service_name: travis-ci
2
+ repo_token: hSYBAmKtSBLrLODdt13qT0A6sk7uGoO8h
data/.travis.yml CHANGED
@@ -3,6 +3,9 @@ rvm:
3
3
  - '2.1.0'
4
4
  - '2.0.0'
5
5
  - '1.9.3'
6
+ branches:
7
+ only:
8
+ - master
6
9
  addons:
7
10
  code_climate:
8
11
  repo_token: 9c2feef5a1d636d5b08d10561c53f9293783fc175c0cc44d152cdb05a65d1868
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- boletosimples (0.0.1)
4
+ boletosimples (0.0.2)
5
5
  httparty (>= 0.13.1)
6
6
  multi_json (>= 1.10.1)
7
7
  oauth2 (~> 0.9.4)
@@ -52,16 +52,3 @@ client = BoletoSimples::Client.new('seu email', 'sua senha', {user_agent: 'Meu e
52
52
  # notification_url: 'http://example.com.br/notify',
53
53
  # }
54
54
  # })
55
-
56
-
57
- # pp client.partner_create_user(
58
- # {
59
- # user: {
60
- # email: 'email@example.com',
61
- # notification_url: 'http://example.com.br/notify'
62
- # }
63
- # }
64
- # )
65
- #
66
-
67
-
@@ -2,18 +2,57 @@ $: << File.expand_path('../../lib', __FILE__)
2
2
  require 'boletosimples'
3
3
  require 'pp'
4
4
 
5
+ # If you need create users in Boleto Simples
6
+ # you can get a access token with app_id and app_secret
7
+ # def get_access_token
8
+ # response = RestClient.post 'http://sandbox.boletosimples.com.br/api/v1/oauth2/token', {
9
+ # grant_type: 'client_credentials',
10
+ # client_id: 'app_id',
11
+ # client_secret: 'app_secret'
12
+ # }
13
+ #
14
+ # access_app_token = JSON.parse(response)["access_token"]
15
+ # end
16
+
5
17
  credentials = {
6
- :token => 'access token'
18
+ :token => 'access_app_token'
7
19
  }
20
+
8
21
  client_options = {
9
22
  user_agent: 'Meu e-Commerce (meuecommerce@example.com)'
10
23
  }
11
24
 
12
- client = BoletoSimples::OAuthClient.new('api id',
13
- 'api secret',
25
+ client = BoletoSimples::OAuthClient.new('app_id',
26
+ 'app_secret',
14
27
  credentials,
15
28
  client_options)
29
+
30
+ # create user with oauth
31
+ # pp client.partner_create_user(
32
+ # {
33
+ # user: {
34
+ # email: 'new_user@example.com'
35
+ # }
36
+ # }
37
+ # )
38
+
39
+
40
+ # Other operations need access tokens from user oatuh autorization process
41
+ # Use our omniauth-boletosimples (https://github.com/BoletoSimples/omniauth-boletosimples) to archive these tokens
42
+
43
+ credentials = {
44
+ :token => 'access token'
45
+ }
16
46
 
47
+ client_options = {
48
+ user_agent: 'Meu e-Commerce (meuecommerce@example.com)'
49
+ }
50
+
51
+ client = BoletoSimples::OAuthClient.new('app_id',
52
+ 'app_secret',
53
+ credentials,
54
+ client_options)
55
+
17
56
  # pp client.userinfo
18
57
 
19
58
  # pp client.transactions
@@ -62,16 +101,3 @@ client = BoletoSimples::OAuthClient.new('api id',
62
101
  # notification_url: 'http://example.com.br/notify',
63
102
  # }
64
103
  # })
65
-
66
- # pp client.partner_create_user(
67
- # {
68
- # user: {
69
- # email: 'email@example.com',
70
- # notification_url: 'http://example.com.br/notify'
71
- # }
72
- # }
73
- # )
74
-
75
-
76
-
77
-
@@ -15,7 +15,7 @@ module BoletoSimples
15
15
 
16
16
  # defaults
17
17
  @production = options.delete(:production)
18
- @base_uri = (@production ? PRODUCTION_BASE_URI : SANDBOX_BASE_URI)
18
+ @base_uri = options[:base_uri] || (@production ? PRODUCTION_BASE_URI : SANDBOX_BASE_URI)
19
19
  @user_agent = options.delete(:user_agent)
20
20
 
21
21
  options[:format] ||= :json
@@ -1,4 +1,4 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  module BoletoSimples
3
- VERSION = '0.0.1'
3
+ VERSION = '0.0.2'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boletosimples
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kivanio Barbosa
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-06-03 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: pry
@@ -103,6 +103,7 @@ executables: []
103
103
  extensions: []
104
104
  extra_rdoc_files: []
105
105
  files:
106
+ - ".coveralls.yml"
106
107
  - ".gitignore"
107
108
  - ".ruby-gemset"
108
109
  - ".ruby-version"