Class: EwayRapid::InternalModels::SettlementTransaction

Inherits:
Object
  • Object
show all
Defined in:
lib/eway_rapid/models/internal_models.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



527
528
529
# File 'lib/eway_rapid/models/internal_models.rb', line 527

def amount
  @amount
end

#card_typeObject

Returns the value of attribute card_type.



526
527
528
# File 'lib/eway_rapid/models/internal_models.rb', line 526

def card_type
  @card_type
end

#currencyObject

Returns the value of attribute currency.



522
523
524
# File 'lib/eway_rapid/models/internal_models.rb', line 522

def currency
  @currency
end

#currency_codeObject

Returns the value of attribute currency_code.



523
524
525
# File 'lib/eway_rapid/models/internal_models.rb', line 523

def currency_code
  @currency_code
end

#eway_customer_idObject

Returns the value of attribute eway_customer_id.



521
522
523
# File 'lib/eway_rapid/models/internal_models.rb', line 521

def eway_customer_id
  @eway_customer_id
end

#settlement_dateObject

Returns the value of attribute settlement_date.



530
531
532
# File 'lib/eway_rapid/models/internal_models.rb', line 530

def settlement_date
  @settlement_date
end

#settlement_idObject

Returns the value of attribute settlement_id.



520
521
522
# File 'lib/eway_rapid/models/internal_models.rb', line 520

def settlement_id
  @settlement_id
end

#transaction_dateObject

Returns the value of attribute transaction_date.



529
530
531
# File 'lib/eway_rapid/models/internal_models.rb', line 529

def transaction_date
  @transaction_date
end

#transaction_idObject

Returns the value of attribute transaction_id.



524
525
526
# File 'lib/eway_rapid/models/internal_models.rb', line 524

def transaction_id
  @transaction_id
end

#transaction_typeObject

Returns the value of attribute transaction_type.



528
529
530
# File 'lib/eway_rapid/models/internal_models.rb', line 528

def transaction_type
  @transaction_type
end

#txn_referenceObject

Returns the value of attribute txn_reference.



525
526
527
# File 'lib/eway_rapid/models/internal_models.rb', line 525

def txn_reference
  @txn_reference
end

Class Method Details

.from_array(array) ⇒ Object



553
554
555
556
557
558
559
560
# File 'lib/eway_rapid/models/internal_models.rb', line 553

def self.from_array(array)
  transactions = []
  Array(array).each {|transaction_hash|
    obj = from_hash(transaction_hash)
    transactions.push(obj)
  }
  transactions
end

.from_hash(hash) ⇒ Object



537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
# File 'lib/eway_rapid/models/internal_models.rb', line 537

def self.from_hash(hash)
  transaction = SettlementTransaction.new
  transaction.settlement_id = hash[Constants::SETTLEMENT_ID]
  transaction.eway_customer_id = hash[Constants::EWAY_CUSTOMER_ID]
  transaction.currency = hash[Constants::CURRENCY]
  transaction.currency_code = hash[Constants::CURRENCY_CODE]
  transaction.transaction_id = hash[Constants::TRANSACTION_ID]
  transaction.txn_reference = hash[Constants::TXN_REFERENCE]
  transaction.card_type = hash[Constants::CARD_TYPE]
  transaction.amount = hash[Constants::AMOUNT]
  transaction.transaction_type = hash[Constants::TRANSACTION_TYPE]
  transaction.transaction_date = hash[Constants::TRANSACTION_DATE]
  transaction.settlement_date = hash[Constants::SETTLEMENT_DATE]
  transaction
end

.from_json(json) ⇒ Object



532
533
534
535
# File 'lib/eway_rapid/models/internal_models.rb', line 532

def self.from_json(json)
  hash = JSON.parse(json)
  from_hash(hash)
end