Sha256: 56d23296fbd2aa3a64d46e0e3fa75d64eb0673987d055fb626fe2c34d6ec5510

Contents?: true

Size: 921 Bytes

Versions: 1

Compression:

Stored size: 921 Bytes

Contents

module Afipws
  class WSConstanciaInscripcion < WSBase
    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_constancia_inscripcion.wsdl'
    }.freeze

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

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

    def get_persona id
      request(:get_persona, auth.merge(id_persona: id))[:persona_return]
    end

    def auth
      wsaa.auth.merge(cuit_representada: cuit)
    end

    private

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
afipws-1.0.4 lib/afipws/ws_constancia_inscripcion.rb