Class: Oca::Oep::Client

Inherits:
BaseClient show all
Defined in:
lib/oca-epak/oep/client.rb

Constant Summary

Constants inherited from BaseClient

BaseClient::BASE_WSDL_URL

Instance Attribute Summary

Attributes inherited from BaseClient

#client, #password, #username

Instance Method Summary collapse

Constructor Details

#initialize(username, password) ⇒ Client

Returns a new instance of Client.


4
5
6
7
8
# File 'lib/oca-epak/oep/client.rb', line 4

def initialize(username, password)
  super
  wsdl_url = "#{BASE_WSDL_URL}/oep_tracking/Oep_Track.asmx?wsdl"
  @client = Savon.client(wsdl: wsdl_url)
end

Instance Method Details

#get_html_de_etiquetas_por_orden_or_numero_envio(opts = {}) ⇒ String

Returns the HTML for a label

Parameters:

  • opts (defaults to: {})
  • id_orden_retiro (Hash)

    a customizable set of options

  • nro_envio (Hash)

    a customizable set of options

Returns:

  • (String)

    HTML


16
17
18
19
20
21
22
# File 'lib/oca-epak/oep/client.rb', line 16

def get_html_de_etiquetas_por_orden_or_numero_envio(opts = {})
  method = :get_html_de_etiquetas_por_orden_or_numero_envio
  opts = { "idOrdenRetiro" => opts[:id_orden_retiro],
           "nroEnvio" => opts[:nro_envio] }
  response = client.call(method, message: opts)
  parse_result(response, method)
end