Class: CorePro::Customer
- Inherits:
-
Models::ModelBase
- Object
- Models::JsonBase
- Models::ModelBase
- CorePro::Customer
- Defined in:
- lib/corepro/customer.rb
Instance Attribute Summary collapse
-
#accounts ⇒ Object
Returns the value of attribute accounts.
-
#addresses ⇒ Object
Returns the value of attribute addresses.
-
#birthDate ⇒ Object
Returns the value of attribute birthDate.
-
#createdDate ⇒ Object
Returns the value of attribute createdDate.
-
#culture ⇒ Object
Returns the value of attribute culture.
-
#customerCount ⇒ Object
Returns the value of attribute customerCount.
-
#customerId ⇒ Object
Returns the value of attribute customerId.
-
#deceasedDate ⇒ Object
Returns the value of attribute deceasedDate.
-
#driversLicenseExpirationDate ⇒ Object
Returns the value of attribute driversLicenseExpirationDate.
-
#driversLicenseNumber ⇒ Object
Returns the value of attribute driversLicenseNumber.
-
#driversLicenseState ⇒ Object
Returns the value of attribute driversLicenseState.
-
#emailAddress ⇒ Object
Returns the value of attribute emailAddress.
-
#externalAccounts ⇒ Object
Returns the value of attribute externalAccounts.
-
#firstName ⇒ Object
Returns the value of attribute firstName.
-
#gender ⇒ Object
Returns the value of attribute gender.
-
#isActive ⇒ Object
Returns the value of attribute isActive.
-
#isDocumentsAccepted ⇒ Object
Returns the value of attribute isDocumentsAccepted.
-
#isLocked ⇒ Object
Returns the value of attribute isLocked.
-
#isOptedInToBankCommunication ⇒ Object
Returns the value of attribute isOptedInToBankCommunication.
-
#isSubjectToBackupWithholding ⇒ Object
Returns the value of attribute isSubjectToBackupWithholding.
-
#lastName ⇒ Object
Returns the value of attribute lastName.
-
#lockedDate ⇒ Object
Returns the value of attribute lockedDate.
-
#lockedReason ⇒ Object
Returns the value of attribute lockedReason.
-
#middleName ⇒ Object
Returns the value of attribute middleName.
-
#passportCountry ⇒ Object
Returns the value of attribute passportCountry.
-
#passportNumber ⇒ Object
Returns the value of attribute passportNumber.
-
#phones ⇒ Object
Returns the value of attribute phones.
-
#status ⇒ Object
Returns the value of attribute status.
-
#tag ⇒ Object
Returns the value of attribute tag.
-
#taxId ⇒ Object
Returns the value of attribute taxId.
Attributes inherited from Models::ModelBase
Class Method Summary collapse
- .deactivate(customerId, connection = nil, loggingObject = nil) ⇒ Object
- .get(customerId, connection = nil, loggingObject = nil) ⇒ Object
- .getByTag(tag, connection = nil, loggingObject = nil) ⇒ Object
- .list(pageNumber = 0, pageSize = 200, connection = nil, loggingObject = nil) ⇒ Object
- .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
- .verify(verificationId, answers, connection = nil, loggingObject = nil) ⇒ Object
Instance Method Summary collapse
- #create(connection = nil, loggingObject = nil) ⇒ Object
- #deactivate(connection = nil, loggingObject = nil) ⇒ Object
- #from_json!(json, classDefs) ⇒ Object
- #get(connection = nil, loggingObject = nil) ⇒ Object
- #getByTag(connection = nil, loggingObject = nil) ⇒ Object
-
#initialize ⇒ Customer
constructor
A new instance of Customer.
- #initiate(connection = nil, loggingObject = nil) ⇒ Object
- #list(pageNumber = 0, pageSize = 200, connection = nil, loggingObject = nil) ⇒ Object
- #search(pageNumber = 0, pageSize = 200, connection = nil, loggingObject = nil) ⇒ Object
- #update(connection = nil, loggingObject = nil) ⇒ Object
- #verify(verificationId, answers, connection = nil, loggingObject = nil) ⇒ Object
Methods inherited from Models::ModelBase
Methods inherited from Models::JsonBase
Constructor Details
#initialize ⇒ Customer
53 54 55 56 57 58 |
# File 'lib/corepro/customer.rb', line 53 def initialize() @phones = [] @addresses = [] @accounts = [] @externalAccount = [] end |
Instance Attribute Details
#accounts ⇒ Object
Returns the value of attribute accounts.
41 42 43 |
# File 'lib/corepro/customer.rb', line 41 def accounts @accounts end |
#addresses ⇒ Object
Returns the value of attribute addresses.
39 40 41 |
# File 'lib/corepro/customer.rb', line 39 def addresses @addresses end |
#birthDate ⇒ Object
Returns the value of attribute birthDate.
18 19 20 |
# File 'lib/corepro/customer.rb', line 18 def birthDate @birthDate end |
#createdDate ⇒ Object
Returns the value of attribute createdDate.
23 24 25 |
# File 'lib/corepro/customer.rb', line 23 def createdDate @createdDate end |
#culture ⇒ Object
Returns the value of attribute culture.
20 21 22 |
# File 'lib/corepro/customer.rb', line 20 def culture @culture end |
#customerCount ⇒ Object
Returns the value of attribute customerCount.
13 14 15 |
# File 'lib/corepro/customer.rb', line 13 def customerCount @customerCount end |
#customerId ⇒ Object
Returns the value of attribute customerId.
14 15 16 |
# File 'lib/corepro/customer.rb', line 14 def customerId @customerId end |
#deceasedDate ⇒ Object
Returns the value of attribute deceasedDate.
40 41 42 |
# File 'lib/corepro/customer.rb', line 40 def deceasedDate @deceasedDate end |
#driversLicenseExpirationDate ⇒ Object
Returns the value of attribute driversLicenseExpirationDate.
27 28 29 |
# File 'lib/corepro/customer.rb', line 27 def driversLicenseExpirationDate @driversLicenseExpirationDate end |
#driversLicenseNumber ⇒ Object
Returns the value of attribute driversLicenseNumber.
25 26 27 |
# File 'lib/corepro/customer.rb', line 25 def driversLicenseNumber @driversLicenseNumber end |
#driversLicenseState ⇒ Object
Returns the value of attribute driversLicenseState.
26 27 28 |
# File 'lib/corepro/customer.rb', line 26 def driversLicenseState @driversLicenseState end |
#emailAddress ⇒ Object
Returns the value of attribute emailAddress.
30 31 32 |
# File 'lib/corepro/customer.rb', line 30 def emailAddress @emailAddress end |
#externalAccounts ⇒ Object
Returns the value of attribute externalAccounts.
42 43 44 |
# File 'lib/corepro/customer.rb', line 42 def externalAccounts @externalAccounts end |
#firstName ⇒ Object
Returns the value of attribute firstName.
15 16 17 |
# File 'lib/corepro/customer.rb', line 15 def firstName @firstName end |
#gender ⇒ Object
Returns the value of attribute gender.
19 20 21 |
# File 'lib/corepro/customer.rb', line 19 def gender @gender end |
#isActive ⇒ Object
Returns the value of attribute isActive.
31 32 33 |
# File 'lib/corepro/customer.rb', line 31 def isActive @isActive end |
#isDocumentsAccepted ⇒ Object
Returns the value of attribute isDocumentsAccepted.
37 38 39 |
# File 'lib/corepro/customer.rb', line 37 def isDocumentsAccepted @isDocumentsAccepted end |
#isLocked ⇒ Object
Returns the value of attribute isLocked.
32 33 34 |
# File 'lib/corepro/customer.rb', line 32 def isLocked @isLocked end |
#isOptedInToBankCommunication ⇒ Object
Returns the value of attribute isOptedInToBankCommunication.
36 37 38 |
# File 'lib/corepro/customer.rb', line 36 def isOptedInToBankCommunication @isOptedInToBankCommunication end |
#isSubjectToBackupWithholding ⇒ Object
Returns the value of attribute isSubjectToBackupWithholding.
35 36 37 |
# File 'lib/corepro/customer.rb', line 35 def isSubjectToBackupWithholding @isSubjectToBackupWithholding end |
#lastName ⇒ Object
Returns the value of attribute lastName.
17 18 19 |
# File 'lib/corepro/customer.rb', line 17 def lastName @lastName end |
#lockedDate ⇒ Object
Returns the value of attribute lockedDate.
33 34 35 |
# File 'lib/corepro/customer.rb', line 33 def lockedDate @lockedDate end |
#lockedReason ⇒ Object
Returns the value of attribute lockedReason.
34 35 36 |
# File 'lib/corepro/customer.rb', line 34 def lockedReason @lockedReason end |
#middleName ⇒ Object
Returns the value of attribute middleName.
16 17 18 |
# File 'lib/corepro/customer.rb', line 16 def middleName @middleName end |
#passportCountry ⇒ Object
Returns the value of attribute passportCountry.
29 30 31 |
# File 'lib/corepro/customer.rb', line 29 def passportCountry @passportCountry end |
#passportNumber ⇒ Object
Returns the value of attribute passportNumber.
28 29 30 |
# File 'lib/corepro/customer.rb', line 28 def passportNumber @passportNumber end |
#phones ⇒ Object
Returns the value of attribute phones.
38 39 40 |
# File 'lib/corepro/customer.rb', line 38 def phones @phones end |
#status ⇒ Object
Returns the value of attribute status.
22 23 24 |
# File 'lib/corepro/customer.rb', line 22 def status @status end |
#tag ⇒ Object
Returns the value of attribute tag.
21 22 23 |
# File 'lib/corepro/customer.rb', line 21 def tag @tag end |
#taxId ⇒ Object
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::Account 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 |