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 +4 -4
- data/.gitignore +1 -0
- data/.tool-versions +1 -0
- data/Gemfile.lock +1 -1
- data/bs2_api.gemspec +1 -1
- data/lib/bs2_api/entities/payment.rb +11 -5
- data/lib/bs2_api/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8449060cc6217780e2b9a1e3698d79c998e141d919765b2c9573d5f350594f66
|
4
|
+
data.tar.gz: c045fd2971f93c19b18fc764dd6328c1e08d3fe430e7c5505d1afc24ecb7db2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6929c953e3ff67fee1d6b118b72f611eee5e23b1172d47afdd209cd121616ab6b5468249e2e71e267830206a2f918b3171163d56ac025f8d119c18134ccd888f
|
7
|
+
data.tar.gz: 89fe2992dc08bcf58adfc42f9f4d7ac3ba8c97a344e6f61e35905794a279d695c6cc4d5d5c78e865263b5c92b855e1d8404b4072563e9d2f4f4693d3a0588e50
|
data/.gitignore
CHANGED
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 2.7.2
|
data/Gemfile.lock
CHANGED
data/bs2_api.gemspec
CHANGED
@@ -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":
|
19
|
-
"endToEndId":
|
20
|
-
"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
|
data/lib/bs2_api/version.rb
CHANGED
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.
|
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-
|
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
|