Class: Transaction

Inherits:
Object
  • Object
show all
Defined in:
lib/model/Transaction.rb

Constant Summary

@@transactions =
Array.new

Instance Attribute Summary (collapse)

Class Method Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Transaction) initialize(hash)

Returns a new instance of Transaction



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/model/Transaction.rb', line 30

def initialize(hash)
	hash.each { |transaction| 
	@transactionType = transaction["TNTYP"]
	@transactionId = transaction["TNID"]
	@agentCode = transaction["AGT"]

	unless transaction["CST"].nil?
		@customer = Customer.new(transaction["CST"])	
	end
	
	@invoice = transaction["INV"]
	@dateTime = transaction["DTM"]
	@receivedEmail = transaction["RM"]
	@anonymouslySent = transaction["ANM"]
	@item1 = transaction["IT1"]
	@item2 = transaction["IT2"]
	@item3 = transaction["IT3"]
	@item4 = transaction["IT4"]
	@item5 = transaction["IT5"]
	@item6 = transaction["IT6"]
	@amount = transaction["AMT"]
	@result =transaction["RST"]
	@comment = transaction["CM"]

	unless transaction["ach"].nil?
		@ach = Ach.new(transaction["ach"])
	end
	@@transactions << self
}
end

Instance Attribute Details

- (Object) ach

Returns the value of attribute ach



24
25
26
# File 'lib/model/Transaction.rb', line 24

def ach
  @ach
end

- (Object) agentCode

Returns the value of attribute agentCode



8
9
10
# File 'lib/model/Transaction.rb', line 8

def agentCode
  @agentCode
end

- (Object) amount

Returns the value of attribute amount



21
22
23
# File 'lib/model/Transaction.rb', line 21

def amount
  @amount
end

- (Object) anonymouslySent

Returns the value of attribute anonymouslySent



14
15
16
# File 'lib/model/Transaction.rb', line 14

def anonymouslySent
  @anonymouslySent
end

- (Object) comment

Returns the value of attribute comment



23
24
25
# File 'lib/model/Transaction.rb', line 23

def comment
  @comment
end

- (Object) creditCard

Returns the value of attribute creditCard



10
11
12
# File 'lib/model/Transaction.rb', line 10

def creditCard
  @creditCard
end

- (Object) customer

Returns the value of attribute customer



9
10
11
# File 'lib/model/Transaction.rb', line 9

def customer
  @customer
end

- (Object) dateTime

Returns the value of attribute dateTime



12
13
14
# File 'lib/model/Transaction.rb', line 12

def dateTime
  @dateTime
end

- (Object) invoice

Returns the value of attribute invoice



11
12
13
# File 'lib/model/Transaction.rb', line 11

def invoice
  @invoice
end

- (Object) item1

Returns the value of attribute item1



15
16
17
# File 'lib/model/Transaction.rb', line 15

def item1
  @item1
end

- (Object) item2

Returns the value of attribute item2



16
17
18
# File 'lib/model/Transaction.rb', line 16

def item2
  @item2
end

- (Object) item3

Returns the value of attribute item3



17
18
19
# File 'lib/model/Transaction.rb', line 17

def item3
  @item3
end

- (Object) item4

Returns the value of attribute item4



18
19
20
# File 'lib/model/Transaction.rb', line 18

def item4
  @item4
end

- (Object) item5

Returns the value of attribute item5



19
20
21
# File 'lib/model/Transaction.rb', line 19

def item5
  @item5
end

- (Object) item6

Returns the value of attribute item6



20
21
22
# File 'lib/model/Transaction.rb', line 20

def item6
  @item6
end

- (Object) receivedEmail

Returns the value of attribute receivedEmail



13
14
15
# File 'lib/model/Transaction.rb', line 13

def receivedEmail
  @receivedEmail
end

- (Object) result

Returns the value of attribute result



22
23
24
# File 'lib/model/Transaction.rb', line 22

def result
  @result
end

- (Object) transactionId

Returns the value of attribute transactionId



7
8
9
# File 'lib/model/Transaction.rb', line 7

def transactionId
  @transactionId
end

- (Object) transactionType

Returns the value of attribute transactionType



6
7
8
# File 'lib/model/Transaction.rb', line 6

def transactionType
  @transactionType
end

Class Method Details

+ (Object) all_instances



26
27
28
# File 'lib/model/Transaction.rb', line 26

def self.all_instances
  	@@transactions
end