Class: CardConnect::Service::InquireResponse
- Inherits:
-
Object
- Object
- CardConnect::Service::InquireResponse
- Includes:
- Utils
- Defined in:
- lib/cardconnect/services/inquire/inquire_response.rb
Constant Summary collapse
- FIELDS =
[ :merchid, :account, :amount, :currency, :retref, :respcode, :respproc, :respstat, :resptext, :setlstat, :capturedate, :batchid, :token, :authdate, :lastfour, :name, :settledate ].freeze
- AUTHORIZED =
Settlement Status
'Authorized'
- QUEUED =
Txn has not been Captured
'Queued for Capture'
- ACCEPTED =
Txn is in flight to Clearing House
'Accepted'
- REJECTED =
Txn was accepted for Settlement
'Rejected'
- ZERO_AMOUNT =
Txn was not accepted
'Zero Amount'
- VOIDED =
Txn was $0
'Voided'
- DECLINED =
Txn has been voided
'Declined'
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(response) ⇒ InquireResponse
constructor
A new instance of InquireResponse.
- #success? ⇒ Boolean
Methods included from Utils
#set_attributes, #symbolize_keys
Constructor Details
#initialize(response) ⇒ InquireResponse
Returns a new instance of InquireResponse.
24 25 26 27 |
# File 'lib/cardconnect/services/inquire/inquire_response.rb', line 24 def initialize(response) set_attributes(response, FIELDS) @errors = [] end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
22 23 24 |
# File 'lib/cardconnect/services/inquire/inquire_response.rb', line 22 def errors @errors end |
Instance Method Details
#body ⇒ Object
33 34 35 |
# File 'lib/cardconnect/services/inquire/inquire_response.rb', line 33 def body FIELDS.collect{|attr| {attr => send(attr)} }.reduce({}, :merge) end |
#success? ⇒ Boolean
29 30 31 |
# File 'lib/cardconnect/services/inquire/inquire_response.rb', line 29 def success? @errors.empty? end |