ruby-anmat 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec2a3894021c84bfa75f150e6bb113c3a72e6d3cfedff6be2c3e86d62b3ce66e
4
- data.tar.gz: 3f7a8177924161460a079ba23f676865fbfda861546434d47379986c084f2393
3
+ metadata.gz: 5ecadfe75e31c96ceae9db7f96c2011120589aec4a74f1ed5a6cfaf7b21071d3
4
+ data.tar.gz: cacd4296ccc4639baae2135301bdf6cff36fe27bfb680171248e401c545644eb
5
5
  SHA512:
6
- metadata.gz: 9a96f0492f9e7d29d61fa09bdade43d0a41bf602aa51cec23dd39cb748fee652ee8b84685808e36f2e1e9f05649becfb121b5344e778f5f164bb7990980d5ef2
7
- data.tar.gz: 9d229128dae1cd6708133ae93afc5a5ba84b28955e9d02c63d9c5ecef0b252cdbbb04fd40b3de9301fa0a4f71a8b1da82e491f8052b8615aa31176f2b927e08c
6
+ metadata.gz: cd4d3df44df5c2b1fc1896671e05691a13665d5349a860b5fda363833380195c2a2831a85d3a0bfac08581263267db7f215ef4de4f920c95ad86043bdf0fefd3
7
+ data.tar.gz: 84f63f9462fe26e249a3d4849286e30fbc5cf8a04c1ad1878bf1cf238a3fcd02c6d585e98097926351efea02d3c8597e35d6049b8f6bc1661f9625d4e9638891
data/Gemfile.lock ADDED
@@ -0,0 +1,48 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ ruby-anmat (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ akami (1.3.1)
10
+ gyoku (>= 0.4.0)
11
+ nokogiri
12
+ builder (3.2.3)
13
+ gyoku (1.3.1)
14
+ builder (>= 2.1.2)
15
+ httpi (2.4.4)
16
+ rack
17
+ socksify
18
+ mini_portile2 (2.4.0)
19
+ nokogiri (1.10.3)
20
+ mini_portile2 (~> 2.4.0)
21
+ nori (2.6.0)
22
+ rack (2.0.7)
23
+ rake (10.5.0)
24
+ savon (2.12.0)
25
+ akami (~> 1.2)
26
+ builder (>= 2.1.2)
27
+ gyoku (~> 1.2)
28
+ httpi (~> 2.3)
29
+ nokogiri (>= 1.8.1)
30
+ nori (~> 2.4)
31
+ wasabi (~> 3.4)
32
+ socksify (1.7.1)
33
+ wasabi (3.5.0)
34
+ httpi (~> 2.0)
35
+ nokogiri (>= 1.4.2)
36
+
37
+ PLATFORMS
38
+ ruby
39
+
40
+ DEPENDENCIES
41
+ bundler (~> 2.0)
42
+ httpi
43
+ rake (~> 10.0)
44
+ ruby-anmat!
45
+ savon (~> 2.12.0)
46
+
47
+ BUNDLED WITH
48
+ 2.0.2
@@ -0,0 +1,21 @@
1
+ module Ruby
2
+ module Anmat
3
+
4
+ URLS = {
5
+ :test => {
6
+ :wsdl => 'https://servicios.pami.org.ar/trazamed.WebService?WSDL'
7
+ },
8
+ :production => {
9
+ :wsdl => 'https://trazabilidad.pami.org.ar:9050/trazamed.WebService'
10
+ }
11
+ }
12
+
13
+ NAMESPACES = {
14
+ 'SOAP-ENV' => 'http://schemas.xmlsoap.org/soap/envelope/',
15
+ 'xsd' => 'http://www.w3.org/2001/XMLSchema',
16
+ 'xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
17
+ 'SOAP-ENC' => 'http://schemas.xmlsoap.org/soap/encoding/'
18
+ }
19
+
20
+ end
21
+ end
@@ -0,0 +1,68 @@
1
+ module Ruby
2
+ module Anmat
3
+ class Traceability
4
+
5
+ def initialize(args={}, environment = :test)
6
+ @environment = environment
7
+ @f_evento = args["f_evento"] || "20/01/2013"
8
+ @h_evento = args["h_evento"] || "23:59"
9
+ @gln_origen = args["gln_origen"] || "glnws"
10
+ @gln_destino = args["gln_destino"] || "GLN-1"
11
+ @n_remito = args["n_remito"] || "1"
12
+ @n_factura = args["n_factura"] || "1"
13
+ @vencimiento = args["vencimiento"] || "01/05/2011"
14
+ @gtin = args["gtin"] || "GTIN1"
15
+ @lote = args["lote"] || "1"
16
+ @numero_serial = args["numero_serial"] || rand(1300..99999999).to_s
17
+ @id_evento = args["id_evento"] || "133"
18
+ @n_postal = args["n_postal"] || "1416"
19
+ @telefono = args["telefono"] || "45880712"
20
+
21
+ @user = 'pruebasws'
22
+ @pass = 'pruebasws'
23
+ end
24
+
25
+ def set_client
26
+ @client = Savon.client(
27
+ wsdl: Anmat::URLS[@environment][:wsdl],
28
+ namespaces: Anmat::NAMESPACES,
29
+ log_level: :debug,
30
+ ssl_verify_mode: :none,
31
+ read_timeout: 90,
32
+ open_timeout: 90,
33
+ headers: { "Accept-Encoding" => "gzip, deflate", "Connection" => "Keep-Alive" }
34
+ )
35
+ end
36
+
37
+ def send_medicamentos
38
+ set_client
39
+ body = set_body
40
+
41
+ response = @client.call(:send_medicamentos, message: body)
42
+ pp response
43
+ end
44
+
45
+ def set_body
46
+ {
47
+ "arg0" => {
48
+ "f_evento" => @f_evento,
49
+ "h_evento" => @h_evento,
50
+ "gln_origen" => @gln_origen,
51
+ "gln_destino" => @gln_destino,
52
+ "n_remito" => @n_remito,
53
+ "n_factura" => @n_factura,
54
+ "vencimiento" => @vencimiento,
55
+ "gtin" => @gtin,
56
+ "lote" => @lote,
57
+ "numero_serial" => @numero_serial,
58
+ "id_evento" => @id_evento,
59
+ "n_postal" => @n_postal,
60
+ "telefono" => @telefono,
61
+ },
62
+ "arg1" => @user,
63
+ "arg2" => @pass
64
+ }
65
+ end
66
+ end
67
+ end
68
+ end
@@ -1,5 +1,5 @@
1
1
  module Ruby
2
2
  module Anmat
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-anmat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ing. Díaz Martínez Facundo
@@ -48,12 +48,15 @@ files:
48
48
  - ".gitignore"
49
49
  - CODE_OF_CONDUCT.md
50
50
  - Gemfile
51
+ - Gemfile.lock
51
52
  - LICENSE.txt
52
53
  - README.md
53
54
  - Rakefile
54
55
  - bin/console
55
56
  - bin/setup
56
57
  - lib/ruby/anmat.rb
58
+ - lib/ruby/anmat/constants.rb
59
+ - lib/ruby/anmat/traceability.rb
57
60
  - lib/ruby/anmat/version.rb
58
61
  - ruby-anmat.gemspec
59
62
  homepage: https://github.com/FacundoDiazMartinez/ruby-anmat.git