Module: Jamef::Rating

Defined in:
lib/jamef/rating.rb,
lib/jamef/tracking.rb,
lib/jamef/rating/params.rb

Defined Under Namespace

Classes: Params

Constant Summary collapse

WSDL =
'https://www.jamef.com.br/webservice/JAMW0520.apw?WSDL'

Class Method Summary collapse

Class Method Details

.complete_rate(params) ⇒ Object



15
16
17
18
19
# File 'lib/jamef/rating.rb', line 15

def self.complete_rate params
  params = Jamef::Params.new(params)
  response = send_message(params)
  parse_response(response)
end

.custom_wsdl=(wsdl) ⇒ Object



9
10
11
# File 'lib/jamef/rating.rb', line 9

def self.custom_wsdl= wsdl
  @custom_wsdl = wsdl
end

.rate(params) ⇒ Object



21
22
23
# File 'lib/jamef/rating.rb', line 21

def self.rate params
  simplify_parsed_response(complete_rate(params))
end

.savon_clientObject



25
26
27
28
29
30
31
32
33
34
# File 'lib/jamef/rating.rb', line 25

def self.savon_client
  @savon_client ||= ::Savon.client do |globals|
    globals.convert_request_keys_to :upcase
    globals.headers({ 'X-Forwarded-Scheme' => 'https'})
    globals.wsdl wsdl
    globals.follow_redirects true
    globals.ssl_version :TLSv1_2
  end
  @savon_client
end