class CardConnect::Service::SettlementStatusResponse

Constants

FIELDS

Attributes

errors[R]

Public Class Methods

new(response) click to toggle source
# File lib/cardconnect/services/settlement_status/settlement_status_response.rb, line 11
def initialize(response)
  response = response.empty? ? response : response.first
  set_attributes(response, FIELDS)
  parse_transactions
  @errors = []
end

Public Instance Methods

body() click to toggle source
# File lib/cardconnect/services/settlement_status/settlement_status_response.rb, line 22
def body
  FIELDS.collect{|attr| {attr => send(attr)} }.reduce({}, :merge)
end
success?() click to toggle source
# File lib/cardconnect/services/settlement_status/settlement_status_response.rb, line 18
def success?
  errors.empty?
end

Private Instance Methods

parse_transactions() click to toggle source
# File lib/cardconnect/services/settlement_status/settlement_status_response.rb, line 28
def parse_transactions
  return if txns.nil?
  txns.each_with_index { |txn, i| txns[i] = symbolize_keys(txn) }
end