./lib/ews/transporter.rb in exact4r-0.9.3 vs ./lib/ews/transporter.rb in exact4r-1.0

- old
+ new

@@ -13,11 +13,11 @@ # service. # # Once configured to connect to a particular service, it can be used repeatedly # to send as many transactions as required. class Transporter - + # Initialize a Transporter. # # You can specify the URL you would like the Transporter to connect to, although it defaults # to https://api.e-xact.com, the location of our transaction processing web service. # @@ -28,10 +28,12 @@ # default <tt>transport_type</tt> is <tt>:rest</tt>. The default <tt>transport_type</tt> can be overridden on a per-transaction # basis, if you choose to do so, by specifying it as a parameter to the <tt>submit</tt> method. def initialize(url = "https://api.e-xact.com", options = {}) @url = URI.parse(url.gsub(/\/$/,'')) @transport_type = options[:transport_type] || :rest + + debugger @@issuer_cert ||= File.dirname(__FILE__)+"/../../certs/equifax_ca.cer" @@server_cert ||= File.new(File.dirname(__FILE__)+"/../../certs/exact.cer").read end @@ -50,10 +52,10 @@ transport_details = @@transport_types[transport_type] request = build_http_request(transaction, transport_type, transport_details[:suffix]) request.basic_auth(transaction.gateway_id, transaction.password) request.add_field "Accept", transport_details[:content_type] - request.add_field "User-Agent", "exact4r v0.9.1" + request.add_field "User-Agent", "exact4r v1.0" request.add_field "Content-type", "#{transport_details[:content_type]}; charset=UTF-8" response = get_connection.request(request) case response