lib/active_merchant/billing/gateways/cyber_source.rb in activemerchant-1.58.0 vs lib/active_merchant/billing/gateways/cyber_source.rb in activemerchant-1.59.0

- old
+ new

@@ -28,12 +28,12 @@ # network, your Cybersource merchant account must accept pinless # debit card payments. # * The order of the XML elements does matter, make sure to follow the order in # the documentation exactly. class CyberSourceGateway < Gateway - self.test_url = 'https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor' - self.live_url = 'https://ics2ws.ic3.com/commerce/1.x/transactionProcessor' + self.test_url = 'https://ics2wstesta.ic3.com/commerce/1.x/transactionProcessor' + self.live_url = 'https://ics2wsa.ic3.com/commerce/1.x/transactionProcessor' XSD_VERSION = "1.121" # visa, master, american_express, discover self.supported_cardtypes = [:visa, :master, :american_express, :discover] @@ -681,10 +681,14 @@ end # Contact CyberSource, make the SOAP request, and parse the reply into a # Response object def commit(request, options) - response = parse(ssl_post(test? ? self.test_url : self.live_url, build_request(request, options))) + begin + response = parse(ssl_post(test? ? self.test_url : self.live_url, build_request(request, options))) + rescue ResponseError => e + response = parse(e.response.body) + end success = response[:decision] == "ACCEPT" message = @@response_codes[('r' + response[:reasonCode]).to_sym] rescue response[:message] authorization = success ? [ options[:order_id], response[:requestID], response[:requestToken] ].compact.join(";") : nil