bs2_api 1.6.0 → 1.7.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/Gemfile.lock +1 -1
- data/lib/bs2_api/entities/async_status.rb +8 -0
- data/lib/bs2_api/payment/async.rb +17 -4
- data/lib/bs2_api/payment/detail.rb +8 -1
- 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: 7455eef55c86c81150fae145f2e570ce1e88a1c36276b1dfd7e381e7431a3283
|
|
4
|
+
data.tar.gz: 17247bbba1a6db2d7c385333ab57be1d61532563ea3a807ff24aa4ef65c80e32
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5b21aa07c3a5395db419b07e389f0298f00ebb0dab899e628b39f71da73c783f0144305045ef9f07a3271a68b3b34a6100e43166c9c1928f2835f461f521fab8
|
|
7
|
+
data.tar.gz: 54a5dcc93e7488d9ad833bb480cdad8def6f99d64063f5aabaf5691ac37e7245b7d60c323096d13c864af46b68bdd3883c7f32171123ddad66f12a531b358e67
|
data/Gemfile.lock
CHANGED
|
@@ -21,15 +21,28 @@ module Bs2Api
|
|
|
21
21
|
def check_payment_status(
|
|
22
22
|
request_id,
|
|
23
23
|
client_id: Bs2Api.configuration.client_id,
|
|
24
|
-
client_secret: Bs2Api.configuration.client_secret
|
|
24
|
+
client_secret: Bs2Api.configuration.client_secret,
|
|
25
|
+
proxy: nil
|
|
25
26
|
)
|
|
26
|
-
|
|
27
|
+
|
|
27
28
|
bearer_token = Bs2Api::Request::Auth.token(
|
|
28
29
|
client_id: client_id,
|
|
29
30
|
client_secret: client_secret
|
|
30
31
|
)
|
|
31
|
-
|
|
32
|
-
response = HTTParty.get(
|
|
32
|
+
|
|
33
|
+
response = HTTParty.get(
|
|
34
|
+
request_status_url(request_id),
|
|
35
|
+
http_proxyaddr: proxy&.host,
|
|
36
|
+
http_proxyport: proxy&.port,
|
|
37
|
+
http_proxyuser: proxy&.user,
|
|
38
|
+
http_proxypass: proxy&.password,
|
|
39
|
+
headers: {
|
|
40
|
+
'Authorization': "Bearer #{bearer_token}"
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
raise Bs2Api::Errors::Base, response.body.to_s unless response.success?
|
|
45
|
+
|
|
33
46
|
Bs2Api::Entities::AsyncStatus.from_response response.parsed_response
|
|
34
47
|
end
|
|
35
48
|
|
|
@@ -29,7 +29,14 @@ module Bs2Api
|
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
def detail_request
|
|
32
|
-
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
|
+
)
|
|
33
40
|
end
|
|
34
41
|
|
|
35
42
|
def bearer_token
|
|
@@ -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.7.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-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: builder
|