class CardConnect::Service::RefundResponse
Constants
- FIELDS
- STATUS_APPROVED
- STATUS_DECLINED
- STATUS_RETRY
Attributes
errors[R]
Public Class Methods
new(response)
click to toggle source
# File lib/cardconnect/services/refund/refund_response.rb, line 15 def initialize(response) set_attributes(response, FIELDS) @errors = [] process_errors end
Public Instance Methods
body()
click to toggle source
# File lib/cardconnect/services/refund/refund_response.rb, line 25 def body FIELDS.collect{|attr| {attr => send(attr)} }.reduce({}, :merge) end
success?()
click to toggle source
# File lib/cardconnect/services/refund/refund_response.rb, line 21 def success? errors.empty? end
Private Instance Methods
process_errors()
click to toggle source
# File lib/cardconnect/services/refund/refund_response.rb, line 31 def process_errors @errors << resptext if [STATUS_RETRY, STATUS_DECLINED].include?(respstat) end