bs2_api 1.5.1 → 1.6.2
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/Gemfile.lock +1 -1
- data/lib/bs2_api/payment/async.rb +3 -1
- data/lib/bs2_api/payment/base.rb +9 -1
- data/lib/bs2_api/payment/confirmation.rb +7 -5
- data/lib/bs2_api/payment/detail.rb +12 -3
- data/lib/bs2_api/payment/key.rb +4 -2
- data/lib/bs2_api/payment/manual.rb +5 -3
- data/lib/bs2_api/refund/pix/detail.rb +2 -2
- data/lib/bs2_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 995b6148737a522290ec526905740f88b1f883502167576e25eac8b0e2367720
|
4
|
+
data.tar.gz: a6ae71ef4a47cf3f62026313baec3617065ccf7e4deb099519f2af7db888daef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 226da89196ae3a68f8cf109b33d14b4478251e5dc4ad1e97b11894b6a19f2ebeb8a16d8bc110f44c0f9f44d108464634b269c92e97a343ab0e191e99d44d229a
|
7
|
+
data.tar.gz: 70ee5e748030f91e5a45e35d8806cd531e598973be731ba2110e2d298e261bf74e1f275c7d56bdc5f3afd0909e375b66a5facd3f2120dc466e74b4039e2fe385
|
data/Gemfile.lock
CHANGED
@@ -46,10 +46,12 @@ module Bs2Api
|
|
46
46
|
|
47
47
|
def initialize(
|
48
48
|
client_id: Bs2Api.configuration.client_id,
|
49
|
-
client_secret: Bs2Api.configuration.client_secret
|
49
|
+
client_secret: Bs2Api.configuration.client_secret,
|
50
|
+
proxy: nil
|
50
51
|
)
|
51
52
|
@client_id = client_id
|
52
53
|
@client_secret = client_secret
|
54
|
+
@proxy = proxy
|
53
55
|
@requests = []
|
54
56
|
end
|
55
57
|
|
data/lib/bs2_api/payment/base.rb
CHANGED
@@ -18,7 +18,15 @@ module Bs2Api
|
|
18
18
|
private
|
19
19
|
|
20
20
|
def post_request
|
21
|
-
HTTParty.post(
|
21
|
+
HTTParty.post(
|
22
|
+
url,
|
23
|
+
http_proxyaddr: @proxy&.host,
|
24
|
+
http_proxyport: @proxy&.port,
|
25
|
+
http_proxyuser: @proxy&.user,
|
26
|
+
http_proxypass: @proxy&.password,
|
27
|
+
headers: headers,
|
28
|
+
body: payload.to_json
|
29
|
+
)
|
22
30
|
end
|
23
31
|
|
24
32
|
def headers
|
@@ -7,16 +7,18 @@ module Bs2Api
|
|
7
7
|
payment,
|
8
8
|
value: nil,
|
9
9
|
client_id: Bs2Api.configuration.client_id,
|
10
|
-
client_secret: Bs2Api.configuration.client_secret
|
10
|
+
client_secret: Bs2Api.configuration.client_secret,
|
11
|
+
proxy: nil
|
11
12
|
)
|
12
|
-
|
13
|
-
@client_secret = client_secret
|
14
|
-
|
13
|
+
|
15
14
|
raise Bs2Api::Errors::ConfirmationError, 'invalid payment' unless payment.present? && payment.is_a?(Bs2Api::Entities::Payment)
|
16
15
|
raise Bs2Api::Errors::ConfirmationError, 'invalid value' unless value.to_f.positive?
|
17
|
-
@payment = payment
|
18
16
|
|
17
|
+
@payment = payment
|
19
18
|
@value = value.to_f
|
19
|
+
@client_id = client_id
|
20
|
+
@client_secret = client_secret
|
21
|
+
@proxy = proxy
|
20
22
|
end
|
21
23
|
|
22
24
|
def call
|
@@ -6,11 +6,13 @@ module Bs2Api
|
|
6
6
|
def initialize(
|
7
7
|
payment_id,
|
8
8
|
client_id: Bs2Api.configuration.client_id,
|
9
|
-
client_secret: Bs2Api.configuration.client_secret
|
9
|
+
client_secret: Bs2Api.configuration.client_secret,
|
10
|
+
proxy: nil
|
10
11
|
)
|
12
|
+
@payment_id = payment_id
|
11
13
|
@client_id = client_id
|
12
14
|
@client_secret = client_secret
|
13
|
-
@
|
15
|
+
@proxy = proxy
|
14
16
|
end
|
15
17
|
|
16
18
|
def call
|
@@ -27,7 +29,14 @@ module Bs2Api
|
|
27
29
|
end
|
28
30
|
|
29
31
|
def detail_request
|
30
|
-
HTTParty.get(
|
32
|
+
HTTParty.get(
|
33
|
+
url,
|
34
|
+
headers: headers,
|
35
|
+
http_proxyaddr: @proxy&.host,
|
36
|
+
http_proxyport: @proxy&.port,
|
37
|
+
http_proxyuser: @proxy&.user,
|
38
|
+
http_proxypass: @proxy&.password
|
39
|
+
)
|
31
40
|
end
|
32
41
|
|
33
42
|
def bearer_token
|
data/lib/bs2_api/payment/key.rb
CHANGED
@@ -6,11 +6,13 @@ module Bs2Api
|
|
6
6
|
def initialize(
|
7
7
|
key,
|
8
8
|
client_id: Bs2Api.configuration.client_id,
|
9
|
-
client_secret: Bs2Api.configuration.client_secret
|
9
|
+
client_secret: Bs2Api.configuration.client_secret,
|
10
|
+
proxy: nil
|
10
11
|
)
|
12
|
+
@key = key
|
11
13
|
@client_id = client_id
|
12
14
|
@client_secret = client_secret
|
13
|
-
@
|
15
|
+
@proxy = proxy
|
14
16
|
end
|
15
17
|
|
16
18
|
private
|
@@ -6,13 +6,15 @@ module Bs2Api
|
|
6
6
|
def initialize(
|
7
7
|
bank,
|
8
8
|
client_id: Bs2Api.configuration.client_id,
|
9
|
-
client_secret: Bs2Api.configuration.client_secret
|
9
|
+
client_secret: Bs2Api.configuration.client_secret,
|
10
|
+
proxy: nil
|
10
11
|
)
|
11
12
|
|
12
|
-
@client_id = client_id
|
13
|
-
@client_secret = client_secret
|
14
13
|
raise Bs2Api::Errors::InvalidBank, 'Invalid Bank' unless bank.is_a?(Bs2Api::Entities::Bank)
|
15
14
|
@bank = bank
|
15
|
+
@client_id = client_id
|
16
|
+
@client_secret = client_secret
|
17
|
+
@proxy = proxy
|
16
18
|
end
|
17
19
|
|
18
20
|
private
|
@@ -6,7 +6,7 @@ module Bs2Api
|
|
6
6
|
'EM_PROCESSAMENTO' => :processing,
|
7
7
|
'DEVOLVIDO' => :refunded,
|
8
8
|
'NAO_REALIZADO' => :not_achieved,
|
9
|
-
}.
|
9
|
+
}.freeze
|
10
10
|
|
11
11
|
def initialize(
|
12
12
|
client_id:,
|
@@ -46,7 +46,7 @@ module Bs2Api
|
|
46
46
|
|
47
47
|
raise response.body unless response.success?
|
48
48
|
|
49
|
-
response.body
|
49
|
+
JSON.parse(response.body)
|
50
50
|
end
|
51
51
|
|
52
52
|
def status
|
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.6.2
|
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-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: builder
|