Class: CorePro::Customer

Inherits:
Models::ModelBase show all
Defined in:
lib/corepro/customer.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

#to_hash, #to_json

Constructor Details

#initializeCustomer



53
54
55
56
57
58
# File 'lib/corepro/customer.rb', line 53

def initialize()
  @phones = []
  @addresses = []
  @accounts = []
  @externalAccount = []
end

Instance Attribute Details

#accountsObject

Returns the value of attribute accounts.



41
42
43
# File 'lib/corepro/customer.rb', line 41

def accounts
  @accounts
end

#addressesObject

Returns the value of attribute addresses.



39
40
41
# File 'lib/corepro/customer.rb', line 39

def addresses
  @addresses
end

#birthDateObject

Returns the value of attribute birthDate.



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

def birthDate
  @birthDate
end

#createdDateObject

Returns the value of attribute createdDate.



23
24
25
# File 'lib/corepro/customer.rb', line 23

def createdDate
  @createdDate
end

#cultureObject

Returns the value of attribute culture.



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

def culture
  @culture
end

#customerCountObject

Returns the value of attribute customerCount.



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

def customerCount
  @customerCount
end

#customerIdObject

Returns the value of attribute customerId.



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

def customerId
  @customerId
end

#deceasedDateObject

Returns the value of attribute deceasedDate.



40
41
42
# File 'lib/corepro/customer.rb', line 40

def deceasedDate
  @deceasedDate
end

#driversLicenseExpirationDateObject

Returns the value of attribute driversLicenseExpirationDate.



27
28
29
# File 'lib/corepro/customer.rb', line 27

def driversLicenseExpirationDate
  @driversLicenseExpirationDate
end

#driversLicenseNumberObject

Returns the value of attribute driversLicenseNumber.



25
26
27
# File 'lib/corepro/customer.rb', line 25

def driversLicenseNumber
  @driversLicenseNumber
end

#driversLicenseStateObject

Returns the value of attribute driversLicenseState.



26
27
28
# File 'lib/corepro/customer.rb', line 26

def driversLicenseState
  @driversLicenseState
end

#emailAddressObject

Returns the value of attribute emailAddress.



30
31
32
# File 'lib/corepro/customer.rb', line 30

def emailAddress
  @emailAddress
end

#externalAccountsObject

Returns the value of attribute externalAccounts.



42
43
44
# File 'lib/corepro/customer.rb', line 42

def externalAccounts
  @externalAccounts
end

#firstNameObject

Returns the value of attribute firstName.



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

def firstName
  @firstName
end

#genderObject

Returns the value of attribute gender.



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

def gender
  @gender
end

#isActiveObject

Returns the value of attribute isActive.



31
32
33
# File 'lib/corepro/customer.rb', line 31

def isActive
  @isActive
end

#isDocumentsAcceptedObject

Returns the value of attribute isDocumentsAccepted.



37
38
39
# File 'lib/corepro/customer.rb', line 37

def isDocumentsAccepted
  @isDocumentsAccepted
end

#isLockedObject

Returns the value of attribute isLocked.



32
33
34
# File 'lib/corepro/customer.rb', line 32

def isLocked
  @isLocked
end

#isOptedInToBankCommunicationObject

Returns the value of attribute isOptedInToBankCommunication.



36
37
38
# File 'lib/corepro/customer.rb', line 36

def isOptedInToBankCommunication
  @isOptedInToBankCommunication
end

#isSubjectToBackupWithholdingObject

Returns the value of attribute isSubjectToBackupWithholding.



35
36
37
# File 'lib/corepro/customer.rb', line 35

def isSubjectToBackupWithholding
  @isSubjectToBackupWithholding
end

#lastNameObject

Returns the value of attribute lastName.



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

def lastName
  @lastName
end

#lockedDateObject

Returns the value of attribute lockedDate.



33
34
35
# File 'lib/corepro/customer.rb', line 33

def lockedDate
  @lockedDate
end

#lockedReasonObject

Returns the value of attribute lockedReason.



34
35
36
# File 'lib/corepro/customer.rb', line 34

def lockedReason
  @lockedReason
end

#middleNameObject

Returns the value of attribute middleName.



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

def middleName
  @middleName
end

#passportCountryObject

Returns the value of attribute passportCountry.



29
30
31
# File 'lib/corepro/customer.rb', line 29

def passportCountry
  @passportCountry
end

#passportNumberObject

Returns the value of attribute passportNumber.



28
29
30
# File 'lib/corepro/customer.rb', line 28

def passportNumber
  @passportNumber
end

#phonesObject

Returns the value of attribute phones.



38
39
40
# File 'lib/corepro/customer.rb', line 38

def phones
  @phones
end

#statusObject

Returns the value of attribute status.



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

def status
  @status
end

#tagObject

Returns the value of attribute tag.



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

def tag
  @tag
end

#taxIdObject

Returns the value of attribute taxId.



24
25
26
# File 'lib/corepro/customer.rb', line 24

def taxId
  @taxId
end

Class Method Details

.deactivate(customerId, connection = nil, loggingObject = nil) ⇒ Object



115
116
117
118
119
# File 'lib/corepro/customer.rb', line 115

def self.deactivate(customerId, connection = nil, loggingObject = nil)
  c = Customer.new
  c.customerId = customerId
  c.deactivate(connection, loggingObject)
end

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



68
69
70
71
72
# File 'lib/corepro/customer.rb', line 68

def self.get(customerId, connection = nil, loggingObject = nil)
  c = Customer.new
  c.customerId = customerId
  c.get(connection, loggingObject)
end

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



78
79
80
81
82
# File 'lib/corepro/customer.rb', line 78

def self.getByTag(tag, connection = nil, loggingObject = nil)
  c = Customer.new
  c.tag = tag
  c.getByTag(connection, loggingObject)
end

.list(pageNumber = 0, pageSize = 200, connection = nil, loggingObject = nil) ⇒ Object



60
61
62
# File 'lib/corepro/customer.rb', line 60

def self.list(pageNumber = 0, pageSize = 200, connection = nil, loggingObject = nil)
  Customer.new.list pageNumber, pageSize, connection, loggingObject
end

.search(tag = nil, taxId = nil, passportNumber = nil, driversLicenseNumber = nil, birthDate = nil, emailAddress = nil, lastName = nil, firstName = nil, pageNumber = 0, pageSize = 200, connection = nil, loggingObject = nil) ⇒ Object



88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/corepro/customer.rb', line 88

def self.search(tag = nil, taxId = nil, passportNumber = nil, driversLicenseNumber = nil, birthDate = nil, emailAddress = nil, lastName = nil, firstName = nil, pageNumber = 0, pageSize = 200, connection = nil, loggingObject = nil)
  c = Customer.new
  c.tag = tag
  c.taxId = taxId
  c.passportNumber = passportNumber
  c.driversLicenseNumber = driversLicenseNumber
  c.birthDate = birthDate
  c.emailAddress = emailAddress
  c.lastName = lastName
  c.firstName = firstName
  c.search(pageNumber, pageSize, connection, loggingObject)
end

.verify(verificationId, answers, connection = nil, loggingObject = nil) ⇒ Object



130
131
132
133
134
135
# File 'lib/corepro/customer.rb', line 130

def self.verify(verificationId, answers, connection = nil, loggingObject = nil)
  cvr = CorePro::Models::CustomerVerifyRequest.new
  cvr.verificationId = verificationId
  cvr.answers = answers
  cvr.verify connection, loggingObject
end

Instance Method Details

#create(connection = nil, loggingObject = nil) ⇒ Object



105
106
107
108
# File 'lib/corepro/customer.rb', line 105

def create(connection = nil, loggingObject = nil)
  cid = CorePro::Utils::Requestor.post('/customer/create', CorePro::Models::CustomerIdOnly, self, connection, loggingObject)
  cid.customerId
end

#deactivate(connection = nil, loggingObject = nil) ⇒ Object



121
122
123
124
# File 'lib/corepro/customer.rb', line 121

def deactivate(connection = nil, loggingObject = nil)
  cid = CorePro::Utils::Requestor.post('/customer/deactivate', CorePro::Models::CustomerIdOnly, self, connection, loggingObject)
  cid.customerId
end

#from_json!(json, classDefs) ⇒ Object



44
45
46
47
48
49
50
51
# File 'lib/corepro/customer.rb', line 44

def from_json! json, classDefs
  classDefs = classDefs || {}
  classDefs['phones'] = CorePro::Models::CustomerPhone
  classDefs['addresses'] = CorePro::Models::CustomerAddress
  classDefs['accounts'] = CorePro::
  classDefs['externalAccounts'] = CorePro::ExternalAccount
  super json, classDefs
end

#get(connection = nil, loggingObject = nil) ⇒ Object



74
75
76
# File 'lib/corepro/customer.rb', line 74

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

#getByTag(connection = nil, loggingObject = nil) ⇒ Object



84
85
86
# File 'lib/corepro/customer.rb', line 84

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

#initiate(connection = nil, loggingObject = nil) ⇒ Object



126
127
128
# File 'lib/corepro/customer.rb', line 126

def initiate(connection = nil, loggingObject = nil)
  CorePro::Utils::Requestor.post('/customer/initiate', CorePro::Models::CustomerResponse, self, connection, loggingObject)
end

#list(pageNumber = 0, pageSize = 200, connection = nil, loggingObject = nil) ⇒ Object



64
65
66
# File 'lib/corepro/customer.rb', line 64

def list(pageNumber = 0, pageSize = 200, connection = nil, loggingObject = nil)
  CorePro::Utils::Requestor.get("/customer/list?pageNumber=#{pageNumber}&pageSize=#{pageSize}", Customer, connection, loggingObject)
end

#search(pageNumber = 0, pageSize = 200, connection = nil, loggingObject = nil) ⇒ Object



101
102
103
# File 'lib/corepro/customer.rb', line 101

def search(pageNumber = 0, pageSize = 200, connection = nil, loggingObject = nil)
  CorePro::Utils::Requestor.post("/customer/search?pageNumber=#{pageNumber}&pageSize=#{pageSize}", Customer, self, connection, loggingObject)
end

#update(connection = nil, loggingObject = nil) ⇒ Object



110
111
112
113
# File 'lib/corepro/customer.rb', line 110

def update(connection = nil, loggingObject = nil)
  cid = CorePro::Utils::Requestor.post('/customer/update', CorePro::Models::CustomerIdOnly, self, connection, loggingObject)
  cid.customerId
end

#verify(verificationId, answers, connection = nil, loggingObject = nil) ⇒ Object



137
138
139
140
141
142
# File 'lib/corepro/customer.rb', line 137

def verify(verificationId, answers, connection = nil, loggingObject = nil)
  cvr = CorePro::Models::CustomerVerifyRequest.new
  cvr.verificationId = verificationId
  cvr.answers = answers
  cvr.verify connection, loggingObject
end