nequi 0.1.8 → 0.1.9
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/lib/nequi.rb +3 -3
- 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: 37f7269c20214801a0eb5fe7765927f6135bfdbb6e05735e4e0b1fd04a27684f
|
4
|
+
data.tar.gz: 54295fe8bd11e6e3b51e67b32376abf86d90327c17a39edf66eea9fff50bc32e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23719d15a5e0ac3deb970b9adc3f792a2b097308b206196c7303de2df3b6143bb3549b2b78a1b8ba734103e94c126cd09910385dc180f8779205c87b3a908744
|
7
|
+
data.tar.gz: afbc4d63e0652eeca02b6c11e4d02049bd1614723a1f68b872decab3c368c863ccbb3fcbf64a0591a4a64c1574b35a90d6d874452434a110cbf666b62ff22afa
|
data/lib/nequi.rb
CHANGED
@@ -40,7 +40,7 @@ module Nequi
|
|
40
40
|
|
41
41
|
response = HTTParty.post(configuration.auth_uri, body: body, headers: headers)
|
42
42
|
|
43
|
-
raise "Failed to authenticate with Nequi. HTTP status code: #{response.code}" unless (response.code == 200 && !response.body.empty?)
|
43
|
+
raise "Failed to authenticate with Nequi. HTTP status code: #{response.code}" unless (response.code.to_i == 200 && !response.body.empty?)
|
44
44
|
|
45
45
|
response_body = JSON.parse(response.body)
|
46
46
|
@token = { access_token: response_body['access_token'], token_type: response_body['token_type'], expires_at: Time.now + 2.hours }
|
@@ -92,7 +92,7 @@ module Nequi
|
|
92
92
|
|
93
93
|
response_body = JSON.parse(response.body)
|
94
94
|
|
95
|
-
if response.code.
|
95
|
+
if response.code.to_i == 200 && !response_body['ResponseMessage']['ResponseBody'].nil?
|
96
96
|
logs << { 'type' => 'information', 'message' => "Petition returned HTTP 200" }
|
97
97
|
|
98
98
|
begin
|
@@ -102,7 +102,7 @@ module Nequi
|
|
102
102
|
status_code = status ? status['StatusCode'] : ''
|
103
103
|
status_desc = status ? status['StatusDesc'] : ''
|
104
104
|
|
105
|
-
if status_code
|
105
|
+
if status_code == '200'
|
106
106
|
logs << { 'type' => 'success', 'message' => 'Payment request send success fully' }
|
107
107
|
|
108
108
|
payment = any_data['unregisteredPaymentRS']
|