class Interfactura::Ruby::Client

Attributes

soap[R]

Public Class Methods

new(options = {}) click to toggle source
# File lib/interfactura/ruby/client.rb, line 10
def initialize(options = {})
  @soap = Savon.client(options)
end

Public Instance Methods

generate_document(invoice) click to toggle source
# File lib/interfactura/ruby/client.rb, line 14
def generate_document(invoice)
  response = @soap.call(:generar_documento, message: { sourceXmlDoc: invoice.to_xml, IsConsulta: true })
  result = response.body[:generar_documento_response][:generar_documento_result]
  puts "#{result}"
  Interfactura::Parser::Resultado.parse(result)
end