stone-ruby 0.1.1 → 0.1.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: 08a621b7e5a2259c82f74df5ae651622c1fc5b7c
4
- data.tar.gz: cfda1d992d552490810e6ca5b97dee98571c2e21
3
+ metadata.gz: fa4239b1a9150233659eb19e8f2522a4d5865c92
4
+ data.tar.gz: bfa6765e6f3860ba658b40f519871ae0441c3307
5
5
  SHA512:
6
- metadata.gz: 97ab80a3efc10940677dd52de89d845cfe4fa16eeba66b871657fccd0b53d038c2b2cf70fb0f9b8eda07ba03ad6b9d4c2e52511f9471fbf1cbebd969bb85ca08
7
- data.tar.gz: 6c48b8a877490d68691ad34f98edff8fdfab98019643cd4f91cfc7c4d566a292218c581a2355bebb9fb441f96c77a345dc142bae37ac80c37fd483ba10fa3d69
6
+ metadata.gz: 35df5e5d5d6b712e419b9be8ee9f3fb6f70bda6ba314ac0b6ccbf7a270753c7eff427a11454fa26a2ee5e893738db32184dc3de5c36319215edff185d8f95c4a
7
+ data.tar.gz: b45beafc527e6e076fc0b8627c941b1afcaf824551bef10056eb3c519d7412c36ae2f4a25155e16dbe21c9fc684732fdd2c8762c4828594a8e42e18bfdeb9cc4
data/.idea/misc.xml CHANGED
@@ -4,4 +4,9 @@
4
4
  <option name="languageLevel" value="ES6" />
5
5
  </component>
6
6
  <component name="ProjectRootManager" version="2" project-jdk-name="asdf: 2.3.1" project-jdk-type="RUBY_SDK" />
7
+ <component name="SwUserDefinedSpecifications">
8
+ <option name="specTypeByUrl">
9
+ <map />
10
+ </option>
11
+ </component>
7
12
  </project>
@@ -11,13 +11,69 @@
11
11
  </content>
12
12
  <orderEntry type="inheritedJdk" />
13
13
  <orderEntry type="sourceFolder" forTests="false" />
14
+ <orderEntry type="library" scope="PROVIDED" name="activesupport (v4.2.11.3, asdf: 2.3.1) [gem]" level="application" />
15
+ <orderEntry type="library" scope="PROVIDED" name="ast (v2.4.2, asdf: 2.3.1) [gem]" level="application" />
14
16
  <orderEntry type="library" scope="PROVIDED" name="bundler (v1.17.3, asdf: 2.3.1) [gem]" level="application" />
15
- <orderEntry type="library" scope="PROVIDED" name="concurrent-ruby (v1.1.6, asdf: 2.3.1) [gem]" level="application" />
17
+ <orderEntry type="library" scope="PROVIDED" name="concurrent-ruby (v1.1.8, asdf: 2.3.1) [gem]" level="application" />
18
+ <orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.3, asdf: 2.3.1) [gem]" level="application" />
16
19
  <orderEntry type="library" scope="PROVIDED" name="dry-configurable (v0.8.3, asdf: 2.3.1) [gem]" level="application" />
20
+ <orderEntry type="library" scope="PROVIDED" name="dry-container (v0.7.2, asdf: 2.3.1) [gem]" level="application" />
17
21
  <orderEntry type="library" scope="PROVIDED" name="dry-core (v0.4.9, asdf: 2.3.1) [gem]" level="application" />
22
+ <orderEntry type="library" scope="PROVIDED" name="dry-equalizer (v0.2.2, asdf: 2.3.1) [gem]" level="application" />
23
+ <orderEntry type="library" scope="PROVIDED" name="dry-inflector (v0.1.2, asdf: 2.3.1) [gem]" level="application" />
24
+ <orderEntry type="library" scope="PROVIDED" name="dry-logic (v0.6.1, asdf: 2.3.1) [gem]" level="application" />
25
+ <orderEntry type="library" scope="PROVIDED" name="dry-struct (v0.7.0, asdf: 2.3.1) [gem]" level="application" />
26
+ <orderEntry type="library" scope="PROVIDED" name="dry-types (v0.15.0, asdf: 2.3.1) [gem]" level="application" />
18
27
  <orderEntry type="library" scope="PROVIDED" name="ethon (v0.12.0, asdf: 2.3.1) [gem]" level="application" />
28
+ <orderEntry type="library" scope="PROVIDED" name="ffi (v1.15.0, asdf: 2.3.1) [gem]" level="application" />
29
+ <orderEntry type="library" scope="PROVIDED" name="i18n (v0.9.5, asdf: 2.3.1) [gem]" level="application" />
30
+ <orderEntry type="library" scope="PROVIDED" name="ice_nine (v0.11.2, asdf: 2.3.1) [gem]" level="application" />
31
+ <orderEntry type="library" scope="PROVIDED" name="jaro_winkler (v1.5.4, asdf: 2.3.1) [gem]" level="application" />
32
+ <orderEntry type="library" scope="PROVIDED" name="minitest (v5.14.1, asdf: 2.3.1) [gem]" level="application" />
33
+ <orderEntry type="library" scope="PROVIDED" name="parallel (v1.19.1, asdf: 2.3.1) [gem]" level="application" />
34
+ <orderEntry type="library" scope="PROVIDED" name="parser (v3.0.0.0, asdf: 2.3.1) [gem]" level="application" />
35
+ <orderEntry type="library" scope="PROVIDED" name="rainbow (v2.2.2, asdf: 2.3.1) [gem]" level="application" />
19
36
  <orderEntry type="library" scope="PROVIDED" name="rake (v10.5.0, asdf: 2.3.1) [gem]" level="application" />
20
- <orderEntry type="library" scope="PROVIDED" name="rspec (v3.3.0, asdf: 2.3.1) [gem]" level="application" />
37
+ <orderEntry type="library" scope="PROVIDED" name="request_store_rails (v2.0.0, asdf: 2.3.1) [gem]" level="application" />
38
+ <orderEntry type="library" scope="PROVIDED" name="rexml (v3.2.4, asdf: 2.3.1) [gem]" level="application" />
39
+ <orderEntry type="library" scope="PROVIDED" name="rspec (v3.9.0, asdf: 2.3.1) [gem]" level="application" />
40
+ <orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.9.2, asdf: 2.3.1) [gem]" level="application" />
41
+ <orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.9.2, asdf: 2.3.1) [gem]" level="application" />
42
+ <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.9.1, asdf: 2.3.1) [gem]" level="application" />
43
+ <orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.9.3, asdf: 2.3.1) [gem]" level="application" />
44
+ <orderEntry type="library" scope="PROVIDED" name="rubocop (v0.80.1, asdf: 2.3.1) [gem]" level="application" />
45
+ <orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.10.1, asdf: 2.3.1) [gem]" level="application" />
46
+ <orderEntry type="library" scope="PROVIDED" name="thread_safe (v0.3.6, asdf: 2.3.1) [gem]" level="application" />
21
47
  <orderEntry type="library" scope="PROVIDED" name="typhoeus (v1.0.2, asdf: 2.3.1) [gem]" level="application" />
48
+ <orderEntry type="library" scope="PROVIDED" name="tzinfo (v1.2.7, asdf: 2.3.1) [gem]" level="application" />
49
+ <orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v1.6.1, asdf: 2.3.1) [gem]" level="application" />
50
+ </component>
51
+ <component name="RakeTasksCache">
52
+ <option name="myRootTask">
53
+ <RakeTaskImpl id="rake">
54
+ <subtasks>
55
+ <RakeTaskImpl description="Build stone-ruby-0.1.1.gem into the pkg directory" fullCommand="build" id="build" />
56
+ <RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
57
+ <RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
58
+ <RakeTaskImpl description="Build and install stone-ruby-0.1.1.gem into system gems" fullCommand="install" id="install" />
59
+ <RakeTaskImpl id="install">
60
+ <subtasks>
61
+ <RakeTaskImpl description="Build and install stone-ruby-0.1.1.gem into system gems without network access" fullCommand="install:local" id="local" />
62
+ </subtasks>
63
+ </RakeTaskImpl>
64
+ <RakeTaskImpl description="Create tag v0.1.1 and build and push stone-ruby-0.1.1.gem to rubygems.org" fullCommand="release[remote]" id="release[remote]" />
65
+ <RakeTaskImpl description="Run RSpec code examples" fullCommand="spec" id="spec" />
66
+ <RakeTaskImpl description="" fullCommand="default" id="default" />
67
+ <RakeTaskImpl description="" fullCommand="release" id="release" />
68
+ <RakeTaskImpl id="release">
69
+ <subtasks>
70
+ <RakeTaskImpl description="" fullCommand="release:guard_clean" id="guard_clean" />
71
+ <RakeTaskImpl description="" fullCommand="release:rubygem_push" id="rubygem_push" />
72
+ <RakeTaskImpl description="" fullCommand="release:source_control_push" id="source_control_push" />
73
+ </subtasks>
74
+ </RakeTaskImpl>
75
+ </subtasks>
76
+ </RakeTaskImpl>
77
+ </option>
22
78
  </component>
23
79
  </module>
data/Gemfile.lock CHANGED
@@ -1,11 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stone-ruby (0.1.0)
4
+ stone-ruby (0.1.2)
5
5
  activesupport (~> 4.2)
6
6
  dry-configurable (~> 0.8.3)
7
7
  dry-struct (~> 0.7)
8
- request_store_rails (~> 2.0.0)
9
8
  typhoeus (~> 1.0.2)
10
9
 
11
10
  GEM
@@ -17,7 +16,7 @@ GEM
17
16
  thread_safe (~> 0.3, >= 0.3.4)
18
17
  tzinfo (~> 1.1)
19
18
  ast (2.4.2)
20
- concurrent-ruby (1.1.8)
19
+ concurrent-ruby (1.1.10)
21
20
  diff-lcs (1.3)
22
21
  dry-configurable (0.8.3)
23
22
  concurrent-ruby (~> 1.0)
@@ -45,22 +44,20 @@ GEM
45
44
  dry-equalizer (~> 0.2, >= 0.2.2)
46
45
  dry-inflector (~> 0.1, >= 0.1.2)
47
46
  dry-logic (~> 0.5, >= 0.5)
48
- ethon (0.12.0)
49
- ffi (>= 1.3.0)
50
- ffi (1.15.0)
47
+ ethon (0.15.0)
48
+ ffi (>= 1.15.0)
49
+ ffi (1.15.5)
51
50
  i18n (0.9.5)
52
51
  concurrent-ruby (~> 1.0)
53
52
  ice_nine (0.11.2)
54
53
  jaro_winkler (1.5.4)
55
- minitest (5.14.1)
54
+ minitest (5.15.0)
56
55
  parallel (1.19.1)
57
56
  parser (3.0.0.0)
58
57
  ast (~> 2.4.1)
59
58
  rainbow (2.2.2)
60
59
  rake
61
60
  rake (10.5.0)
62
- request_store_rails (2.0.0)
63
- concurrent-ruby (~> 1.0)
64
61
  rexml (3.2.4)
65
62
  rspec (3.9.0)
66
63
  rspec-core (~> 3.9.0)
@@ -87,7 +84,7 @@ GEM
87
84
  thread_safe (0.3.6)
88
85
  typhoeus (1.0.2)
89
86
  ethon (>= 0.9.0)
90
- tzinfo (1.2.7)
87
+ tzinfo (1.2.9)
91
88
  thread_safe (~> 0.1)
92
89
  unicode-display_width (1.6.1)
93
90
 
File without changes
@@ -10,7 +10,7 @@ module Stone
10
10
  attribute :document_number, Types::Coercible::String
11
11
  attribute :stone_code, Types::Coercible::String
12
12
  attribute :cards_rate, Types::Coercible::Array.of(CardRate).optional.default(nil)
13
- attribute :address, Address
13
+ attribute :address, Address.optional.default(nil)
14
14
  end
15
15
  end
16
16
  end
data/lib/stone/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stone
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
data/lib/stone.rb CHANGED
@@ -24,8 +24,8 @@ module Stone
24
24
 
25
25
  setting :conciliation do
26
26
  setting :app_key, ENV.fetch('STONE_CONCILIATION_APP_KEY', nil)
27
- setting :app_secret, ENV.fetch('STONE_CONCILIATION_APP_SECRET', nil)
28
- setting :auth_endpoint, ENV.fetch('STONE_CONCILIATION_AUTH_ENDPOINT', 'https://conciliation.stone.com.br/v1/merchant/{{stone_code}}/access-authorization')
27
+ setting :app_secret, ENV.fetch('STONE_CONCILIATION_APP_SECRET_KEY', nil)
28
+ setting :auth_endpoint, ENV.fetch('STONE_CONCILIATION_AUTH_ENDPOINT', 'https://conciliation.stone.com.br/v1/merchant/{StoneCode}/access-authorization')
29
29
  setting :file_endpoint, ENV.fetch('STONE_CONCILIATION_FILE_ENDPOINT', 'https://conciliation.stone.com.br/conciliation-file/v2.2/{{referenceDate}}')
30
30
  end
31
31
 
data/stone-ruby.gemspec CHANGED
@@ -39,7 +39,6 @@ Gem::Specification.new do |spec|
39
39
 
40
40
  spec.add_dependency 'dry-configurable', '~> 0.8.3'
41
41
  spec.add_dependency 'dry-struct', '~> 0.7'
42
- spec.add_dependency 'request_store_rails', '~> 2.0.0'
43
42
  spec.add_dependency 'typhoeus', '~> 1.0.2'
44
43
  spec.add_dependency 'activesupport', '~> 4.2'
45
44
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stone-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcos Junior
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-04-12 00:00:00.000000000 Z
11
+ date: 2022-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.7'
41
- - !ruby/object:Gem::Dependency
42
- name: request_store_rails
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: 2.0.0
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: 2.0.0
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: typhoeus
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -167,9 +153,9 @@ files:
167
153
  - lib/stone-ruby.rb
168
154
  - lib/stone.rb
169
155
  - lib/stone/conciliation.rb
170
- - lib/stone/conciliation/client.rb
171
156
  - lib/stone/conciliation/client/access_authorization.rb
172
157
  - lib/stone/conciliation/error.rb
158
+ - lib/stone/conciliation/util/signature.rb
173
159
  - lib/stone/siclos.rb
174
160
  - lib/stone/siclos/client.rb
175
161
  - lib/stone/siclos/client/claim_check.rb
@@ -1,58 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Stone::Siclos
4
- module Client
5
- class Response
6
- def initialize(code, data)
7
- @code = code
8
- ap data
9
- @data = JSON.parse(data, symbolize_names: true)
10
- raise_exception unless @data[:success]
11
- end
12
- attr_reader :data
13
- attr_reader :code
14
-
15
- def success?
16
- @data[:success]
17
- end
18
-
19
- private
20
-
21
- def raise_exception
22
- return unless Stone.config.siclos.use_exception
23
-
24
- raise Stone::Siclos::Error, "#{@data[:error]} - #{@data[:msg]}"
25
- end
26
- end
27
-
28
- class Base
29
- def initialize
30
- @token = Stone.config.siclos.api_key
31
- end
32
-
33
- def parse_endpoint(path)
34
- path = path[1..-1] if path.starts_with?('/')
35
- endpoint = Stone.config.siclos.api_endpoint
36
- endpoint = "#{endpoint}/" unless endpoint.end_with?('/')
37
- URI.join(endpoint, path)
38
- end
39
-
40
- def request(method, path, data = nil, params = nil)
41
- response = Typhoeus::Request.new(
42
- parse_endpoint(path),
43
- method: method,
44
- body: data ? data.to_json : nil,
45
- params: params,
46
- headers: {
47
- 'Content-Type': 'application/json',
48
- Authorization: "Bearer #{@token}"
49
- }
50
- ).run
51
- Response.new(response.response_code, response.response_body)
52
- end
53
- end
54
-
55
- class << self
56
- end
57
- end
58
- end