Method: ActiveMerchant::ResponseError#to_s

Defined in:
lib/active_merchant/errors.rb

#to_sObject



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/active_merchant/errors.rb', line 25

def to_s
  if response.kind_of?(String)
    if response.start_with?('Failed')
      return response
    else
      return "Failed with #{response}"
    end
  end

  return response.message if response.respond_to?(:message) && response.message.start_with?('Failed')

  "Failed with #{response.code if response.respond_to?(:code)} #{response.message if response.respond_to?(:message)}"
end