afipws 1.2.2 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 32dca852dd814d29f06a9d9629df8fbceec644c0
4
- data.tar.gz: d1b5ea2ab629c221f6886045e18246e0b4d65f2f
2
+ SHA256:
3
+ metadata.gz: a50ec977b4eb2da94edd06703a11d9ee46b6cfd847de01160a1527871712158e
4
+ data.tar.gz: 3c0aa5ab031957e66b2afea67af73ea1cd91026f67cfea9353877c1b43186dc2
5
5
  SHA512:
6
- metadata.gz: 724f7f394469a3113dab67e7da79cc97b1cbb9e1422976a41cbd2fbfd06b0fb38f851e72e941bb5628d9ab370cd62f090ebeb477baef1f41b759df2b252eb712
7
- data.tar.gz: c16a66276f6d6f334a1c453675b61d6ca57bf1f1d5524cefb93460ee2b42b65909953d81a71cd04a3be24cee932e3748276bfee0273f2c6d5a271a668f11522d
6
+ metadata.gz: 471e56e9c6ceab26acc42b4c2997c2ab9f611ad89bee70400ce5a5d68bc83dc3e89e348af5ce98e727bc6c2363af8936fbcd238f8d1f00942cae3a8a754dae02
7
+ data.tar.gz: d503f3f2df71fc503ddb10bf80985014da6cb03cabc77c5a8a98b4203269e5225c011f66fb125d248e785cb5c3b5b133b32ae8bd2b8c471b1946c8fc1f7dc1ad
@@ -46,6 +46,9 @@ Style/Next:
46
46
  Style/NumericPredicate:
47
47
  Enabled: false
48
48
 
49
+ Style/NumericLiterals:
50
+ Enabled: false
51
+
49
52
  Style/SymbolArray:
50
53
  Enabled: false
51
54
 
@@ -1 +1 @@
1
- 2.3.1
1
+ 2.5.0
@@ -1,2 +1,5 @@
1
+ ---
2
+ sudo: false
1
3
  language: ruby
2
4
  cache: bundler
5
+ before_install: gem install bundler -v 1.16.2
@@ -1,28 +1,32 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- afipws (1.2.2)
4
+ afipws (2.0.0)
5
5
  activesupport
6
6
  builder
7
+ httpclient
7
8
  nokogiri
8
9
  savon (~> 2.11.0)
9
10
 
10
11
  GEM
11
12
  remote: http://rubygems.org/
12
13
  specs:
13
- activesupport (5.2.3)
14
+ activesupport (6.0.3.2)
14
15
  concurrent-ruby (~> 1.0, >= 1.0.2)
15
16
  i18n (>= 0.7, < 2)
16
17
  minitest (~> 5.1)
17
18
  tzinfo (~> 1.1)
19
+ zeitwerk (~> 2.2, >= 2.2.2)
20
+ addressable (2.7.0)
21
+ public_suffix (>= 2.0.2, < 5.0)
18
22
  akami (1.3.1)
19
23
  gyoku (>= 0.4.0)
20
24
  nokogiri
21
25
  ast (2.4.0)
22
- builder (3.2.3)
26
+ builder (3.2.4)
23
27
  byebug (11.0.1)
24
28
  coderay (1.1.2)
25
- concurrent-ruby (1.1.5)
29
+ concurrent-ruby (1.1.7)
26
30
  diff-lcs (1.3)
27
31
  ffi (1.9.25)
28
32
  formatador (0.2.5)
@@ -42,10 +46,11 @@ GEM
42
46
  rspec (>= 2.99.0, < 4.0)
43
47
  gyoku (1.3.1)
44
48
  builder (>= 2.1.2)
45
- httpi (2.4.4)
49
+ httpclient (2.8.3)
50
+ httpi (2.4.5)
46
51
  rack
47
52
  socksify
48
- i18n (1.6.0)
53
+ i18n (1.8.5)
49
54
  concurrent-ruby (~> 1.0)
50
55
  jaro_winkler (1.5.1)
51
56
  listen (3.1.5)
@@ -55,11 +60,11 @@ GEM
55
60
  lumberjack (1.0.13)
56
61
  method_source (0.9.0)
57
62
  mini_portile2 (2.4.0)
58
- minitest (5.11.3)
63
+ minitest (5.14.2)
59
64
  mocha (0.9.10)
60
65
  rake
61
66
  nenv (0.3.0)
62
- nokogiri (1.10.3)
67
+ nokogiri (1.10.10)
63
68
  mini_portile2 (~> 2.4.0)
64
69
  nori (2.6.0)
65
70
  notiffany (0.1.1)
@@ -75,9 +80,10 @@ GEM
75
80
  pry-byebug (3.7.0)
76
81
  byebug (~> 11.0)
77
82
  pry (~> 0.10)
78
- rack (2.0.7)
83
+ public_suffix (4.0.5)
84
+ rack (2.2.3)
79
85
  rainbow (3.0.0)
80
- rake (10.4.2)
86
+ rake (13.0.1)
81
87
  rb-fsevent (0.10.3)
82
88
  rb-inotify (0.9.10)
83
89
  ffi (>= 0.5.0, < 2)
@@ -116,12 +122,14 @@ GEM
116
122
  socksify (1.7.1)
117
123
  thor (0.20.0)
118
124
  thread_safe (0.3.6)
119
- tzinfo (1.2.5)
125
+ tzinfo (1.2.7)
120
126
  thread_safe (~> 0.1)
121
127
  unicode-display_width (1.4.0)
122
- wasabi (3.5.0)
128
+ wasabi (3.6.1)
129
+ addressable
123
130
  httpi (~> 2.0)
124
131
  nokogiri (>= 1.4.2)
132
+ zeitwerk (2.4.0)
125
133
 
126
134
  PLATFORMS
127
135
  ruby
@@ -136,4 +144,4 @@ DEPENDENCIES
136
144
  rubocop
137
145
 
138
146
  BUNDLED WITH
139
- 1.16.2
147
+ 2.1.4
data/README.md CHANGED
@@ -11,6 +11,7 @@ Ruby client para los web services de la AFIP.
11
11
  * ws_sr_constancia_inscripcion (WSConstanciaInscripcion)
12
12
  * ws_sr_padron_a100 (PersonaServiceA100)
13
13
  * ws_sr_padron_a4 (PersonaServiceA4)
14
+ * ws_sr_padron_a5 (PersonaServiceA5)
14
15
  * wconsdeclaracion (WConsDeclaracion)
15
16
 
16
17
  ## Uso
@@ -26,6 +26,7 @@ Gem::Specification.new do |s|
26
26
  s.add_development_dependency 'pry-byebug'
27
27
  s.add_dependency "builder"
28
28
  s.add_dependency "savon", '~> 2.11.0'
29
+ s.add_dependency "httpclient"
29
30
  s.add_dependency "nokogiri"
30
31
  s.add_dependency "activesupport"
31
32
  end
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'afipws'
5
+
6
+ require 'pry'
7
+ Pry.start
@@ -0,0 +1,16 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
6
+
7
+ ## [2.0.0] - 2020-10-28
8
+
9
+ ### Added
10
+
11
+ - Long overdue CHANGELOG file.
12
+ - Include `httpclient` dependency so we can wrap network errors.
13
+
14
+ ### Changed
15
+
16
+ - Rename Afipws::WSError to Afipws::Error, and create subclasses to distinguish between different types of errors.
@@ -5,17 +5,22 @@ end
5
5
  require 'forwardable'
6
6
  require 'builder'
7
7
  require 'base64'
8
+ require 'httpclient'
8
9
  require 'savon'
9
10
  require 'nokogiri'
10
11
  require 'active_support'
11
12
  require 'active_support/core_ext'
12
13
  require 'afipws/core_ext/hash'
13
- require 'afipws/wserror'
14
+ require 'afipws/errors/error'
15
+ require 'afipws/errors/response_error'
16
+ require 'afipws/errors/server_error'
17
+ require 'afipws/errors/network_error'
14
18
  require 'afipws/type_conversions'
15
19
  require 'afipws/client'
16
20
  require 'afipws/wsaa'
17
21
  require 'afipws/wsfe'
18
22
  require 'afipws/ws_constancia_inscripcion'
19
23
  require 'afipws/persona_service_a4'
24
+ require 'afipws/persona_service_a5'
20
25
  require 'afipws/persona_service_a100'
21
26
  require 'afipws/w_cons_declaracion'
@@ -1,15 +1,19 @@
1
1
  module Afipws
2
2
  class Client
3
3
  def initialize savon_options
4
- @client = Savon.client savon_options.reverse_merge(soap_version: 2, ssl_version: :TLSv1)
4
+ @savon = Savon.client savon_options.reverse_merge(soap_version: 2, ssl_version: :TLSv1_2)
5
5
  end
6
6
 
7
7
  def request action, body = nil
8
- @client.call action, message: body
8
+ @savon.call action, message: body
9
+ rescue Savon::SOAPFault => e
10
+ raise ServerError, e
11
+ rescue HTTPClient::TimeoutError => e
12
+ raise NetworkError, e
9
13
  end
10
14
 
11
15
  def operations
12
- @client.operations
16
+ @savon.operations
13
17
  end
14
18
  end
15
19
  end
@@ -4,10 +4,6 @@ module Afipws
4
4
  def select_keys *keys
5
5
  select { |k, _| keys.include? k }
6
6
  end
7
-
8
- def has_entries? entries
9
- entries.each_pair.all? { |k, v| self[k] == v }
10
- end
11
7
  end
12
8
  end
13
9
  end
@@ -0,0 +1,7 @@
1
+ module Afipws
2
+ class Error < StandardError
3
+ def code? _code
4
+ false
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,4 @@
1
+ module Afipws
2
+ class NetworkError < Error
3
+ end
4
+ end
@@ -0,0 +1,16 @@
1
+ module Afipws
2
+ class ResponseError < Error
3
+ attr_reader :errors
4
+
5
+ def initialize errors
6
+ raise ArgumentError, '`errors` must be an array of maps, each with :code and :msg keys' unless errors.is_a? Array
7
+
8
+ super errors.map { |e| "#{e[:code]}: #{e[:msg]}" }.join '; '
9
+ @errors = errors
10
+ end
11
+
12
+ def code? code
13
+ @errors.any? { |e| e[:code].to_s == code.to_s }
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,4 @@
1
+ module Afipws
2
+ class ServerError < Error
3
+ end
4
+ end
@@ -44,8 +44,6 @@ module Afipws
44
44
 
45
45
  def request action, body = nil
46
46
  @client.request(action, body).to_hash[:"#{action}_response"]
47
- rescue Savon::SOAPFault => f
48
- raise WSError, f.message
49
47
  end
50
48
  end
51
49
  end
@@ -27,8 +27,6 @@ module Afipws
27
27
 
28
28
  def request action, body = nil
29
29
  @client.request(action, body).to_hash[:"#{action}_response"]
30
- rescue Savon::SOAPFault => f
31
- raise WSError, f.message
32
30
  end
33
31
  end
34
32
  end
@@ -0,0 +1,33 @@
1
+ module Afipws
2
+ class PersonaServiceA5
3
+ WSDL = {
4
+ development: 'https://awshomo.afip.gov.ar/sr-padron/webservices/personaServiceA5?WSDL',
5
+ production: 'https://aws.afip.gov.ar/sr-padron/webservices/personaServiceA5?WSDL',
6
+ test: Root + '/spec/fixtures/ws_sr_padron_a5.wsdl'
7
+ }.freeze
8
+
9
+
10
+ attr_reader :wsaa
11
+
12
+ def initialize options = {}
13
+ @cuit = options[:cuit]
14
+ @wsaa = WSAA.new options.merge(service: 'ws_sr_padron_a5')
15
+ @client = Client.new Hash(options[:savon]).reverse_merge(wsdl: WSDL[@wsaa.env], soap_version: 1)
16
+ end
17
+
18
+ def dummy
19
+ request(:dummy)[:return]
20
+ end
21
+
22
+ def get_persona id
23
+ message = @wsaa.auth.merge(cuitRepresentada: @cuit, idPersona: id)
24
+ request(:get_persona, message)[:persona_return]
25
+ end
26
+
27
+ private
28
+
29
+ def request action, body = nil
30
+ @client.request(action, body).to_hash[:"#{action}_response"]
31
+ end
32
+ end
33
+ end
@@ -1,3 +1,3 @@
1
1
  module Afipws
2
- VERSION = '1.2.2'
2
+ VERSION = '2.0.0'
3
3
  end
@@ -40,12 +40,10 @@ module Afipws
40
40
  def request action, body = nil
41
41
  response = @client.request(action, body).to_hash[:"#{action}_response"][:"#{action}_result"]
42
42
  if response[:lista_errores] && response[:lista_errores][:detalle_error][:codigo] != '0'
43
- raise WSError, Array.wrap(response[:lista_errores][:detalle_error]).map { |e| {code: e[:codigo], msg: e[:descripcion]} }
43
+ raise ResponseError, Array.wrap(response[:lista_errores][:detalle_error]).map { |e| {code: e[:codigo], msg: e[:descripcion]} }
44
44
  else
45
45
  response
46
46
  end
47
- rescue Savon::SOAPFault => f
48
- raise WSError, f.message
49
47
  end
50
48
 
51
49
  def auth
@@ -27,8 +27,6 @@ module Afipws
27
27
 
28
28
  def request action, body = nil
29
29
  @client.request(action, body).to_hash[:"#{action}_response"]
30
- rescue Savon::SOAPFault => f
31
- raise WSError, f.message
32
30
  end
33
31
  end
34
32
  end
@@ -55,8 +55,6 @@ module Afipws
55
55
  generation_time: from_xsd_datetime(ta.css('generationTime').text),
56
56
  expiration_time: from_xsd_datetime(ta.css('expirationTime').text)
57
57
  }
58
- rescue Savon::SOAPFault => f
59
- raise WSError, f.message
60
58
  end
61
59
 
62
60
  def auth
@@ -89,7 +87,7 @@ module Afipws
89
87
  end
90
88
 
91
89
  def restore_ta
92
- Marshal.load(File.read(@ta_path)) if File.exist?(@ta_path)
90
+ Marshal.load(File.read(@ta_path)) if File.exist?(@ta_path) && !File.zero?(@ta_path)
93
91
  end
94
92
 
95
93
  def persist_ta ta
@@ -92,8 +92,8 @@ module Afipws
92
92
 
93
93
  def solicitar_caea
94
94
  convertir_rta_caea request(:fecaea_solicitar, auth.merge(periodo_para_solicitud_caea))
95
- rescue Afipws::WSError => e
96
- if e.errors.any? { |e| e[:code] == '15008' }
95
+ rescue Afipws::ResponseError => e
96
+ if e.code? 15008
97
97
  consultar_caea fecha_inicio_quincena_siguiente
98
98
  else
99
99
  raise
@@ -163,7 +163,7 @@ module Afipws
163
163
  def request action, body = nil
164
164
  response = @client.request(action, body).to_hash[:"#{action}_response"][:"#{action}_result"]
165
165
  if response[:errors]
166
- raise WSError, Array.wrap(response[:errors][:err])
166
+ raise ResponseError, Array.wrap(response[:errors][:err])
167
167
  else
168
168
  response
169
169
  end
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ module Afipws
4
+ describe Client do
5
+ context 'manejo de errores' do
6
+ subject { Client.new(wsdl: Afipws::WSFE::WSDL[:test]) }
7
+
8
+ it 'Savon::SOAPFault se encapsulan en ServerError' do
9
+ savon.expects(:fe_dummy).returns(fixture('wsaa/login_cms/fault'))
10
+ -> { subject.request :fe_dummy }.should raise_error ServerError, /CMS no es valido/
11
+ end
12
+
13
+ it 'HTTPClient::TimeoutError se encapsulan en NetworkError' do
14
+ # Hack to mock exceptions on Savon
15
+ subject.instance_eval('@savon').expects(:call).raises(HTTPClient::ReceiveTimeoutError, 'execution expired')
16
+ -> { subject.request :fe_dummy }.should raise_error NetworkError, /execution expired/
17
+ end
18
+ end
19
+ end
20
+ end
@@ -10,14 +10,4 @@ describe Hash do
10
10
  hash.select_keys(5, 3).should == {3 => 4}
11
11
  end
12
12
  end
13
-
14
- context 'has_entries?' do
15
- subject { Hash[1, 2, 3, 4] }
16
-
17
- it 'debería devolver true cuando self incluye todas las entries del hash parametro' do
18
- should include 1 => 2
19
- should include 3 => 4, 1 => 2
20
- should_not include 1 => 3
21
- end
22
- end
23
13
  end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ module Afipws
4
+ describe PersonaServiceA5 do
5
+ let(:ta) { {token: 't', sign: 's'} }
6
+ let(:ws) { PersonaServiceA5.new(cuit: '12345678912').tap { |ws| ws.wsaa.stubs auth: ta } }
7
+ let(:message) { ta.merge cuitRepresentada: '12345678912' }
8
+
9
+ context 'métodos API' do
10
+ it 'dummy' do
11
+ savon.expects(:dummy).returns(fixture('ws_sr_padron_a5/dummy/success'))
12
+ ws.dummy.should == { appserver: 'OK', authserver: 'OK', dbserver: 'OK' }
13
+ end
14
+
15
+ it 'get_persona' do
16
+ savon.expects(:get_persona)
17
+ .with(message: message.merge(idPersona: '98765432198'))
18
+ .returns(fixture('ws_sr_padron_a5/get_persona/success'))
19
+ ws.get_persona('98765432198').should have_key :datos_generales
20
+ end
21
+ end
22
+ end
23
+ end
@@ -55,7 +55,7 @@ module Afipws
55
55
  savon.expects(:detallada_lista_declaraciones).with(message: :any)
56
56
  .returns(fixture('wconsdeclaracion/detallada_lista_declaraciones/por_id_inexistente'))
57
57
  -> { ws.detallada_lista_declaraciones identificador_declaracion: '...' }
58
- .should raise_error WSError, '21248: Declaracion 19093SIMI000434. inexistente o invalida'
58
+ .should raise_error ResponseError, '21248: Declaracion 19093SIMI000434. inexistente o invalida'
59
59
  end
60
60
  end
61
61
 
@@ -51,7 +51,7 @@ module Afipws
51
51
  savon.expects(:get_persona)
52
52
  .with(message: message.merge(id_persona: '123'))
53
53
  .returns(fixture('ws_sr_constancia_inscripcion/get_persona/fault'))
54
- -> { ws.get_persona '123' }.should raise_error WSError, /No existe persona con ese Id/
54
+ -> { ws.get_persona '123' }.should raise_error ServerError, /No existe persona con ese Id/
55
55
  end
56
56
  end
57
57
 
@@ -39,12 +39,6 @@ module Afipws
39
39
  ta[:generation_time].should == Time.new(2011, 1, 12, 18, 57, 4, '-03:00')
40
40
  ta[:expiration_time].should == Time.new(2011, 1, 13, 6, 57, 4, '-03:00')
41
41
  end
42
-
43
- it 'debería encapsular SOAP Faults' do
44
- subject.stubs(:tra).returns('')
45
- savon.expects(:login_cms).with(message: :any).returns(fixture('wsaa/login_cms/fault'))
46
- -> { subject.login }.should raise_error WSError, /CMS no es valido/
47
- end
48
42
  end
49
43
 
50
44
  context 'auth' do
@@ -70,7 +70,7 @@ module Afipws
70
70
  it 'cuando la moneda no existe' do
71
71
  savon.expects(:fe_param_get_cotizacion).with(message: auth.merge(mon_id: 'PES')).returns(fixture('wsfe/fe_param_get_cotizacion/inexistente'))
72
72
  -> { ws.cotizacion('PES') }.should raise_error { |error|
73
- error.should be_a WSError
73
+ error.should be_a ResponseError
74
74
  error.message.should match /602: Sin Resultados/
75
75
  error.code?(602).should be true
76
76
  error.code?(603).should be false
@@ -195,9 +195,9 @@ module Afipws
195
195
  ws.solicitar_caea.should include caea: '21043476341977', fch_vig_desde: Date.new(2011, 0o2, 0o1)
196
196
  end
197
197
 
198
- it 'cuando hay otro error debería burbujearlo' do
198
+ it 'cuando encapsular errores' do
199
199
  savon.expects(:fecaea_solicitar).with(message: :any).returns(fixture('wsfe/fecaea_solicitar/error_distinto'))
200
- -> { ws.solicitar_caea }.should raise_error WSError, /15007/
200
+ -> { ws.solicitar_caea }.should raise_error ResponseError, /15007/
201
201
  end
202
202
  end
203
203
 
@@ -287,7 +287,7 @@ module Afipws
287
287
  it 'cuando hay un error' do
288
288
  savon.expects(:fe_param_get_tipos_cbte).with(message: :any).returns(fixture('wsfe/fe_param_get_tipos_cbte/failure_1_error'))
289
289
  -> { ws.tipos_comprobantes }.should raise_error { |e|
290
- e.should be_a WSError
290
+ e.should be_a ResponseError
291
291
  e.errors.should == [{ code: '600', msg: 'No se corresponden token con firma' }]
292
292
  e.message.should == '600: No se corresponden token con firma'
293
293
  }
@@ -296,8 +296,11 @@ module Afipws
296
296
  it 'cuando hay varios errores' do
297
297
  savon.expects(:fe_param_get_tipos_cbte).with(message: :any).returns(fixture('wsfe/fe_param_get_tipos_cbte/failure_2_errors'))
298
298
  -> { ws.tipos_comprobantes }.should raise_error { |e|
299
- e.should be_a WSError
300
- e.errors.should == [{ code: '600', msg: 'No se corresponden token con firma' }, { code: '601', msg: 'CUIT representada no incluida en token' }]
299
+ e.should be_a ResponseError
300
+ e.errors.should == [
301
+ { code: '600', msg: 'No se corresponden token con firma' },
302
+ { code: '601', msg: 'CUIT representada no incluida en token' }
303
+ ]
301
304
  e.message.should == '600: No se corresponden token con firma; 601: CUIT representada no incluida en token'
302
305
  }
303
306
  end
@@ -0,0 +1,283 @@
1
+ <wsdl:definitions name="PersonaServiceA5" targetNamespace="http://a5.soap.ws.server.puc.sr/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://a5.soap.ws.server.puc.sr/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
2
+ <wsdl:types>
3
+ <xs:schema elementFormDefault="unqualified" targetNamespace="http://a5.soap.ws.server.puc.sr/" version="1.0" xmlns:tns="http://a5.soap.ws.server.puc.sr/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
4
+ <xs:element name="dummy" type="tns:dummy"/>
5
+ <xs:element name="dummyResponse" type="tns:dummyResponse"/>
6
+ <xs:element name="getPersona" type="tns:getPersona"/>
7
+ <xs:element name="getPersonaList" type="tns:getPersonaList"/>
8
+ <xs:element name="getPersonaListResponse" type="tns:getPersonaListResponse"/>
9
+ <xs:element name="getPersonaResponse" type="tns:getPersonaResponse"/>
10
+ <xs:complexType name="getPersona">
11
+ <xs:sequence>
12
+ <xs:element name="token" type="xs:string"/>
13
+ <xs:element name="sign" type="xs:string"/>
14
+ <xs:element name="cuitRepresentada" type="xs:long"/>
15
+ <xs:element name="idPersona" type="xs:long"/>
16
+ </xs:sequence>
17
+ </xs:complexType>
18
+ <xs:complexType name="getPersonaResponse">
19
+ <xs:sequence>
20
+ <xs:element minOccurs="0" name="personaReturn" type="tns:personaReturn"/>
21
+ </xs:sequence>
22
+ </xs:complexType>
23
+ <xs:complexType name="personaReturn">
24
+ <xs:sequence>
25
+ <xs:element minOccurs="0" name="datosGenerales" type="tns:datosGenerales"/>
26
+ <xs:element minOccurs="0" name="datosMonotributo" type="tns:datosMonotributo"/>
27
+ <xs:element minOccurs="0" name="datosRegimenGeneral" type="tns:datosRegimenGeneral"/>
28
+ <xs:element minOccurs="0" name="errorConstancia" type="tns:errorConstancia"/>
29
+ <xs:element minOccurs="0" name="errorMonotributo" type="tns:errorMonotributo"/>
30
+ <xs:element minOccurs="0" name="errorRegimenGeneral" type="tns:errorRegimenGeneral"/>
31
+ <xs:element minOccurs="0" name="metadata" type="tns:metadata"/>
32
+ </xs:sequence>
33
+ </xs:complexType>
34
+ <xs:complexType name="datosGenerales">
35
+ <xs:sequence>
36
+ <xs:element minOccurs="0" name="apellido" type="xs:string"/>
37
+ <xs:element minOccurs="0" name="dependencia" type="tns:dependencia"/>
38
+ <xs:element minOccurs="0" name="domicilioFiscal" type="tns:domicilio"/>
39
+ <xs:element minOccurs="0" name="estadoClave" type="xs:string"/>
40
+ <xs:element minOccurs="0" name="fechaContratoSocial" type="xs:dateTime"/>
41
+ <xs:element minOccurs="0" name="idPersona" type="xs:long"/>
42
+ <xs:element minOccurs="0" name="mesCierre" type="xs:int"/>
43
+ <xs:element minOccurs="0" name="nombre" type="xs:string"/>
44
+ <xs:element minOccurs="0" name="razonSocial" type="xs:string"/>
45
+ <xs:element minOccurs="0" name="tipoClave" type="xs:string"/>
46
+ <xs:element minOccurs="0" name="tipoPersona" type="xs:string"/>
47
+ </xs:sequence>
48
+ </xs:complexType>
49
+ <xs:complexType name="dependencia">
50
+ <xs:sequence>
51
+ <xs:element minOccurs="0" name="codPostal" type="xs:string"/>
52
+ <xs:element minOccurs="0" name="descripcionDependencia" type="xs:string"/>
53
+ <xs:element minOccurs="0" name="descripcionProvincia" type="xs:string"/>
54
+ <xs:element minOccurs="0" name="direccion" type="xs:string"/>
55
+ <xs:element minOccurs="0" name="idDependencia" type="xs:int"/>
56
+ <xs:element minOccurs="0" name="idProvincia" type="xs:int"/>
57
+ <xs:element minOccurs="0" name="localidad" type="xs:string"/>
58
+ </xs:sequence>
59
+ </xs:complexType>
60
+ <xs:complexType name="domicilio">
61
+ <xs:sequence>
62
+ <xs:element minOccurs="0" name="codPostal" type="xs:string"/>
63
+ <xs:element minOccurs="0" name="datoAdicional" type="xs:string"/>
64
+ <xs:element minOccurs="0" name="descripcionProvincia" type="xs:string"/>
65
+ <xs:element minOccurs="0" name="direccion" type="xs:string"/>
66
+ <xs:element minOccurs="0" name="idProvincia" type="xs:int"/>
67
+ <xs:element minOccurs="0" name="localidad" type="xs:string"/>
68
+ <xs:element minOccurs="0" name="tipoDatoAdicional" type="xs:string"/>
69
+ <xs:element minOccurs="0" name="tipoDomicilio" type="xs:string"/>
70
+ </xs:sequence>
71
+ </xs:complexType>
72
+ <xs:complexType name="datosMonotributo">
73
+ <xs:sequence>
74
+ <xs:element minOccurs="0" name="actividadMonotributista" type="tns:actividad"/>
75
+ <xs:element minOccurs="0" name="categoriaMonotributo" type="tns:categoria"/>
76
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="componenteDeSociedad" nillable="true" type="tns:relacion"/>
77
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="impuesto" nillable="true" type="tns:impuesto"/>
78
+ </xs:sequence>
79
+ </xs:complexType>
80
+ <xs:complexType name="actividad">
81
+ <xs:sequence>
82
+ <xs:element minOccurs="0" name="descripcionActividad" type="xs:string"/>
83
+ <xs:element minOccurs="0" name="idActividad" type="xs:long"/>
84
+ <xs:element minOccurs="0" name="nomenclador" type="xs:int"/>
85
+ <xs:element minOccurs="0" name="orden" type="xs:int"/>
86
+ <xs:element minOccurs="0" name="periodo" type="xs:int"/>
87
+ </xs:sequence>
88
+ </xs:complexType>
89
+ <xs:complexType name="categoria">
90
+ <xs:sequence>
91
+ <xs:element minOccurs="0" name="descripcionCategoria" type="xs:string"/>
92
+ <xs:element minOccurs="0" name="idCategoria" type="xs:int"/>
93
+ <xs:element minOccurs="0" name="idImpuesto" type="xs:int"/>
94
+ <xs:element minOccurs="0" name="periodo" type="xs:int"/>
95
+ </xs:sequence>
96
+ </xs:complexType>
97
+ <xs:complexType name="relacion">
98
+ <xs:sequence>
99
+ <xs:element minOccurs="0" name="apellidoPersonaAsociada" type="xs:string"/>
100
+ <xs:element minOccurs="0" name="ffRelacion" type="xs:dateTime"/>
101
+ <xs:element minOccurs="0" name="ffVencimiento" type="xs:dateTime"/>
102
+ <xs:element minOccurs="0" name="idPersonaAsociada" type="xs:long"/>
103
+ <xs:element minOccurs="0" name="nombrePersonaAsociada" type="xs:string"/>
104
+ <xs:element minOccurs="0" name="razonSocialPersonaAsociada" type="xs:string"/>
105
+ <xs:element minOccurs="0" name="tipoComponente" type="xs:string"/>
106
+ </xs:sequence>
107
+ </xs:complexType>
108
+ <xs:complexType name="impuesto">
109
+ <xs:sequence>
110
+ <xs:element minOccurs="0" name="descripcionImpuesto" type="xs:string"/>
111
+ <xs:element minOccurs="0" name="idImpuesto" type="xs:int"/>
112
+ <xs:element minOccurs="0" name="periodo" type="xs:int"/>
113
+ </xs:sequence>
114
+ </xs:complexType>
115
+ <xs:complexType name="datosRegimenGeneral">
116
+ <xs:sequence>
117
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="actividad" nillable="true" type="tns:actividad"/>
118
+ <xs:element minOccurs="0" name="categoriaAutonomo" type="tns:categoria"/>
119
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="impuesto" nillable="true" type="tns:impuesto"/>
120
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="regimen" nillable="true" type="tns:regimen"/>
121
+ </xs:sequence>
122
+ </xs:complexType>
123
+ <xs:complexType name="regimen">
124
+ <xs:sequence>
125
+ <xs:element minOccurs="0" name="descripcionRegimen" type="xs:string"/>
126
+ <xs:element minOccurs="0" name="idImpuesto" type="xs:int"/>
127
+ <xs:element minOccurs="0" name="idRegimen" type="xs:int"/>
128
+ <xs:element minOccurs="0" name="periodo" type="xs:int"/>
129
+ <xs:element minOccurs="0" name="tipoRegimen" type="xs:string"/>
130
+ </xs:sequence>
131
+ </xs:complexType>
132
+ <xs:complexType name="errorConstancia">
133
+ <xs:sequence>
134
+ <xs:element minOccurs="0" name="apellido" type="xs:string"/>
135
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="error" nillable="true" type="xs:string"/>
136
+ <xs:element minOccurs="0" name="idPersona" type="xs:long"/>
137
+ <xs:element minOccurs="0" name="nombre" type="xs:string"/>
138
+ </xs:sequence>
139
+ </xs:complexType>
140
+ <xs:complexType name="errorMonotributo">
141
+ <xs:sequence>
142
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="error" nillable="true" type="xs:string"/>
143
+ <xs:element minOccurs="0" name="mensaje" type="xs:string"/>
144
+ </xs:sequence>
145
+ </xs:complexType>
146
+ <xs:complexType name="errorRegimenGeneral">
147
+ <xs:sequence>
148
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="error" nillable="true" type="xs:string"/>
149
+ <xs:element minOccurs="0" name="mensaje" type="xs:string"/>
150
+ </xs:sequence>
151
+ </xs:complexType>
152
+ <xs:complexType name="metadata">
153
+ <xs:sequence>
154
+ <xs:element minOccurs="0" name="fechaHora" type="xs:dateTime"/>
155
+ <xs:element minOccurs="0" name="servidor" type="xs:string"/>
156
+ </xs:sequence>
157
+ </xs:complexType>
158
+ <xs:complexType name="getPersonaList">
159
+ <xs:sequence>
160
+ <xs:element name="token" type="xs:string"/>
161
+ <xs:element name="sign" type="xs:string"/>
162
+ <xs:element name="cuitRepresentada" type="xs:long"/>
163
+ <xs:element maxOccurs="unbounded" name="idPersona" type="xs:long"/>
164
+ </xs:sequence>
165
+ </xs:complexType>
166
+ <xs:complexType name="getPersonaListResponse">
167
+ <xs:sequence>
168
+ <xs:element minOccurs="0" name="personaListReturn" type="tns:personaListReturn"/>
169
+ </xs:sequence>
170
+ </xs:complexType>
171
+ <xs:complexType name="personaListReturn">
172
+ <xs:sequence>
173
+ <xs:element minOccurs="0" name="metadata" type="tns:metadata"/>
174
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="persona" nillable="true" type="tns:persona"/>
175
+ </xs:sequence>
176
+ </xs:complexType>
177
+ <xs:complexType name="persona">
178
+ <xs:sequence>
179
+ <xs:element minOccurs="0" name="datosGenerales" type="tns:datosGenerales"/>
180
+ <xs:element minOccurs="0" name="datosMonotributo" type="tns:datosMonotributo"/>
181
+ <xs:element minOccurs="0" name="datosRegimenGeneral" type="tns:datosRegimenGeneral"/>
182
+ <xs:element minOccurs="0" name="errorConstancia" type="tns:errorConstancia"/>
183
+ <xs:element minOccurs="0" name="errorMonotributo" type="tns:errorMonotributo"/>
184
+ <xs:element minOccurs="0" name="errorRegimenGeneral" type="tns:errorRegimenGeneral"/>
185
+ </xs:sequence>
186
+ </xs:complexType>
187
+ <xs:complexType name="dummy">
188
+ <xs:sequence/>
189
+ </xs:complexType>
190
+ <xs:complexType name="dummyResponse">
191
+ <xs:sequence>
192
+ <xs:element minOccurs="0" name="return" type="tns:dummyReturn"/>
193
+ </xs:sequence>
194
+ </xs:complexType>
195
+ <xs:complexType name="dummyReturn">
196
+ <xs:sequence>
197
+ <xs:element minOccurs="0" name="appserver" type="xs:string"/>
198
+ <xs:element minOccurs="0" name="authserver" type="xs:string"/>
199
+ <xs:element minOccurs="0" name="dbserver" type="xs:string"/>
200
+ </xs:sequence>
201
+ </xs:complexType>
202
+ </xs:schema>
203
+ </wsdl:types>
204
+ <wsdl:message name="getPersonaListResponse">
205
+ <wsdl:part element="tns:getPersonaListResponse" name="parameters">
206
+ </wsdl:part>
207
+ </wsdl:message>
208
+ <wsdl:message name="dummyResponse">
209
+ <wsdl:part element="tns:dummyResponse" name="parameters">
210
+ </wsdl:part>
211
+ </wsdl:message>
212
+ <wsdl:message name="getPersona">
213
+ <wsdl:part element="tns:getPersona" name="parameters">
214
+ </wsdl:part>
215
+ </wsdl:message>
216
+ <wsdl:message name="getPersonaList">
217
+ <wsdl:part element="tns:getPersonaList" name="parameters">
218
+ </wsdl:part>
219
+ </wsdl:message>
220
+ <wsdl:message name="getPersonaResponse">
221
+ <wsdl:part element="tns:getPersonaResponse" name="parameters">
222
+ </wsdl:part>
223
+ </wsdl:message>
224
+ <wsdl:message name="dummy">
225
+ <wsdl:part element="tns:dummy" name="parameters">
226
+ </wsdl:part>
227
+ </wsdl:message>
228
+ <wsdl:portType name="PersonaServiceA5">
229
+ <wsdl:operation name="getPersona">
230
+ <wsdl:input message="tns:getPersona" name="getPersona">
231
+ </wsdl:input>
232
+ <wsdl:output message="tns:getPersonaResponse" name="getPersonaResponse">
233
+ </wsdl:output>
234
+ </wsdl:operation>
235
+ <wsdl:operation name="getPersonaList">
236
+ <wsdl:input message="tns:getPersonaList" name="getPersonaList">
237
+ </wsdl:input>
238
+ <wsdl:output message="tns:getPersonaListResponse" name="getPersonaListResponse">
239
+ </wsdl:output>
240
+ </wsdl:operation>
241
+ <wsdl:operation name="dummy">
242
+ <wsdl:input message="tns:dummy" name="dummy">
243
+ </wsdl:input>
244
+ <wsdl:output message="tns:dummyResponse" name="dummyResponse">
245
+ </wsdl:output>
246
+ </wsdl:operation>
247
+ </wsdl:portType>
248
+ <wsdl:binding name="PersonaServiceA5SoapBinding" type="tns:PersonaServiceA5">
249
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
250
+ <wsdl:operation name="getPersona">
251
+ <soap:operation soapAction="" style="document"/>
252
+ <wsdl:input name="getPersona">
253
+ <soap:body use="literal"/>
254
+ </wsdl:input>
255
+ <wsdl:output name="getPersonaResponse">
256
+ <soap:body use="literal"/>
257
+ </wsdl:output>
258
+ </wsdl:operation>
259
+ <wsdl:operation name="getPersonaList">
260
+ <soap:operation soapAction="" style="document"/>
261
+ <wsdl:input name="getPersonaList">
262
+ <soap:body use="literal"/>
263
+ </wsdl:input>
264
+ <wsdl:output name="getPersonaListResponse">
265
+ <soap:body use="literal"/>
266
+ </wsdl:output>
267
+ </wsdl:operation>
268
+ <wsdl:operation name="dummy">
269
+ <soap:operation soapAction="" style="document"/>
270
+ <wsdl:input name="dummy">
271
+ <soap:body use="literal"/>
272
+ </wsdl:input>
273
+ <wsdl:output name="dummyResponse">
274
+ <soap:body use="literal"/>
275
+ </wsdl:output>
276
+ </wsdl:operation>
277
+ </wsdl:binding>
278
+ <wsdl:service name="PersonaServiceA5">
279
+ <wsdl:port binding="tns:PersonaServiceA5SoapBinding" name="PersonaServiceA5Port">
280
+ <soap:address location="https://aws.afip.gov.ar/sr-padron/webservices/personaServiceA5"/>
281
+ </wsdl:port>
282
+ </wsdl:service>
283
+ </wsdl:definitions>
@@ -0,0 +1,11 @@
1
+ <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
2
+ <soap:Body>
3
+ <ns2:dummyResponse xmlns:ns2="http://a100.soap.ws.server.pucParam.sr/">
4
+ <return>
5
+ <appserver>OK</appserver>
6
+ <authserver>OK</authserver>
7
+ <dbserver>OK</dbserver>
8
+ </return>
9
+ </ns2:dummyResponse>
10
+ </soap:Body>
11
+ </soap:Envelope>
@@ -0,0 +1,62 @@
1
+ <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
2
+ <soap:Body>
3
+ <ns2:getPersonaResponse xmlns:ns2="http://a5.soap.ws.server.puc.sr/">
4
+ <personaReturn>
5
+ <datosGenerales>
6
+ <apellido>ALEXA</apellido>
7
+ <dependencia>
8
+ <codPostal>5000</codPostal>
9
+ <descripcionDependencia>AGENCIA-SEDE N.1 CORDOBA</descripcionDependencia>
10
+ <descripcionProvincia>CORDOBA</descripcionProvincia>
11
+ <direccion>BOULEVARD SAN JUAN 325 PB</direccion>
12
+ <idDependencia>272</idDependencia>
13
+ <idProvincia>3</idProvincia>
14
+ <localidad>CORDOBA</localidad>
15
+ </dependencia>
16
+ <domicilioFiscal>
17
+ <codPostal>5152</codPostal>
18
+ <descripcionProvincia>CORDOBA</descripcionProvincia>
19
+ <direccion>SAN MARTIN 256</direccion>
20
+ <idProvincia>3</idProvincia>
21
+ <localidad>VILLA CARLOS PAZ</localidad>
22
+ <tipoDomicilio>FISCAL</tipoDomicilio>
23
+ </domicilioFiscal>
24
+ <estadoClave>ACTIVO</estadoClave>
25
+ <idPersona>27255820422</idPersona>
26
+ <mesCierre>12</mesCierre>
27
+ <nombre>HILARY</nombre>
28
+ <tipoClave>CUIT</tipoClave>
29
+ <tipoPersona>FISICA</tipoPersona>
30
+ </datosGenerales>
31
+ <datosMonotributo>
32
+ <actividadMonotributista>
33
+ <descripcionActividad>VENTAS</descripcionActividad>
34
+ <idActividad>10</idActividad>
35
+ <nomenclador>1</nomenclador>
36
+ <orden>0</orden>
37
+ <periodo>201007</periodo>
38
+ </actividadMonotributista>
39
+ <categoriaMonotributo>
40
+ <descripcionCategoria>C VENTAS DE COSAS MUEBLES</descripcionCategoria>
41
+ <idCategoria>45</idCategoria>
42
+ <idImpuesto>20</idImpuesto>
43
+ <periodo>201007</periodo>
44
+ </categoriaMonotributo>
45
+ <componenteDeSociedad>
46
+ <ffRelacion>2008-11-25T06:41:21-03:00</ffRelacion>
47
+ <idPersonaAsociada>23168373384</idPersonaAsociada>
48
+ </componenteDeSociedad>
49
+ <impuesto>
50
+ <descripcionImpuesto>MONOTRIBUTO</descripcionImpuesto>
51
+ <idImpuesto>20</idImpuesto>
52
+ <periodo>201007</periodo>
53
+ </impuesto>
54
+ </datosMonotributo>
55
+ <metadata>
56
+ <fechaHora>2017-01-06T11:47:40.464-03:00</fechaHora>
57
+ <servidor>aws.afip.gob.ar</servidor>
58
+ </metadata>
59
+ </personaReturn>
60
+ </ns2:getPersonaResponse>
61
+ </soap:Body>
62
+ </soap:Envelope>
@@ -24,14 +24,14 @@ end
24
24
 
25
25
  class HasXPath
26
26
  include RSpec::Matchers
27
-
27
+
28
28
  def initialize(paths)
29
29
  @paths = paths
30
30
  end
31
-
31
+
32
32
  def verify! xml
33
33
  @actual_xml = xml
34
- @paths.each do |(path, value)|
34
+ @paths.each do |(path, value)|
35
35
  @expected_xpath, @expected_value = path, value
36
36
  @actual_xml.should match_xpath @expected_xpath, @expected_value
37
37
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: afipws
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emmanuel Nicolau
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-02 00:00:00.000000000 Z
11
+ date: 2020-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: 2.11.0
125
+ - !ruby/object:Gem::Dependency
126
+ name: httpclient
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: nokogiri
127
141
  requirement: !ruby/object:Gem::Requirement
@@ -153,7 +167,8 @@ dependencies:
153
167
  description: ''
154
168
  email:
155
169
  - emmanicolau@gmail.com
156
- executables: []
170
+ executables:
171
+ - console
157
172
  extensions: []
158
173
  extra_rdoc_files: []
159
174
  files:
@@ -169,21 +184,29 @@ files:
169
184
  - README.md
170
185
  - Rakefile
171
186
  - afipws.gemspec
187
+ - bin/console
188
+ - lib/CHANGELOG.md
172
189
  - lib/afipws.rb
173
190
  - lib/afipws/client.rb
174
191
  - lib/afipws/core_ext/hash.rb
192
+ - lib/afipws/errors/error.rb
193
+ - lib/afipws/errors/network_error.rb
194
+ - lib/afipws/errors/response_error.rb
195
+ - lib/afipws/errors/server_error.rb
175
196
  - lib/afipws/persona_service_a100.rb
176
197
  - lib/afipws/persona_service_a4.rb
198
+ - lib/afipws/persona_service_a5.rb
177
199
  - lib/afipws/type_conversions.rb
178
200
  - lib/afipws/version.rb
179
201
  - lib/afipws/w_cons_declaracion.rb
180
202
  - lib/afipws/ws_constancia_inscripcion.rb
181
203
  - lib/afipws/wsaa.rb
182
- - lib/afipws/wserror.rb
183
204
  - lib/afipws/wsfe.rb
205
+ - spec/afipws/client_spec.rb
184
206
  - spec/afipws/core_ext/hash_spec.rb
185
207
  - spec/afipws/persona_service_a100_spec.rb
186
208
  - spec/afipws/persona_service_a4_spec.rb
209
+ - spec/afipws/persona_service_a5_spec.rb
187
210
  - spec/afipws/test.crt
188
211
  - spec/afipws/test.key
189
212
  - spec/afipws/type_conversions_spec.rb
@@ -210,6 +233,9 @@ files:
210
233
  - spec/fixtures/ws_sr_padron_a4.wsdl
211
234
  - spec/fixtures/ws_sr_padron_a4/dummy/success.xml
212
235
  - spec/fixtures/ws_sr_padron_a4/get_persona/success.xml
236
+ - spec/fixtures/ws_sr_padron_a5.wsdl
237
+ - spec/fixtures/ws_sr_padron_a5/dummy/success.xml
238
+ - spec/fixtures/ws_sr_padron_a5/get_persona/success.xml
213
239
  - spec/fixtures/wsaa/login_cms/fault.xml
214
240
  - spec/fixtures/wsaa/login_cms/success.xml
215
241
  - spec/fixtures/wsaa/login_cms/token_expirado.xml
@@ -250,7 +276,7 @@ files:
250
276
  homepage: https://github.com/eeng/afipws
251
277
  licenses: []
252
278
  metadata: {}
253
- post_install_message:
279
+ post_install_message:
254
280
  rdoc_options: []
255
281
  require_paths:
256
282
  - lib
@@ -266,14 +292,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
266
292
  version: '0'
267
293
  requirements: []
268
294
  rubyforge_project: afipws
269
- rubygems_version: 2.5.1
270
- signing_key:
295
+ rubygems_version: 2.7.3
296
+ signing_key:
271
297
  specification_version: 4
272
298
  summary: Ruby client para los web services de la AFIP
273
299
  test_files:
300
+ - spec/afipws/client_spec.rb
274
301
  - spec/afipws/core_ext/hash_spec.rb
275
302
  - spec/afipws/persona_service_a100_spec.rb
276
303
  - spec/afipws/persona_service_a4_spec.rb
304
+ - spec/afipws/persona_service_a5_spec.rb
277
305
  - spec/afipws/test.crt
278
306
  - spec/afipws/test.key
279
307
  - spec/afipws/type_conversions_spec.rb
@@ -300,6 +328,9 @@ test_files:
300
328
  - spec/fixtures/ws_sr_padron_a4.wsdl
301
329
  - spec/fixtures/ws_sr_padron_a4/dummy/success.xml
302
330
  - spec/fixtures/ws_sr_padron_a4/get_persona/success.xml
331
+ - spec/fixtures/ws_sr_padron_a5.wsdl
332
+ - spec/fixtures/ws_sr_padron_a5/dummy/success.xml
333
+ - spec/fixtures/ws_sr_padron_a5/get_persona/success.xml
303
334
  - spec/fixtures/wsaa/login_cms/fault.xml
304
335
  - spec/fixtures/wsaa/login_cms/success.xml
305
336
  - spec/fixtures/wsaa/login_cms/token_expirado.xml
@@ -1,19 +0,0 @@
1
- module Afipws
2
- class WSError < StandardError
3
- attr_reader :errors
4
-
5
- def initialize errors
6
- if errors.is_a? Array
7
- super errors.map { |e| "#{e[:code]}: #{e[:msg]}" }.join '; '
8
- @errors = errors
9
- else
10
- super
11
- @errors = []
12
- end
13
- end
14
-
15
- def code? code
16
- @errors.any? { |e| e[:code].to_s == code.to_s }
17
- end
18
- end
19
- end