./lib/ews/transaction/mapping.rb in exact4r-0.6 vs ./lib/ews/transaction/mapping.rb in exact4r-0.7

- old
+ new

@@ -1,7 +1,6 @@ require 'builder' -require 'activesupport' module EWS # :nodoc: module Transaction # :nodoc: # This class handles encoding of transaction requests to the various transport formats, @@ -103,11 +102,11 @@ xml.target! end def self.json_to_response(content) response = EWS::Transaction::Response.new - ActiveSupport::JSON.decode(content).each { |k,v| response.send "#{k}=", v if response.respond_to?(k) } + ActiveSupport::JSON.decode(content).each { |k,v| response.send "#{k}=", v if response.respond_to?("#{k}=") } response end def self.rest_to_response(content) response = EWS::Transaction::Response.new xml = REXML::Document.new(content) @@ -167,24 +166,20 @@ end # type-conversion from strings for certain attributes ATTR_FORMATS = { :transaction_tag => "i", - :transaction_approved => "i", - :amount => "f", - :surcharge_amount => "f", - :tax1_amount => "f", - :tax2_amount => "f" + :transaction_approved => "i" } REQUEST_ENVELOPE_NAMESPACES = { "xmlns:xsd" => "http://www.w3.org/2001/XMLSchema", - "xmlns:env" => "http://schemas.xmlsoap.org/soap/envelope/", + "xmlns:soap" => "http://schemas.xmlsoap.org/soap/envelope/", "xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance" } REQUEST_SAC_ATTRIBUTES = { "xmlns:n1" => "http://secure2.e-xact.com/vplug-in/transaction/rpc-enc/Request", - "env:encodingStyle" => "http://schemas.xmlsoap.org/soap/encoding/" + "soap:encodingStyle" => "http://schemas.xmlsoap.org/soap/encoding/" } REQUEST_SAC_SOURCE_ATTRIBUTES = { "xmlns:n2" => "http://secure2.e-xact.com/vplug-in/transaction/rpc-enc/encodedTypes", "xsi:type" => "n2:Transaction" } \ No newline at end of file