Class: CorePro::Transaction

Inherits:
Models::ModelBase show all
Defined in:
lib/corepro/transaction.rb

Instance Attribute Summary collapse

Attributes inherited from Models::ModelBase

#requestId

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Models::ModelBase

escape, #to_s

Methods inherited from Models::JsonBase

#from_json!, #is_hash?, #to_hash, #to_json

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



15
16
17
# File 'lib/corepro/transaction.rb', line 15

def amount
  @amount
end

#availableDateObject

Returns the value of attribute availableDate.



20
21
22
# File 'lib/corepro/transaction.rb', line 20

def availableDate
  @availableDate
end

#createdDateObject

Returns the value of attribute createdDate.



11
12
13
# File 'lib/corepro/transaction.rb', line 11

def createdDate
  @createdDate
end

#customerIdObject

Returns the value of attribute customerId.



8
9
10
# File 'lib/corepro/transaction.rb', line 8

def customerId
  @customerId
end

#friendlyDescriptionObject

Returns the value of attribute friendlyDescription.



19
20
21
# File 'lib/corepro/transaction.rb', line 19

def friendlyDescription
  @friendlyDescription
end

#isCreditObject

Returns the value of attribute isCredit.



22
23
24
# File 'lib/corepro/transaction.rb', line 22

def isCredit
  @isCredit
end

#nachaDescriptionObject

Returns the value of attribute nachaDescription.



18
19
20
# File 'lib/corepro/transaction.rb', line 18

def nachaDescription
  @nachaDescription
end

#returnCodeObject

Returns the value of attribute returnCode.



21
22
23
# File 'lib/corepro/transaction.rb', line 21

def returnCode
  @returnCode
end

#settledDateObject

Returns the value of attribute settledDate.



16
17
18
# File 'lib/corepro/transaction.rb', line 16

def settledDate
  @settledDate
end

#statusObject

Returns the value of attribute status.



14
15
16
# File 'lib/corepro/transaction.rb', line 14

def status
  @status
end

#tagObject

Returns the value of attribute tag.



10
11
12
# File 'lib/corepro/transaction.rb', line 10

def tag
  @tag
end

#transactionCountObject

Returns the value of attribute transactionCount.



7
8
9
# File 'lib/corepro/transaction.rb', line 7

def transactionCount
  @transactionCount
end

#transactionIdObject

Returns the value of attribute transactionId.



9
10
11
# File 'lib/corepro/transaction.rb', line 9

def transactionId
  @transactionId
end

#typeObject

Returns the value of attribute type.



12
13
14
# File 'lib/corepro/transaction.rb', line 12

def type
  @type
end

#typeCodeObject

Returns the value of attribute typeCode.



13
14
15
# File 'lib/corepro/transaction.rb', line 13

def typeCode
  @typeCode
end

#voidedDateObject

Returns the value of attribute voidedDate.



17
18
19
# File 'lib/corepro/transaction.rb', line 17

def voidedDate
  @voidedDate
end

Class Method Details

.get(customerId, transactionId, connection = nil, loggingObject = nil) ⇒ Object



44
45
46
# File 'lib/corepro/transaction.rb', line 44

def self.get(customerId, transactionId, connection = nil, loggingObject = nil)
  CorePro::Utils::Requestor.get("/transaction/get/#{customerId}/#{transactionId}", Transaction, connection, loggingObject)
end

.getByTag(customerId, tag, connection = nil, loggingObject = nil) ⇒ Object



48
49
50
# File 'lib/corepro/transaction.rb', line 48

def self.getByTag(customerId, tag, connection = nil, loggingObject = nil)
  CorePro::Utils::Requestor.get("/transaction/getByTag/#{customerId}/#{Transaction.escape(tag)}", Transaction, connection, loggingObject)
end

.list(customerId, accountId, status = nil, beginDate = nil, endDate = nil, pageNumber = 0, pageSize = 200, connection = nil, loggingObject = nil) ⇒ Object



24
25
26
27
28
# File 'lib/corepro/transaction.rb', line 24

def self.list(customerId, accountId, status = nil, beginDate = nil, endDate = nil, pageNumber = 0, pageSize = 200, connection = nil, loggingObject = nil)
  t = Transaction.new
  t.customerId = customerId
  t.list accountId, status, beginDate, endDate, pageNumber, pageSize, connection, loggingObject
end

Instance Method Details

#list(accountId = nil, status = nil, beginDate = nil, endDate = nil, pageNumber = 0, pageSize = 200, connection = nil, loggingObject = nil) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/corepro/transaction.rb', line 30

def list(accountId = nil, status = nil, beginDate = nil, endDate =nil, pageNumber =0, pageSize = 200, connection = nil, loggingObject = nil)
  start = beginDate.kind_of?(Date) ? beginDate.strftime('%Y-%m-%d') : (beginDate.kind_of?(String) ? beginDate[0..9] : nil)
  finish = endDate.kind_of?(Date) ? endDate.strftime('%Y-%m-%d') : (endDate.kind_of?(String) ? endDate[0..9] : nil)

  start ||= ''
  finish ||= ''

  if finish != '' && start == ''
    start = '1900-01-01'
  end

  CorePro::Utils::Requestor.get("/transaction/list/#{self.customerId}/#{accountId}/#{Transaction.escape(status)}/#{start}/#{finish}?pageNumber=#{pageNumber}&pageSize=#{pageSize}", Transaction, connection, loggingObject)
end