class EwayRapid::InternalModels::SettlementTransaction
Attributes
amount[RW]
card_type[RW]
currency[RW]
currency_code[RW]
eway_customer_id[RW]
settlement_date[RW]
settlement_id[RW]
transaction_date[RW]
transaction_id[RW]
transaction_type[RW]
txn_reference[RW]
Public Class Methods
from_array(array)
click to toggle source
# 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)
click to toggle source
# 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)
click to toggle source
# File lib/eway_rapid/models/internal_models.rb, line 532 def self.from_json(json) hash = JSON.parse(json) from_hash(hash) end