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

#is_hash?, #to_hash, #to_json

Constructor Details

#initializeCustomer

Returns a new instance of Customer.



71
72
73
74
75
76
77
78
# File 'lib/corepro/customer.rb', line 71

def initialize()
  super
  @phones = []
  @addresses = []
  @accounts = []
  @externalAccounts = []
  @cards = []
end

Instance Attribute Details

#accessTypeCodeObject

Returns the value of attribute accessTypeCode.



52
53
54
# File 'lib/corepro/customer.rb', line 52

def accessTypeCode
  @accessTypeCode
end

#accountsObject

Returns the value of attribute accounts.



57
58
59
# File 'lib/corepro/customer.rb', line 57

def accounts
  @accounts
end

#addressesObject

Returns the value of attribute addresses.



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

def addresses
  @addresses
end

#birthDateObject

Returns the value of attribute birthDate.



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

def birthDate
  @birthDate
end

#cardsObject

Returns the value of attribute cards.



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

def cards
  @cards
end

#createdDateObject

Returns the value of attribute createdDate.



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

def createdDate
  @createdDate
end

#cultureObject

Returns the value of attribute culture.



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

def culture
  @culture
end

#customerCountObject

Returns the value of attribute customerCount.



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

def customerCount
  @customerCount
end

#customerIdObject

Returns the value of attribute customerId.



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

def customerId
  @customerId
end

#customField1Object

Returns the value of attribute customField1.



47
48
49
# File 'lib/corepro/customer.rb', line 47

def customField1
  @customField1
end

#customField2Object

Returns the value of attribute customField2.



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

def customField2
  @customField2
end

#customField3Object

Returns the value of attribute customField3.



49
50
51
# File 'lib/corepro/customer.rb', line 49

def customField3
  @customField3
end

#customField4Object

Returns the value of attribute customField4.



50
51
52
# File 'lib/corepro/customer.rb', line 50

def customField4
  @customField4
end

#customField5Object

Returns the value of attribute customField5.



51
52
53
# File 'lib/corepro/customer.rb', line 51

def customField5
  @customField5
end

#deceasedDateObject

Returns the value of attribute deceasedDate.



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

def deceasedDate
  @deceasedDate
end

#driversLicenseExpireDateObject

Returns the value of attribute driversLicenseExpireDate.



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

def driversLicenseExpireDate
  @driversLicenseExpireDate
end

#driversLicenseIssueDateObject

Returns the value of attribute driversLicenseIssueDate.



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

def driversLicenseIssueDate
  @driversLicenseIssueDate
end

#driversLicenseNumberObject

Returns the value of attribute driversLicenseNumber.



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

def driversLicenseNumber
  @driversLicenseNumber
end

#driversLicenseNumberMaskedObject

Returns the value of attribute driversLicenseNumberMasked.



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

def driversLicenseNumberMasked
  @driversLicenseNumberMasked
end

#driversLicenseStateObject

Returns the value of attribute driversLicenseState.



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

def driversLicenseState
  @driversLicenseState
end

#emailAddressObject

Returns the value of attribute emailAddress.



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

def emailAddress
  @emailAddress
end

#externalAccountsObject

Returns the value of attribute externalAccounts.



58
59
60
# File 'lib/corepro/customer.rb', line 58

def externalAccounts
  @externalAccounts
end

#firstNameObject

Returns the value of attribute firstName.



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

def firstName
  @firstName
end

#genderObject

Returns the value of attribute gender.



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

def gender
  @gender
end

#isActiveObject

Returns the value of attribute isActive.



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

def isActive
  @isActive
end

#isDocumentsAcceptedObject

Returns the value of attribute isDocumentsAccepted.



46
47
48
# File 'lib/corepro/customer.rb', line 46

def isDocumentsAccepted
  @isDocumentsAccepted
end

#isLockedObject

Returns the value of attribute isLocked.



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

def isLocked
  @isLocked
end

#isOptedInToBankCommunicationObject

Returns the value of attribute isOptedInToBankCommunication.



45
46
47
# File 'lib/corepro/customer.rb', line 45

def isOptedInToBankCommunication
  @isOptedInToBankCommunication
end

#isSubjectToBackupWithholdingObject

Returns the value of attribute isSubjectToBackupWithholding.



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

def isSubjectToBackupWithholding
  @isSubjectToBackupWithholding
end

#lastActivityDateObject

Returns the value of attribute lastActivityDate.



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

def lastActivityDate
  @lastActivityDate
end

#lastModifiedDateObject

Returns the value of attribute lastModifiedDate.



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

def lastModifiedDate
  @lastModifiedDate
end

#lastNameObject

Returns the value of attribute lastName.



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

def lastName
  @lastName
end

#lockedDateObject

Returns the value of attribute lockedDate.



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

def lockedDate
  @lockedDate
end

#lockedReasonObject

Returns the value of attribute lockedReason.



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

def lockedReason
  @lockedReason
end

#middleNameObject

Returns the value of attribute middleName.



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

def middleName
  @middleName
end

#passportCountryObject

Returns the value of attribute passportCountry.



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

def passportCountry
  @passportCountry
end

#passportExpireDateObject

Returns the value of attribute passportExpireDate.



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

def passportExpireDate
  @passportExpireDate
end

#passportIssueDateObject

Returns the value of attribute passportIssueDate.



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

def passportIssueDate
  @passportIssueDate
end

#passportNumberObject

Returns the value of attribute passportNumber.



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

def passportNumber
  @passportNumber
end

#passportNumberMaskedObject

Returns the value of attribute passportNumberMasked.



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

def passportNumberMasked
  @passportNumberMasked
end

#phonesObject

Returns the value of attribute phones.



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

def phones
  @phones
end

#statusObject

Returns the value of attribute status.



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

def status
  @status
end

#suffixObject

Returns the value of attribute suffix.



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

def suffix
  @suffix
end

#tagObject

Returns the value of attribute tag.



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

def tag
  @tag
end

#taxIdObject

Returns the value of attribute taxId.



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

def taxId
  @taxId
end

#taxIdMaskedObject

Returns the value of attribute taxIdMasked.



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

def taxIdMasked
  @taxIdMasked
end

Class Method Details

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



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

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

.getByEmail(emailAddress, connection = nil, loggingObject = nil) ⇒ Object



92
93
94
# File 'lib/corepro/customer.rb', line 92

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

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



88
89
90
# File 'lib/corepro/customer.rb', line 88

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

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



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

def self.list(pageNumber = 0, pageSize = 200, connection = nil, loggingObject = nil)
  CorePro::Utils::Requestor.get("/customer/list?pageNumber=#{pageNumber}&pageSize=#{pageSize}", Customer, 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



96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/corepro/customer.rb', line 96

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

Instance Method Details

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



123
124
125
126
# File 'lib/corepro/customer.rb', line 123

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

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



113
114
115
116
# File 'lib/corepro/customer.rb', line 113

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

#from_json!(json, classDefs) ⇒ Object



61
62
63
64
65
66
67
68
69
# File 'lib/corepro/customer.rb', line 61

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

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



128
129
130
# File 'lib/corepro/customer.rb', line 128

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

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



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

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



118
119
120
121
# File 'lib/corepro/customer.rb', line 118

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

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



132
133
134
135
136
137
138
# File 'lib/corepro/customer.rb', line 132

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