inter_api 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/inter_api/client.rb +4 -4
- data/lib/inter_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: 36661dd5aa68653e29608d07616fd26e0726640409f2188efaf99b8e3a44dcf4
|
4
|
+
data.tar.gz: 94eb00f18a9a1191014047249ca1050ce720dde93f0836965ab078abb6800ad5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a46510c801ffcba0d75ef5ca8bbea8d9b7d492b76957516a528dd8032b93d6440ebb8a6ee59ad629654991d7c14c0a0aecfb109148b6dbe76d67bbeedc10fd8
|
7
|
+
data.tar.gz: c2edb6b9c990e8161d0d4e52137da8585cd615ed1e69ba92d89e25a66f9c7ee1aea94a9cea0c1cbaea0366533bd45c7bb2b972e65003f70e8638bfb2f075ec0e
|
data/lib/inter_api/client.rb
CHANGED
@@ -30,7 +30,7 @@ module InterApi
|
|
30
30
|
grant_type: "client_credentials",
|
31
31
|
scope: @scopes
|
32
32
|
}
|
33
|
-
response = post("/oauth/v2/token", headers: headers, sslcert: @crt, sslkey: @key, body: body)
|
33
|
+
response = post("/oauth/v2/token", headers: headers, sslcert: @crt, sslkey: @key, body: body) { |response| validate_response(response, "access_token") }
|
34
34
|
@token = response.json["access_token"]
|
35
35
|
@token_expires_at = Time.now + response.json["expires_in"]
|
36
36
|
end
|
@@ -84,12 +84,12 @@ module InterApi
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def update_payment(payment_id, body)
|
87
|
-
response =
|
87
|
+
response = patch("/pix/v2/cob/#{payment_id}", headers: build_headers, sslcert: @crt, sslkey: @key, body: JSON.dump(body)) { |response| validate_response(response, "txid") }
|
88
88
|
InterApi::Payment.new(response.json, self)
|
89
89
|
end
|
90
90
|
|
91
91
|
def get_refund(end_to_end_id, id)
|
92
|
-
response = get("/pix/v2/pix/#{end_to_end_id}/devolucao/#{id}", headers: build_headers, sslcert: @crt, sslkey: @key)
|
92
|
+
response = get("/pix/v2/pix/#{end_to_end_id}/devolucao/#{id}", headers: build_headers, sslcert: @crt, sslkey: @key) { |response| validate_response(response, "id") }
|
93
93
|
response.json
|
94
94
|
end
|
95
95
|
|
@@ -100,7 +100,7 @@ module InterApi
|
|
100
100
|
natureza: refund_nature,
|
101
101
|
descricao: description
|
102
102
|
}
|
103
|
-
response = put("/pix/v2/pix/#{end_to_end_id}/devolucao/#{id}", headers: build_headers, sslcert: @crt, sslkey: @key, body: JSON.dump(body))
|
103
|
+
response = put("/pix/v2/pix/#{end_to_end_id}/devolucao/#{id}", headers: build_headers, sslcert: @crt, sslkey: @key, body: JSON.dump(body)) { |response| validate_response(response, "id") }
|
104
104
|
response.json
|
105
105
|
end
|
106
106
|
|
data/lib/inter_api/version.rb
CHANGED