bs2_api 0.4.0 → 1.0.0
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 +4 -4
- data/CHANGELOG.md +9 -5
- data/Gemfile.lock +1 -1
- data/README.md +4 -4
- data/lib/bs2_api/entities/payment.rb +13 -13
- data/lib/bs2_api/payment/confirmation.rb +1 -1
- data/lib/bs2_api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78c5e50ba3341bf79dd9fa5fbdc83c5e78aca818921951c72e2e6481f3b7b3f9
|
4
|
+
data.tar.gz: 63bbcb0806109efb4d714f80324e00594c31273eda6b6e60d600fb0dd673d3b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e70eb0d7ff1bedab7e1437076020da0c30c79cd895ff0657b291087ecc83b8f1e4c4fc39f5616ff82e5e8462ff75affbb290b3177315e3421ece8aef973b23f
|
7
|
+
data.tar.gz: fad7eaf73f6cb8af230af50c66cb43dab416fcf11149036ed215bd9170beae4a223e920a9c2488a409ef08258453c7a2f6d02c5df5a34ddbd55c106e4edbead1
|
data/CHANGELOG.md
CHANGED
@@ -1,16 +1,20 @@
|
|
1
|
-
## [0.
|
1
|
+
## [1.0.0] - 2021-06-18
|
2
|
+
- Changed payment.id to payment.payment_id
|
3
|
+
- Changed payment.merchant_id to payment.end_to_end_id
|
4
|
+
|
5
|
+
## [0.4.0] - 2021-06-17
|
6
|
+
- Configuration#valid? missing return true
|
7
|
+
- Created Util::Response.parse_error
|
8
|
+
- Bs2Api::Payment::Confirmation#success? was private, moved it to public
|
2
9
|
|
10
|
+
## [0.3.1] - 2021-06-16
|
3
11
|
- Method Hash#to_query conflicting with Rails
|
4
12
|
|
5
13
|
## [0.3.0] - 2021-06-16
|
6
|
-
|
7
14
|
- Confirmation, Adjust README.md
|
8
15
|
|
9
16
|
## [0.2.0] - 2021-06-15
|
10
|
-
|
11
17
|
- Entities, Auth, Create Pix Key Payment
|
12
18
|
|
13
|
-
|
14
19
|
## [0.1.0] - 2021-06-11
|
15
|
-
|
16
20
|
- Initial release
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -66,10 +66,10 @@ pix_key = Bs2Api::Entities::PixKey.new(
|
|
66
66
|
# Veja abaixo (Classes de errors) quais erros que podem ser lançados
|
67
67
|
pay_key = Bs2Api::Payment::Key.new(pix_key).call
|
68
68
|
|
69
|
-
pay_key.payment.
|
69
|
+
pay_key.payment.payment_idid
|
70
70
|
=> "96f0b3c4-4c76-4a7a-9933-9c9f86df7490" # pagamentoId gerado no BS2
|
71
71
|
|
72
|
-
pay_key.payment.
|
72
|
+
pay_key.payment.end_to_end_id
|
73
73
|
=> "E710278662021061618144401750781P" # endToEndId gerado no BS2
|
74
74
|
|
75
75
|
```
|
@@ -98,10 +98,10 @@ receiver_bank = Bs2Api::Entities::Bank.new(
|
|
98
98
|
|
99
99
|
pay_manual = Bs2Api::Payment::Manual.new(receiver_bank).call
|
100
100
|
|
101
|
-
pay_manual.payment.
|
101
|
+
pay_manual.payment.payment_id
|
102
102
|
=> "96f0b3c4-4c76-4a7a-9933-9c9f86df7490" # UUID gerado no BS2
|
103
103
|
|
104
|
-
pay_manual.payment.
|
104
|
+
pay_manual.payment.end_to_end_id
|
105
105
|
=> "E710278662021061618144401750781P" # endToEndId gerado no BS2
|
106
106
|
```
|
107
107
|
|
@@ -3,22 +3,22 @@
|
|
3
3
|
module Bs2Api
|
4
4
|
module Entities
|
5
5
|
class Payment
|
6
|
-
attr_accessor :
|
6
|
+
attr_accessor :payment_id, :end_to_end_id, :receiver, :payer
|
7
7
|
|
8
8
|
def initialize(args = {})
|
9
|
-
@
|
10
|
-
@
|
11
|
-
@receiver
|
12
|
-
@payer
|
9
|
+
@payment_id = args.fetch(:payment_id, nil)
|
10
|
+
@end_to_end_id = args.fetch(:end_to_end_id, nil)
|
11
|
+
@receiver = args.fetch(:receiver, nil)
|
12
|
+
@payer = args.fetch(:payer, nil)
|
13
13
|
end
|
14
14
|
|
15
15
|
def to_hash
|
16
16
|
ActiveSupport::HashWithIndifferentAccess.new(
|
17
17
|
{
|
18
|
-
"pagamentoId": @
|
19
|
-
"endToEndId":
|
20
|
-
"recebedor":
|
21
|
-
"pagador":
|
18
|
+
"pagamentoId": @payment_id,
|
19
|
+
"endToEndId": @end_to_end_id,
|
20
|
+
"recebedor": @receiver.to_hash,
|
21
|
+
"pagador": @payer.to_hash
|
22
22
|
}
|
23
23
|
)
|
24
24
|
end
|
@@ -27,10 +27,10 @@ module Bs2Api
|
|
27
27
|
hash = ActiveSupport::HashWithIndifferentAccess.new(hash_payload)
|
28
28
|
|
29
29
|
Bs2Api::Entities::Payment.new(
|
30
|
-
|
31
|
-
|
32
|
-
receiver:
|
33
|
-
payer:
|
30
|
+
payment_id: hash["pagamentoId"],
|
31
|
+
end_to_end_id: hash["endToEndId"],
|
32
|
+
receiver: Bs2Api::Entities::Bank.from_response(hash["recebedor"]),
|
33
|
+
payer: Bs2Api::Entities::Bank.from_response(hash["pagador"])
|
34
34
|
)
|
35
35
|
end
|
36
36
|
end
|
data/lib/bs2_api/version.rb
CHANGED