class EwayRapid::InternalModels::RefundDetails

Attributes

currency_code[RW]
invoice_description[RW]
invoice_number[RW]
invoice_reference[RW]
original_transaction_id[RW]
total_amount[RW]

Public Class Methods

from_hash(hash) click to toggle source
# File lib/eway_rapid/models/internal_models.rb, line 252
def self.from_hash(hash)
  refund_details = RefundDetails.new
  refund_details.original_transaction_id = hash[Constants::ORIGINAL_TRANSACTION_ID]
  refund_details.total_amount = hash[Constants::TOTAL_AMOUNT]
  refund_details.invoice_number = hash[Constants::INVOICE_NUMBER]
  refund_details.invoice_description = hash[Constants::INVOICE_DESCRIPTION]
  refund_details.invoice_reference = hash[Constants::INVOICE_REFERENCE]
  refund_details.currency_code = hash[Constants::CURRENCY_CODE]
  refund_details
end
from_json(json) click to toggle source
# File lib/eway_rapid/models/internal_models.rb, line 247
def self.from_json(json)
  hash = JSON.parse(json)
  from_hash(hash)
end
to_hash(refund_details) click to toggle source
# File lib/eway_rapid/models/internal_models.rb, line 234
def self.to_hash(refund_details)
  hash = {}
  if refund_details
   hash[Constants::ORIGINAL_TRANSACTION_ID] = refund_details.original_transaction_id if refund_details.original_transaction_id
   hash[Constants::TOTAL_AMOUNT] = refund_details.total_amount if refund_details.total_amount
   hash[Constants::INVOICE_NUMBER] = refund_details.invoice_number if refund_details.invoice_number
   hash[Constants::INVOICE_DESCRIPTION] = refund_details.invoice_description if refund_details.invoice_description
   hash[Constants::INVOICE_REFERENCE] = refund_details.invoice_reference if refund_details.invoice_reference
   hash[Constants::CURRENCY_CODE] = refund_details.currency_code if refund_details.currency_code
  end
  hash
end