Class: MerchantESolutions::DetailRecord
- Defined in:
- lib/merchant_e_solutions/detail_record.rb
Instance Attribute Summary collapse
-
#auth_code ⇒ Object
readonly
Returns the value of attribute auth_code.
-
#batch_date ⇒ Object
readonly
Returns the value of attribute batch_date.
-
#batch_number ⇒ Object
readonly
Returns the value of attribute batch_number.
-
#card_code ⇒ Object
readonly
Returns the value of attribute card_code.
-
#card_number ⇒ Object
readonly
Returns the value of attribute card_number.
-
#client_reference_number ⇒ Object
readonly
Returns the value of attribute client_reference_number.
-
#entry_mode ⇒ Object
readonly
Returns the value of attribute entry_mode.
-
#organization_id ⇒ Object
readonly
Returns the value of attribute organization_id.
-
#organization_name ⇒ Object
readonly
Returns the value of attribute organization_name.
-
#purchase_id ⇒ Object
readonly
Returns the value of attribute purchase_id.
-
#reference_number ⇒ Object
readonly
Returns the value of attribute reference_number.
-
#term_number ⇒ Object
readonly
Returns the value of attribute term_number.
-
#transaction_amount ⇒ Object
readonly
Returns the value of attribute transaction_amount.
-
#transaction_date ⇒ Object
readonly
Returns the value of attribute transaction_date.
-
#trident_transaction_id ⇒ Object
readonly
Returns the value of attribute trident_transaction_id.
Instance Method Summary collapse
- #credit_company ⇒ Object
- #credit_type ⇒ Object
-
#initialize(row) ⇒ DetailRecord
constructor
A new instance of DetailRecord.
Constructor Details
#initialize(row) ⇒ DetailRecord
Returns a new instance of DetailRecord.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/merchant_e_solutions/detail_record.rb', line 10 def initialize(row) @organization_id = row[0] @organization_name = row[1] @term_number = row[2] @batch_number = row[3] @batch_date = parse_date(row[4]) @transaction_date = parse_date(row[5]) @card_code = row[6] @card_number = row[7] @reference_number = row[8] @purchase_id = row[9] @auth_code = row[10] @entry_mode = row[11] @transaction_amount = row[12] @trident_transaction_id = row[13] @client_reference_number = row[14] end |
Instance Attribute Details
#auth_code ⇒ Object (readonly)
Returns the value of attribute auth_code.
6 7 8 |
# File 'lib/merchant_e_solutions/detail_record.rb', line 6 def auth_code @auth_code end |
#batch_date ⇒ Object (readonly)
Returns the value of attribute batch_date.
6 7 8 |
# File 'lib/merchant_e_solutions/detail_record.rb', line 6 def batch_date @batch_date end |
#batch_number ⇒ Object (readonly)
Returns the value of attribute batch_number.
6 7 8 |
# File 'lib/merchant_e_solutions/detail_record.rb', line 6 def batch_number @batch_number end |
#card_code ⇒ Object (readonly)
Returns the value of attribute card_code.
6 7 8 |
# File 'lib/merchant_e_solutions/detail_record.rb', line 6 def card_code @card_code end |
#card_number ⇒ Object (readonly)
Returns the value of attribute card_number.
6 7 8 |
# File 'lib/merchant_e_solutions/detail_record.rb', line 6 def card_number @card_number end |
#client_reference_number ⇒ Object (readonly)
Returns the value of attribute client_reference_number.
6 7 8 |
# File 'lib/merchant_e_solutions/detail_record.rb', line 6 def client_reference_number @client_reference_number end |
#entry_mode ⇒ Object (readonly)
Returns the value of attribute entry_mode.
6 7 8 |
# File 'lib/merchant_e_solutions/detail_record.rb', line 6 def entry_mode @entry_mode end |
#organization_id ⇒ Object (readonly)
Returns the value of attribute organization_id.
6 7 8 |
# File 'lib/merchant_e_solutions/detail_record.rb', line 6 def organization_id @organization_id end |
#organization_name ⇒ Object (readonly)
Returns the value of attribute organization_name.
6 7 8 |
# File 'lib/merchant_e_solutions/detail_record.rb', line 6 def organization_name @organization_name end |
#purchase_id ⇒ Object (readonly)
Returns the value of attribute purchase_id.
6 7 8 |
# File 'lib/merchant_e_solutions/detail_record.rb', line 6 def purchase_id @purchase_id end |
#reference_number ⇒ Object (readonly)
Returns the value of attribute reference_number.
6 7 8 |
# File 'lib/merchant_e_solutions/detail_record.rb', line 6 def reference_number @reference_number end |
#term_number ⇒ Object (readonly)
Returns the value of attribute term_number.
6 7 8 |
# File 'lib/merchant_e_solutions/detail_record.rb', line 6 def term_number @term_number end |
#transaction_amount ⇒ Object (readonly)
Returns the value of attribute transaction_amount.
6 7 8 |
# File 'lib/merchant_e_solutions/detail_record.rb', line 6 def transaction_amount @transaction_amount end |
#transaction_date ⇒ Object (readonly)
Returns the value of attribute transaction_date.
6 7 8 |
# File 'lib/merchant_e_solutions/detail_record.rb', line 6 def transaction_date @transaction_date end |
#trident_transaction_id ⇒ Object (readonly)
Returns the value of attribute trident_transaction_id.
6 7 8 |
# File 'lib/merchant_e_solutions/detail_record.rb', line 6 def trident_transaction_id @trident_transaction_id end |
Instance Method Details
#credit_company ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/merchant_e_solutions/detail_record.rb', line 28 def credit_company { "AM" => "American Express", "DS" => "Discover", "MB" => "MasterCard", "MC" => "MasterCard", "MD" => "MasterCard", "VB" => "Visa", "VD" => "Visa", "VS" => "Visa", }.fetch(card_code, card_code) end |
#credit_type ⇒ Object
41 42 43 44 45 46 47 48 49 |
# File 'lib/merchant_e_solutions/detail_record.rb', line 41 def credit_type if ["MC", "VS", "AM", "DS"].include? card_code "Credit" elsif ["MD", "VD"].include? card_code "Debit" elsif ["MB", "VB"].include? card_code "Business" end end |