lib/active_merchant/billing/gateways/cyber_source.rb in activemerchant-1.80.0 vs lib/active_merchant/billing/gateways/cyber_source.rb in activemerchant-1.81.0

- old
+ new

@@ -354,11 +354,11 @@ add_creditcard_payment_method(xml) end add_subscription(xml, options) if options[:setup_fee] if card_brand(payment_method) == 'check' - add_check_service(xml, options) + add_check_service(xml) else add_purchase_service(xml, payment_method, options) add_payment_network_token(xml) if network_tokenization?(payment_method) end end @@ -706,12 +706,16 @@ # Contact CyberSource, make the SOAP request, and parse the reply into a # Response object def commit(request, action, amount, options) begin - response = parse(ssl_post(test? ? self.test_url : self.live_url, build_request(request, options))) + raw_response = ssl_post(test? ? self.test_url : self.live_url, build_request(request, options)) rescue ResponseError => e - response = parse(e.response.body) + raw_response = e.response.body + end + + begin + response = parse(raw_response) rescue REXML::ParseException => e response = { message: e.to_s } end success = response[:decision] == 'ACCEPT'