cobro_digital 1.4.2 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cobro_digital.rb +3 -2
- data/lib/cobro_digital/meta.rb +7 -34
- data/lib/cobro_digital/operador.rb +7 -11
- data/lib/cobro_digital/transaccion.rb +0 -10
- data/lib/cobro_digital/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7eb82e0b20853eaaf4b7a8fcdef12d8a9e3c211d1bd420cf6698e7c0a462e028
|
4
|
+
data.tar.gz: 8f51aed37d962e8416a6b17a50de0a484a68dc3be501dd2309f8f436fd01406f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 450a07b5e817b9885d292ce9c1a3ac78fc63d45a9586615e4e4fbf84880344a7bca506950792b4c0ef65155dac942e9c4aed1ab58325f45a23cf9d8c29c798e8
|
7
|
+
data.tar.gz: a6919725118c44d2b63c2cd7b4f25af243509e6aef37e018c0a1e2ea1725792c27305e34938854adf47afe6533227f076e228b9a7973dd571765f9d6a9b47eb5
|
data/lib/cobro_digital.rb
CHANGED
@@ -14,8 +14,9 @@ module CobroDigital
|
|
14
14
|
HTTPS = 'https'
|
15
15
|
|
16
16
|
CLIENTS = [SOAP, HTTPS]
|
17
|
-
URI = 'https://
|
18
|
-
WSDL = 'https://
|
17
|
+
URI = 'https://cobro.digital:14365/ws3/'.freeze
|
18
|
+
WSDL = 'https://cobro.digital:14365/ws3/?wsdl'.freeze
|
19
|
+
|
19
20
|
TIMEOUT = 300
|
20
21
|
|
21
22
|
module Https
|
data/lib/cobro_digital/meta.rb
CHANGED
@@ -5,18 +5,18 @@ module CobroDigital
|
|
5
5
|
|
6
6
|
# md5(microtime(true)*rand())
|
7
7
|
# { 'handshake'=>Digest::MD5.hexdigest(Time.now.to_f.to_s),
|
8
|
-
|
9
|
-
|
8
|
+
# 'metodo_webservice'=>'meta',
|
9
|
+
# '0' => { 'metodo_webservice' => 'crear_pagador',
|
10
10
|
# 'handshake' => Digest::MD5.hexdigest(Time.now.to_f.to_s),
|
11
11
|
# 'pagador' => { 'Nombre' => 'Juan',
|
12
12
|
# 'Su_identificador' => '1AF8',
|
13
13
|
# 'Unidad' => '201' } },
|
14
|
-
|
14
|
+
# '1' => { 'metodo_webservice' => 'crear_pagador',
|
15
15
|
# 'handshake' => Digest::MD5.hexdigest(Time.now.to_f.to_s),
|
16
16
|
# 'pagador'=> { 'Nombre'=>'Pedro',
|
17
17
|
# 'Su_identificador'=>'1AG9',
|
18
18
|
# 'Unidad'=>'202' } },
|
19
|
-
|
19
|
+
# '2' => { 'metodo_webservice' => 'generar_boleta',
|
20
20
|
# 'handshake' => Digest::MD5.hexdigest(Time.now.to_f.to_s),
|
21
21
|
# 'identificador' => 'Su_identificador',
|
22
22
|
# 'buscar' => '1AF8',
|
@@ -24,7 +24,7 @@ module CobroDigital
|
|
24
24
|
# 'fechas_vencimiento' => ['20160930'],
|
25
25
|
# 'plantilla' => 'init',
|
26
26
|
# 'concepto' => 'Test I'},
|
27
|
-
|
27
|
+
# '3' => { 'metodo_webservice' => 'generar_boleta',
|
28
28
|
# 'handshake' => Digest::MD5.hexdigest(Time.now.to_f.to_s),
|
29
29
|
# 'identificador' => 'Su_identificador',
|
30
30
|
# 'buscar' => '1AG9',
|
@@ -32,10 +32,10 @@ module CobroDigital
|
|
32
32
|
# 'fechas_vencimiento' => ['20160929'],
|
33
33
|
# 'plantilla' => 'init',
|
34
34
|
# 'concepto' => 'Test II'},
|
35
|
-
|
35
|
+
# '4' => { 'metodo_webservice' => 'inhabilitar_boleta',
|
36
36
|
# 'handshake' => Digest::MD5.hexdigest(Time.now.to_f.to_s),
|
37
37
|
# 'nro_boleta' => '4' },
|
38
|
-
|
38
|
+
# '5' => { 'metodo_webservice' => 'inhabilitar_boleta',
|
39
39
|
# 'handshake' => Digest::MD5.hexdigest(Time.now.to_f.to_s),
|
40
40
|
# 'nro_boleta' => '65' } }
|
41
41
|
|
@@ -68,32 +68,5 @@ module CobroDigital
|
|
68
68
|
:render => render(objs)
|
69
69
|
)
|
70
70
|
end
|
71
|
-
|
72
|
-
def parse_response
|
73
|
-
output = response.body[:webservice_cobrodigital_response][:output]
|
74
|
-
|
75
|
-
parsed_response = JSON.parse(output)
|
76
|
-
|
77
|
-
datos = if parsed_response.key?('datos')
|
78
|
-
parsed_response['datos'].map do |data|
|
79
|
-
parsed_data = JSON.parse(data)
|
80
|
-
|
81
|
-
local_data = if parsed_data['datos'].present?
|
82
|
-
JSON.parse(parsed_data['datos'].first) rescue []
|
83
|
-
else
|
84
|
-
[]
|
85
|
-
end
|
86
|
-
|
87
|
-
{ resultado: (parsed_data['ejecucion_correcta'] == '1'),
|
88
|
-
log: parsed_data['log'],
|
89
|
-
datos: local_data }
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
{ resultado: (parsed_response['ejecucion_correcta'] == '1'),
|
94
|
-
log: parsed_response['log'],
|
95
|
-
datos: datos }
|
96
|
-
end
|
97
|
-
|
98
71
|
end
|
99
72
|
end
|
@@ -20,20 +20,16 @@ module CobroDigital
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def parse_response
|
23
|
-
|
23
|
+
output = response.body[:webservice_cobrodigital_response][:output]
|
24
|
+
parsed_response = JSON.parse(output)
|
24
25
|
|
25
|
-
|
26
|
+
raw_datos = parsed_response['datos'] || []
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
_data.delete("")
|
31
|
-
datos << _data
|
32
|
-
end
|
33
|
-
end
|
28
|
+
datos = raw_datos.map do |row|
|
29
|
+
row.is_a?(Array) ? row : (JSON.parse(row) rescue row)
|
30
|
+
end.flatten
|
34
31
|
|
35
|
-
{ resultado: (parsed_response['ejecucion_correcta'] == '1'), log: parsed_response['log'], datos:
|
32
|
+
{ resultado: (parsed_response['ejecucion_correcta'] == '1'), log: parsed_response['log'], datos: datos }
|
36
33
|
end
|
37
|
-
|
38
34
|
end
|
39
35
|
end
|
@@ -31,15 +31,5 @@ module CobroDigital
|
|
31
31
|
:render => render(desde, hasta, filtros)
|
32
32
|
)
|
33
33
|
end
|
34
|
-
|
35
|
-
def parse_response
|
36
|
-
output = response.body[:webservice_cobrodigital_response][:output]
|
37
|
-
parsed_response = JSON.parse(output)
|
38
|
-
|
39
|
-
datos = parsed_response['datos'].present? ? (JSON.parse(JSON.parse(output)['datos'].first) rescue []) : []
|
40
|
-
|
41
|
-
{ resultado: (parsed_response['ejecucion_correcta'] == '1'), log: parsed_response['log'], datos: datos }
|
42
|
-
end
|
43
|
-
|
44
34
|
end
|
45
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cobro_digital
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- g.edera
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -153,8 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
153
|
- !ruby/object:Gem::Version
|
154
154
|
version: '0'
|
155
155
|
requirements: []
|
156
|
-
|
157
|
-
rubygems_version: 2.7.7
|
156
|
+
rubygems_version: 3.0.3
|
158
157
|
signing_key:
|
159
158
|
specification_version: 4
|
160
159
|
summary: Adaptador CobroDigital
|