lib/jamef/rating.rb in jamef-api-0.5.5 vs lib/jamef/rating.rb in jamef-api-0.5.6

- old
+ new

@@ -4,10 +4,14 @@ # Bundler.require(:pry,:development) module Jamef module Rating + def self.custom_wsdl= wsdl + @custom_wsdl = wsdl + end + WSDL = 'https://www.jamef.com.br/webservice/JAMW0520.apw?WSDL' def self.complete_rate params params = Jamef::Params.new(params) response = send_message(params) @@ -19,19 +23,22 @@ end 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 private def self.wsdl - WSDL + @custom_wsdl || WSDL end def self.send_message params freight_response = savon_client.call(:jamw0520_05, message: params.freight_hash) delivery_response = savon_client.call(:jamw0520_04, message: params.delivery_hash) \ No newline at end of file