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(options = {}) ⇒ Object
readonly
Returns the value of attribute purchase_id.
-
#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.
- #reference_number(options = {}) ⇒ Object
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["Merchant Id"] @organization_name = row["DBA Name"] @term_number = row["Term Num"] @batch_number = row["Batch Num"] @batch_date = parse_date(row["Batch Date"]) @transaction_date = parse_date(row["Tran Date"]) @card_code = row["Card Type"] @card_number = row["Card Number"] @reference_number = row["Reference"] @purchase_id = row["Purchase Id"] @auth_code = row["Auth Code"] @entry_mode = row["Entry Mode"] @transaction_amount = row["Tran Amount"] @trident_transaction_id = row["Trident Tran Id"] @client_reference_number = row["Client Ref Num"] 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(options = {}) ⇒ 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 |
#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
38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/merchant_e_solutions/detail_record.rb', line 38 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
51 52 53 54 55 56 57 58 59 |
# File 'lib/merchant_e_solutions/detail_record.rb', line 51 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 |
#reference_number(options = {}) ⇒ Object
28 29 30 31 |
# File 'lib/merchant_e_solutions/detail_record.rb', line 28 def reference_number(={}) return @reference_number if [:unchanged] cleaned_reference_number end |