Class: Ipiranga::KM

Inherits:
Client show all
Defined in:
lib/ipiranga/client/km.rb

Instance Attribute Summary

Attributes inherited from Client

#password, #soap, #username, #wsdl

Instance Method Summary collapse

Methods inherited from Client

#has_credentials?, #initialize, #operation, #operations, #post

Constructor Details

This class inherits a constructor from Ipiranga::Client

Instance Method Details

#gerarPedidoAcumulo(&block) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/ipiranga/client/km.rb', line 13

def gerarPedidoAcumulo(&block)
  result = post_gerarPedidoAcumulo(&block).
             body_hash["gerarPedidoAcumuloResult"]

  raise RequestAlreadyExists.new(result) if result["codigoRetorno"] == "2"
  raise ::Exception.new(result) if result["codigoRetorno"] != "0"

  return result["codigoRequisicao"].to_i
end

#wsdl_urlObject



5
6
7
8
9
10
11
# File 'lib/ipiranga/client/km.rb', line 5

def wsdl_url
  if defined?(ENV["RAILS_ENV"]) && ENV["RAILS_ENV"] == "production"
    "https://b2b.ipiranga.com.br/csp/ensb2cws/cbpi.bs.km.pedido.Service.CLS?WSDL=1"
  else
    "https://b2bdv.ipiranga.com.br/csp/ensb2cws/cbpi.bs.km.pedido.Service.CLS?WSDL=1"
  end
end