Class: Oca::Oep::Client
- Inherits:
-
BaseClient
- Object
- BaseClient
- Oca::Oep::Client
- Defined in:
- lib/oca-epak/oep/client.rb
Constant Summary collapse
- WSDL_URL =
"#{BASE_WSDL_URL}/oep_tracking/Oep_Track.asmx?wsdl".freeze
Constants inherited from BaseClient
BaseClient::BASE_WSDL_URL, BaseClient::FALSE_STRING
Instance Attribute Summary
Attributes inherited from BaseClient
Instance Method Summary collapse
-
#get_html_de_etiquetas_por_orden_or_numero_envio(opts = {}) ⇒ String
Returns the HTML for a label.
-
#get_pdf_de_etiquetas_por_orden_or_numero_envio(opts = {}) ⇒ String
Returns the PDF (Base64 encoded) String for a label.
-
#initialize(username, password) ⇒ Client
constructor
A new instance of Client.
Constructor Details
Instance Method Details
#get_html_de_etiquetas_por_orden_or_numero_envio(opts = {}) ⇒ String
Returns the HTML for a label
18 19 20 21 22 23 24 |
# File 'lib/oca-epak/oep/client.rb', line 18 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 |
#get_pdf_de_etiquetas_por_orden_or_numero_envio(opts = {}) ⇒ String
Returns the PDF (Base64 encoded) String for a label
33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/oca-epak/oep/client.rb', line 33 def get_pdf_de_etiquetas_por_orden_or_numero_envio(opts = {}) method = :get_pdf_de_etiquetas_por_orden_or_numero_envio opts = { "idOrdenRetiro" => opts[:id_orden_retiro], "nroEnvio" => opts[:nro_envio], "logisticaInversa" => opts.fetch(:logistica_inversa, FALSE_STRING).to_s } response = client.call(method, message: opts) parse_result(response, method) rescue Savon::SOAPFault => error msg = "Oca WS responded with:\n#{error.http.code}\n#{error}" raise Oca::Errors::BadRequest.new(msg) end |