bs2_api 1.7.0 → 1.8.0

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
  SHA256:
3
- metadata.gz: 7455eef55c86c81150fae145f2e570ce1e88a1c36276b1dfd7e381e7431a3283
4
- data.tar.gz: 17247bbba1a6db2d7c385333ab57be1d61532563ea3a807ff24aa4ef65c80e32
3
+ metadata.gz: 8449060cc6217780e2b9a1e3698d79c998e141d919765b2c9573d5f350594f66
4
+ data.tar.gz: c045fd2971f93c19b18fc764dd6328c1e08d3fe430e7c5505d1afc24ecb7db2d
5
5
  SHA512:
6
- metadata.gz: 5b21aa07c3a5395db419b07e389f0298f00ebb0dab899e628b39f71da73c783f0144305045ef9f07a3271a68b3b34a6100e43166c9c1928f2835f461f521fab8
7
- data.tar.gz: 54a5dcc93e7488d9ad833bb480cdad8def6f99d64063f5aabaf5691ac37e7245b7d60c323096d13c864af46b68bdd3883c7f32171123ddad66f12a531b358e67
6
+ metadata.gz: 6929c953e3ff67fee1d6b118b72f611eee5e23b1172d47afdd209cd121616ab6b5468249e2e71e267830206a2f918b3171163d56ac025f8d119c18134ccd888f
7
+ data.tar.gz: 89fe2992dc08bcf58adfc42f9f4d7ac3ba8c97a344e6f61e35905794a279d695c6cc4d5d5c78e865263b5c92b855e1d8404b4072563e9d2f4f4693d3a0588e50
data/.gitignore CHANGED
@@ -20,3 +20,4 @@
20
20
  *.swp
21
21
  *.swo
22
22
  .byebug_history
23
+ .vscode
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 2.7.2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bs2_api (1.6.0)
4
+ bs2_api (1.7.0)
5
5
  activesupport
6
6
  builder
7
7
  bundler
data/bs2_api.gemspec CHANGED
@@ -40,4 +40,4 @@ Gem::Specification.new do |spec|
40
40
  spec.add_development_dependency("webmock", "~> 3.13")
41
41
  spec.add_development_dependency("vcr", "~> 6.0")
42
42
  spec.add_development_dependency("dotenv", "~> 2.7", ">= 2.7.6")
43
- end
43
+ end
@@ -3,7 +3,7 @@
3
3
  module Bs2Api
4
4
  module Entities
5
5
  class Payment
6
- attr_accessor :payment_id, :end_to_end_id, :receiver, :payer, :status
6
+ attr_accessor :payment_id, :end_to_end_id, :receiver, :payer, :status, :error_message, :error_code
7
7
 
8
8
  def initialize(args = {})
9
9
  @payment_id = args.fetch(:payment_id, nil)
@@ -11,13 +11,17 @@ module Bs2Api
11
11
  @receiver = args.fetch(:receiver, nil)
12
12
  @payer = args.fetch(:payer, nil)
13
13
  @status = args.fetch(:status, nil)
14
+ @error_code = args.fetch(:error_code, nil)
15
+ @error_message = args.fetch(:error_message, nil)
14
16
  end
15
17
 
16
18
  def to_hash
17
19
  hash_data = {
18
- "pagamentoId": @payment_id,
19
- "endToEndId": @end_to_end_id,
20
- "status": @status
20
+ "pagamentoId": @payment_id,
21
+ "endToEndId": @end_to_end_id,
22
+ "status": @status,
23
+ "error_code": @error_code,
24
+ "error_message": @error_message
21
25
  }
22
26
 
23
27
  hash_data.merge!({ "recebedor": @receiver.to_hash } ) if @receiver.present?
@@ -33,7 +37,9 @@ module Bs2Api
33
37
  end_to_end_id: hash["endToEndId"],
34
38
  receiver: Bs2Api::Entities::Bank.from_response(hash["recebedor"]),
35
39
  payer: Bs2Api::Entities::Bank.from_response(hash["pagador"]),
36
- status: hash["status"]
40
+ status: hash["status"],
41
+ error_code: hash.dig('erro', 'erroCodigo'),
42
+ error_message: hash.dig('erro', 'erroDescricao')
37
43
  )
38
44
  end
39
45
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bs2Api
4
- VERSION = '1.7.0'
4
+ VERSION = '1.8.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bs2_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kim Pastro
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-07 00:00:00.000000000 Z
11
+ date: 2022-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder
@@ -188,6 +188,7 @@ files:
188
188
  - ".gitignore"
189
189
  - ".rspec"
190
190
  - ".ruby-version"
191
+ - ".tool-versions"
191
192
  - CHANGELOG.md
192
193
  - Gemfile
193
194
  - Gemfile.lock