Sha256: f936ba9543e28491ea400296ca066b6dc6b26c5cc9fb0fbf51b41af166dfb13b
Contents?: true
Size: 880 Bytes
Versions: 28
Compression:
Stored size: 880 Bytes
Contents
module Spreedly class Error < StandardError end class XmlErrorsList < Error attr_reader :errors include ErrorsParser def initialize(xml_doc) @errors = errors_from(xml_doc) end def message @errors.map { |each| each[:message] }.join("\n") end end class AuthenticationError < XmlErrorsList end class NotFoundError < XmlErrorsList end class TransactionCreationError < XmlErrorsList end class PaymentRequiredError < XmlErrorsList end class TimeoutError < Error def initialize(message = "The payment system is not responding.") super end end class UnexpectedResponseError < Error attr_reader :response def initialize(response) @response = response end def to_s "Failed with #{response.code} #{response.message if response.respond_to?(:message)}" end end end
Version data entries
28 entries across 28 versions & 1 rubygems