Class: ArrowPayments::Transaction

Inherits:
Entity
  • Object
show all
Defined in:
lib/arrow_payments/transaction.rb

Constant Summary collapse

STATUSES =

Indicates status of transaction

[
  'NotSettled',
  'Settled',
  'Voided',
  'Failed'
]
SOURCES =

Indicates how the transation was entered

[
  'VirtualTerminal',
  'LinkedTerminal',
  'API',
  'Subscription',
  'InvoicePayment',
  'Mobile'
]

Instance Method Summary collapse

Methods inherited from Entity

property, #to_source_hash

Instance Method Details

#Billing=(data) ⇒ Object



49
50
51
52
53
# File 'lib/arrow_payments/transaction.rb', line 49

def Billing=(data)
  if data.kind_of?(Hash)
    self.billing_address = ArrowPayments::Address.new(data)
  end
end

#LineItems=(data) ⇒ Object



61
62
63
64
65
# File 'lib/arrow_payments/transaction.rb', line 61

def LineItems=(data)
  if data.kind_of?(Array)
    self.line_items = data.map { |hash| ArrowPayments::LineItem.new(hash) }
  end
end

#Shipping=(data) ⇒ Object



55
56
57
58
59
# File 'lib/arrow_payments/transaction.rb', line 55

def Shipping=(data)
  if data.kind_of?(Hash)
    self.shipping_address = ArrowPayments::Address.new(data)
  end
end

#TransactionTime=(data) ⇒ Object



67
68
69
70
71
72
# File 'lib/arrow_payments/transaction.rb', line 67

def TransactionTime=(data)
  if data =~ /^\/Date\(([\d]+)\)\/$/
    epoch = Integer($1[0..9])
    self.created_at = Time.at(epoch)
  end
end