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.



507
508
509
# File 'lib/eway_rapid/models/internal_models.rb', line 507

def amount
  @amount
end

#card_typeObject

Returns the value of attribute card_type.



506
507
508
# File 'lib/eway_rapid/models/internal_models.rb', line 506

def card_type
  @card_type
end

#currencyObject

Returns the value of attribute currency.



502
503
504
# File 'lib/eway_rapid/models/internal_models.rb', line 502

def currency
  @currency
end

#currency_codeObject

Returns the value of attribute currency_code.



503
504
505
# File 'lib/eway_rapid/models/internal_models.rb', line 503

def currency_code
  @currency_code
end

#eway_customer_idObject

Returns the value of attribute eway_customer_id.



501
502
503
# File 'lib/eway_rapid/models/internal_models.rb', line 501

def eway_customer_id
  @eway_customer_id
end

#settlement_dateObject

Returns the value of attribute settlement_date.



510
511
512
# File 'lib/eway_rapid/models/internal_models.rb', line 510

def settlement_date
  @settlement_date
end

#settlement_idObject

Returns the value of attribute settlement_id.



500
501
502
# File 'lib/eway_rapid/models/internal_models.rb', line 500

def settlement_id
  @settlement_id
end

#transaction_dateObject

Returns the value of attribute transaction_date.



509
510
511
# File 'lib/eway_rapid/models/internal_models.rb', line 509

def transaction_date
  @transaction_date
end

#transaction_idObject

Returns the value of attribute transaction_id.



504
505
506
# File 'lib/eway_rapid/models/internal_models.rb', line 504

def transaction_id
  @transaction_id
end

#transaction_typeObject

Returns the value of attribute transaction_type.



508
509
510
# File 'lib/eway_rapid/models/internal_models.rb', line 508

def transaction_type
  @transaction_type
end

#txn_referenceObject

Returns the value of attribute txn_reference.



505
506
507
# File 'lib/eway_rapid/models/internal_models.rb', line 505

def txn_reference
  @txn_reference
end

Class Method Details

.from_array(array) ⇒ Object



533
534
535
536
537
538
539
540
# File 'lib/eway_rapid/models/internal_models.rb', line 533

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



517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
# File 'lib/eway_rapid/models/internal_models.rb', line 517

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



512
513
514
515
# File 'lib/eway_rapid/models/internal_models.rb', line 512

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