Class: BasecommSdk::BankAccountTransaction
- Defined in:
- lib/basecomm_sdk/bank_account_transaction.rb
Constant Summary collapse
- ACCOUNT_TYPE =
{ xs_bat_account_type_checking: 'CHECKING', xs_bat_account_type_savings: 'SAVINGS' }
- TYPE =
{ xs_bat_type_credit: 'CREDIT', xs_bat_type_debit: 'DEBIT', xs_bat_type_reversal: 'REVERSAL', xs_bat_type_cancel: 'CANCEL' }
- STATUS =
{ xs_bat_status_created: 'CREATED', xs_bat_status_initiated: 'INITIATED', xs_bat_status_settled: 'SETTLED', xs_bat_status_returned: 'RETURNED', xs_bat_status_canceled: 'CANCELED', xs_bat_status_failed: 'FAILED', xs_bat_status_rejected: 'REJECTED' }
- METHOD =
{ xs_bat_method_ccd: 'CCD', xs_bat_method_ppd: 'PPD', xs_bat_method_tel: 'TEL', xs_bat_method_web: 'WEB' }
Instance Attribute Summary collapse
-
#account_name ⇒ Object
Returns the value of attribute account_name.
-
#account_number ⇒ Object
Returns the value of attribute account_number.
-
#account_type ⇒ Object
Returns the value of attribute account_type.
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#bank_account_token ⇒ Object
Returns the value of attribute bank_account_token.
-
#custom_field1 ⇒ Object
Returns the value of attribute custom_field1.
-
#custom_field10 ⇒ Object
Returns the value of attribute custom_field10.
-
#custom_field2 ⇒ Object
Returns the value of attribute custom_field2.
-
#custom_field3 ⇒ Object
Returns the value of attribute custom_field3.
-
#custom_field4 ⇒ Object
Returns the value of attribute custom_field4.
-
#custom_field5 ⇒ Object
Returns the value of attribute custom_field5.
-
#custom_field6 ⇒ Object
Returns the value of attribute custom_field6.
-
#custom_field7 ⇒ Object
Returns the value of attribute custom_field7.
-
#custom_field8 ⇒ Object
Returns the value of attribute custom_field8.
-
#custom_field9 ⇒ Object
Returns the value of attribute custom_field9.
-
#effective_date ⇒ Object
Returns the value of attribute effective_date.
-
#id ⇒ Object
Returns the value of attribute id.
-
#merchant_transaction_id ⇒ Object
Returns the value of attribute merchant_transaction_id.
-
#method ⇒ Object
Returns the value of attribute method.
-
#micr_data ⇒ Object
Returns the value of attribute micr_data.
-
#recurring_indicator ⇒ Object
Returns the value of attribute recurring_indicator.
-
#return_code ⇒ Object
Returns the value of attribute return_code.
-
#return_date ⇒ Object
Returns the value of attribute return_date.
-
#routing_number ⇒ Object
Returns the value of attribute routing_number.
-
#settlement_date ⇒ Object
Returns the value of attribute settlement_date.
-
#status ⇒ Object
Returns the value of attribute status.
-
#trace ⇒ Object
Returns the value of attribute trace.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #correction? ⇒ Boolean
- #failed? ⇒ Boolean
- #json_prefix ⇒ Object
- #returned? ⇒ Boolean
- #settled? ⇒ Boolean
- #status_date ⇒ Object
Methods inherited from Base
attr_accessor, attributes, #attributes, #format, #initialize, json_prefix, #messages, #qualified_attributes, #qualified_key, #status_description, #status_name, #to_json
Constructor Details
This class inherits a constructor from BasecommSdk::Base
Instance Attribute Details
#account_name ⇒ Object
Returns the value of attribute account_name.
29 30 31 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 29 def account_name @account_name end |
#account_number ⇒ Object
Returns the value of attribute account_number.
29 30 31 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 29 def account_number @account_number end |
#account_type ⇒ Object
Returns the value of attribute account_type.
29 30 31 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 29 def account_type @account_type end |
#amount ⇒ Object
Returns the value of attribute amount.
29 30 31 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 29 def amount @amount end |
#bank_account_token ⇒ Object
Returns the value of attribute bank_account_token.
29 30 31 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 29 def bank_account_token @bank_account_token end |
#custom_field1 ⇒ Object
Returns the value of attribute custom_field1.
35 36 37 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 35 def custom_field1 @custom_field1 end |
#custom_field10 ⇒ Object
Returns the value of attribute custom_field10.
35 36 37 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 35 def custom_field10 @custom_field10 end |
#custom_field2 ⇒ Object
Returns the value of attribute custom_field2.
35 36 37 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 35 def custom_field2 @custom_field2 end |
#custom_field3 ⇒ Object
Returns the value of attribute custom_field3.
35 36 37 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 35 def custom_field3 @custom_field3 end |
#custom_field4 ⇒ Object
Returns the value of attribute custom_field4.
35 36 37 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 35 def custom_field4 @custom_field4 end |
#custom_field5 ⇒ Object
Returns the value of attribute custom_field5.
35 36 37 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 35 def custom_field5 @custom_field5 end |
#custom_field6 ⇒ Object
Returns the value of attribute custom_field6.
35 36 37 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 35 def custom_field6 @custom_field6 end |
#custom_field7 ⇒ Object
Returns the value of attribute custom_field7.
35 36 37 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 35 def custom_field7 @custom_field7 end |
#custom_field8 ⇒ Object
Returns the value of attribute custom_field8.
35 36 37 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 35 def custom_field8 @custom_field8 end |
#custom_field9 ⇒ Object
Returns the value of attribute custom_field9.
35 36 37 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 35 def custom_field9 @custom_field9 end |
#effective_date ⇒ Object
Returns the value of attribute effective_date.
29 30 31 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 29 def effective_date @effective_date end |
#id ⇒ Object
Returns the value of attribute id.
29 30 31 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 29 def id @id end |
#merchant_transaction_id ⇒ Object
Returns the value of attribute merchant_transaction_id.
29 30 31 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 29 def merchant_transaction_id @merchant_transaction_id end |
#method ⇒ Object
Returns the value of attribute method.
29 30 31 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 29 def method @method end |
#micr_data ⇒ Object
Returns the value of attribute micr_data.
29 30 31 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 29 def micr_data @micr_data end |
#recurring_indicator ⇒ Object
Returns the value of attribute recurring_indicator.
29 30 31 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 29 def recurring_indicator @recurring_indicator end |
#return_code ⇒ Object
Returns the value of attribute return_code.
29 30 31 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 29 def return_code @return_code end |
#return_date ⇒ Object
Returns the value of attribute return_date.
29 30 31 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 29 def return_date @return_date end |
#routing_number ⇒ Object
Returns the value of attribute routing_number.
29 30 31 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 29 def routing_number @routing_number end |
#settlement_date ⇒ Object
Returns the value of attribute settlement_date.
29 30 31 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 29 def settlement_date @settlement_date end |
#status ⇒ Object
Returns the value of attribute status.
29 30 31 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 29 def status @status end |
#trace ⇒ Object
Returns the value of attribute trace.
29 30 31 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 29 def trace @trace end |
#type ⇒ Object
Returns the value of attribute type.
29 30 31 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 29 def type @type end |
Class Method Details
.build_from_json(json) ⇒ Object
39 40 41 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 39 def self.build_from_json(json) BankAccountTransaction.new(JSON.parse(json).recursively_symbolize_keys!) end |
Instance Method Details
#correction? ⇒ Boolean
48 49 50 51 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 48 def correction? return false if return_code.nil? status_name == STATUS[:xs_bat_status_returned] && !return_code.match(/^C/).nil? end |
#failed? ⇒ Boolean
62 63 64 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 62 def failed? status_name == STATUS[:xs_bat_status_failed] ? true : false end |
#json_prefix ⇒ Object
44 45 46 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 44 def json_prefix :bank_account_transaction end |
#returned? ⇒ Boolean
53 54 55 56 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 53 def returned? return false if correction? status_name == STATUS[:xs_bat_status_returned] && !return_code.match(/^R/).nil? end |
#settled? ⇒ Boolean
58 59 60 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 58 def settled? status_name == STATUS[:xs_bat_status_settled] && !settlement_date.nil? end |
#status_date ⇒ Object
66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/basecomm_sdk/bank_account_transaction.rb', line 66 def status_date case status_name when STATUS[:xs_bat_status_returned] return_date when STATUS[:xs_bat_status_settled] settlement_date when STATUS[:xs_bat_status_initiated] effective_date else Time.now.strftime('%m/%d/%Y %H:%M:%S') end end |