Sha256: b15c2123e7aa66a25b0a7709f955ee9d9700f213dc9b3b53642842569e7c8bc0

Contents?: true

Size: 974 Bytes

Versions: 4

Compression:

Stored size: 974 Bytes

Contents

module Afipws
  class WSConstanciaInscripcion
    WSDL = {
      development: 'https://awshomo.afip.gov.ar/sr-padron/webservices/personaServiceA5?WSDL',
      production: 'https://aws.afip.gov.ar/sr-padron/webservices/personaServiceA5?WSDL',
      test: Root + '/spec/fixtures/ws_sr_constancia_inscripcion/ws_constancia_inscripcion.wsdl'
    }.freeze

    attr_reader :wsaa

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

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

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

    private

    def request action, body = nil
      @client.request(action, body).to_hash[:"#{action}_response"]
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
afipws-2.3.0 lib/afipws/ws_constancia_inscripcion.rb
afipws-2.2.0 lib/afipws/ws_constancia_inscripcion.rb
afipws-2.1.0 lib/afipws/ws_constancia_inscripcion.rb
afipws-2.0.0 lib/afipws/ws_constancia_inscripcion.rb