Class: Afipws::PersonaServiceA4

Inherits:
Object
  • Object
show all
Defined in:
lib/afipws/persona_service_a4.rb

Constant Summary collapse

WSDL =
{
  development: 'https://awshomo.afip.gov.ar/sr-padron/webservices/personaServiceA4?WSDL',
  production: 'https://aws.afip.gov.ar/sr-padron/webservices/personaServiceA4?WSDL',
  test: Root + '/spec/fixtures/ws_sr_padron_a4.wsdl'
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ PersonaServiceA4

Returns a new instance of PersonaServiceA4.



11
12
13
14
15
# File 'lib/afipws/persona_service_a4.rb', line 11

def initialize options = {}
  @cuit = options[:cuit]
  @wsaa = WSAA.new options.merge(service: 'ws_sr_padron_a4')
  @client = Client.new Hash(options[:savon]).reverse_merge(wsdl: WSDL[@wsaa.env], soap_version: 1)
end

Instance Attribute Details

#wsaaObject (readonly)

Returns the value of attribute wsaa.



9
10
11
# File 'lib/afipws/persona_service_a4.rb', line 9

def wsaa
  @wsaa
end

Instance Method Details

#dummyObject



17
18
19
# File 'lib/afipws/persona_service_a4.rb', line 17

def dummy
  request(:dummy)[:return]
end

#get_persona(id) ⇒ Object



21
22
23
24
# File 'lib/afipws/persona_service_a4.rb', line 21

def get_persona id
  message = @wsaa.auth.merge(cuitRepresentada: @cuit, idPersona: id)
  request(:get_persona, message)[:persona_return][:persona]
end