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