class CardConnect::Service::ProfilePutResponse

Constants

FIELDS
STATUS_APPROVED
STATUS_DECLINED
STATUS_RETRY

Attributes

errors[R]

Public Class Methods

new(response) click to toggle source
# File lib/cardconnect/services/profile/profile_put_response.rb, line 17
def initialize(response)
  set_attributes(response, FIELDS)
  @errors = []
  process_errors
end

Public Instance Methods

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

Private Instance Methods

process_errors() click to toggle source
# File lib/cardconnect/services/profile/profile_put_response.rb, line 33
def process_errors
  @errors << resptext if [STATUS_RETRY, STATUS_DECLINED].include?(respstat)
end