lib/active_merchant/billing/gateways/exact.rb in activemerchant-1.47.0 vs lib/active_merchant/billing/gateways/exact.rb in activemerchant-1.48.0
- old
+ new
@@ -66,10 +66,11 @@
def refund(money, authorization, options = {})
commit(:credit, build_capture_or_credit_request(money, authorization, options))
end
private
+
def build_request(action, body)
xml = Builder::XmlMarkup.new
xml.instruct!
xml.tag! 'env:Envelope', ENVELOPE_NAMESPACES do
@@ -166,9 +167,17 @@
:test => test?,
:authorization => authorization_from(response),
:avs_result => { :code => response[:avs] },
:cvv_result => response[:cvv2]
)
+
+ rescue ResponseError => e
+ case e.response.code
+ when '401'
+ return Response.new(false, "Invalid Login: #{e.response.body}", {}, :test => test?)
+ else
+ raise
+ end
end
def successful?(response)
response[:transaction_approved] == SUCCESS
end