Class: VaultedBilling::Transactions::Ipcommerce
- Inherits:
-
VaultedBilling::Transaction
- Object
- VaultedBilling::Transaction
- VaultedBilling::Transactions::Ipcommerce
- Defined in:
- lib/vaulted_billing/termcap/transactions/ipcommerce.rb
Constant Summary collapse
- CaptureStates =
%w( !! NotSet CannotCapture ReadyForCapture CapturePending Captured CaptureDeclined InProcess CapturedUndoPermitted CapturePendingUndoPermitted CaptureError CaptureUnknown BatchSent BatchSentUndoPermitted ).freeze
- TransactionStates =
%w( !! NotSet Declined Verified Authorized Adjusted Captured CaptureDeclined PartiallyCaptured Undone ReturnRequested PartialReturnRequested ReturnUndone Returned PartiallyReturned InProcess ErrorValidation ErrorUnknown ErrorConnecting ).freeze
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#approval_code ⇒ Object
Returns the value of attribute approval_code.
-
#batch_id ⇒ Object
Returns the value of attribute batch_id.
-
#captured_amount ⇒ Object
Returns the value of attribute captured_amount.
-
#captured_state ⇒ Object
Returns the value of attribute captured_state.
-
#captured_state_id ⇒ Object
Returns the value of attribute captured_state_id.
-
#captured_status_message ⇒ Object
Returns the value of attribute captured_status_message.
-
#id ⇒ Object
Returns the value of attribute id.
-
#raw_result ⇒ Object
Returns the value of attribute raw_result.
-
#transaction_state ⇒ Object
Returns the value of attribute transaction_state.
-
#transaction_state_id ⇒ Object
Returns the value of attribute transaction_state_id.
Instance Method Summary collapse
- #capture_failed? ⇒ Boolean
- #capture_pending? ⇒ Boolean
- #captured? ⇒ Boolean
- #failed? ⇒ Boolean
-
#initialize(input) ⇒ Ipcommerce
constructor
A new instance of Ipcommerce.
Constructor Details
#initialize(input) ⇒ Ipcommerce
Returns a new instance of Ipcommerce.
45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/vaulted_billing/termcap/transactions/ipcommerce.rb', line 45 def initialize(input) self.raw_result = input.to_s self.id = input['TransactionInformation']['TransactionId'] self.amount = input['TransactionInformation']['Amount'] self.approval_code = input['TransactionInformation']['ApprovalCode'] self.captured_amount = input['TransactionInformation']['CapturedAmount'] self.captured_state = CaptureStates[input['TransactionInformation']['CaptureState']] self.captured_state_id = input['TransactionInformation']['CaptureState'] self. = input['TransactionInformation']['CaptureStatusMessage'] self.transaction_state_id = input['TransactionInformation']['TransactionState'] self.transaction_state =TransactionStates[input['TransactionInformation']['TransactionState']] self.batch_id = input['TransactionInformation']['BatchId'] end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
19 20 21 |
# File 'lib/vaulted_billing/termcap/transactions/ipcommerce.rb', line 19 def amount @amount end |
#approval_code ⇒ Object
Returns the value of attribute approval_code.
20 21 22 |
# File 'lib/vaulted_billing/termcap/transactions/ipcommerce.rb', line 20 def approval_code @approval_code end |
#batch_id ⇒ Object
Returns the value of attribute batch_id.
27 28 29 |
# File 'lib/vaulted_billing/termcap/transactions/ipcommerce.rb', line 27 def batch_id @batch_id end |
#captured_amount ⇒ Object
Returns the value of attribute captured_amount.
21 22 23 |
# File 'lib/vaulted_billing/termcap/transactions/ipcommerce.rb', line 21 def captured_amount @captured_amount end |
#captured_state ⇒ Object
Returns the value of attribute captured_state.
22 23 24 |
# File 'lib/vaulted_billing/termcap/transactions/ipcommerce.rb', line 22 def captured_state @captured_state end |
#captured_state_id ⇒ Object
Returns the value of attribute captured_state_id.
23 24 25 |
# File 'lib/vaulted_billing/termcap/transactions/ipcommerce.rb', line 23 def captured_state_id @captured_state_id end |
#captured_status_message ⇒ Object
Returns the value of attribute captured_status_message.
24 25 26 |
# File 'lib/vaulted_billing/termcap/transactions/ipcommerce.rb', line 24 def @captured_status_message end |
#id ⇒ Object
Returns the value of attribute id.
18 19 20 |
# File 'lib/vaulted_billing/termcap/transactions/ipcommerce.rb', line 18 def id @id end |
#raw_result ⇒ Object
Returns the value of attribute raw_result.
17 18 19 |
# File 'lib/vaulted_billing/termcap/transactions/ipcommerce.rb', line 17 def raw_result @raw_result end |
#transaction_state ⇒ Object
Returns the value of attribute transaction_state.
26 27 28 |
# File 'lib/vaulted_billing/termcap/transactions/ipcommerce.rb', line 26 def transaction_state @transaction_state end |
#transaction_state_id ⇒ Object
Returns the value of attribute transaction_state_id.
25 26 27 |
# File 'lib/vaulted_billing/termcap/transactions/ipcommerce.rb', line 25 def transaction_state_id @transaction_state_id end |
Instance Method Details
#capture_failed? ⇒ Boolean
33 34 35 |
# File 'lib/vaulted_billing/termcap/transactions/ipcommerce.rb', line 33 def capture_failed? %w(CaptureDeclined CaptureError).include?(captured_state) end |
#capture_pending? ⇒ Boolean
37 38 39 |
# File 'lib/vaulted_billing/termcap/transactions/ipcommerce.rb', line 37 def capture_pending? %w(BatchSent InProcess).include?(captured_state) end |
#captured? ⇒ Boolean
29 30 31 |
# File 'lib/vaulted_billing/termcap/transactions/ipcommerce.rb', line 29 def captured? %w(Captured).include?(captured_state) end |
#failed? ⇒ Boolean
41 42 43 |
# File 'lib/vaulted_billing/termcap/transactions/ipcommerce.rb', line 41 def failed? %w(Declined CaptureDeclined ErrorValidation ErrorUnknown).include?(transaction_state) end |