lib/active_merchant/billing/gateways/optimal_payment.rb in activemerchant-1.44.1 vs lib/active_merchant/billing/gateways/optimal_payment.rb in activemerchant-1.45.0
- old
+ new
@@ -94,18 +94,23 @@
#when 'ccAuthenticate'
# cc_authenticate_request(money, post)
else
raise 'Unknown Action'
end
- txnRequest = URI.encode(xml)
+ txnRequest = escape_uri(xml)
response = parse(ssl_post(test? ? self.test_url : self.live_url, "txnMode=#{action}&txnRequest=#{txnRequest}"))
Response.new(successful?(response), message_from(response), hash_from_xml(response),
:test => test?,
:authorization => authorization_from(response),
:avs_result => { :code => avs_result_from(response) },
:cvv_result => cvv_result_from(response)
)
+ end
+
+ # The upstream is picky and so we can't use CGI.escape like we want to
+ def escape_uri(uri)
+ URI::DEFAULT_PARSER.escape(uri)
end
def successful?(response)
REXML::XPath.first(response, '//decision').text == 'ACCEPTED' rescue false
end