bs2_api 0.4.0 → 1.0.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: e00122261c7f101e2aa06cd712a97dffc16c9217efff07c83eab99cff74110fe
4
- data.tar.gz: fbbaae2c421c022b774601e94e10cc25cc2324770e7db7621c5bd6e173184e63
3
+ metadata.gz: 78c5e50ba3341bf79dd9fa5fbdc83c5e78aca818921951c72e2e6481f3b7b3f9
4
+ data.tar.gz: 63bbcb0806109efb4d714f80324e00594c31273eda6b6e60d600fb0dd673d3b9
5
5
  SHA512:
6
- metadata.gz: 1c146dc459d908d337fd1920522d70498a985f5fac4a64f2daecc491b43436dbe462564a66d91467f90420edb0f2ed3390e88c9dd7af74d910d6cffe12ed7111
7
- data.tar.gz: f4a492028c841aca65b635d6a12ba2dd9500b656fd3eae6dd7df88d0480b3104c5640ae5eb3bc8647ff453b18a04018e3bdae85e6afa917932ec5c57c6771795
6
+ metadata.gz: 1e70eb0d7ff1bedab7e1437076020da0c30c79cd895ff0657b291087ecc83b8f1e4c4fc39f5616ff82e5e8462ff75affbb290b3177315e3421ece8aef973b23f
7
+ data.tar.gz: fad7eaf73f6cb8af230af50c66cb43dab416fcf11149036ed215bd9170beae4a223e920a9c2488a409ef08258453c7a2f6d02c5df5a34ddbd55c106e4edbead1
data/CHANGELOG.md CHANGED
@@ -1,16 +1,20 @@
1
- ## [0.3.1] - 2021-06-16
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bs2_api (0.3.4)
4
+ bs2_api (1.0.0)
5
5
  activesupport
6
6
  builder
7
7
  bundler
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.id
69
+ pay_key.payment.payment_idid
70
70
  => "96f0b3c4-4c76-4a7a-9933-9c9f86df7490" # pagamentoId gerado no BS2
71
71
 
72
- pay_key.payment.merchant_id
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.id
101
+ pay_manual.payment.payment_id
102
102
  => "96f0b3c4-4c76-4a7a-9933-9c9f86df7490" # UUID gerado no BS2
103
103
 
104
- pay_manual.payment.merchantId
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 :id, :merchant_id, :receiver, :payer
6
+ attr_accessor :payment_id, :end_to_end_id, :receiver, :payer
7
7
 
8
8
  def initialize(args = {})
9
- @id = args.fetch(:id, nil)
10
- @merchant_id = args.fetch(:merchant_id, nil)
11
- @receiver = args.fetch(:receiver, nil)
12
- @payer = args.fetch(:payer, nil)
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": @id,
19
- "endToEndId": @merchant_id,
20
- "recebedor": @receiver.to_hash,
21
- "pagador": @payer.to_hash
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
- id: hash["pagamentoId"],
31
- merchant_id: hash["endToEndId"],
32
- receiver: Bs2Api::Entities::Bank.from_response(hash["recebedor"]),
33
- payer: Bs2Api::Entities::Bank.from_response(hash["pagador"])
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
@@ -31,7 +31,7 @@ module Bs2Api
31
31
  end
32
32
 
33
33
  def url
34
- "#{Bs2Api.endpoint}/pix/direto/forintegration/v1/pagamentos/#{@payment.id}/confirmacao"
34
+ "#{Bs2Api.endpoint}/pix/direto/forintegration/v1/pagamentos/#{@payment.payment_id}/confirmacao"
35
35
  end
36
36
  end
37
37
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bs2Api
4
- VERSION = "0.4.0"
4
+ VERSION = "1.0.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bs2_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kim Pastro