Class: CorePro::ExternalAccountDocument

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

#customerIdObject

Returns the value of attribute customerId.



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

def customerId
  @customerId
end

#documentContentObject

Returns the value of attribute documentContent.



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

def documentContent
  @documentContent
end

#documentNameObject

Returns the value of attribute documentName.



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

def documentName
  @documentName
end

#documentTypeObject

Returns the value of attribute documentType.



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

def documentType
  @documentType
end

#externalAccountIdObject

Returns the value of attribute externalAccountId.



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

def externalAccountId
  @externalAccountId
end

#reasonTypeObject

Returns the value of attribute reasonType.



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

def reasonType
  @reasonType
end

Class Method Details

.upload(customerId, externalAccountId, documentType, documentName, documentContent, reasonType, connection = nil, loggingObject = nil) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'lib/corepro/external_account_document.rb', line 15

def self.upload(customerId, externalAccountId, documentType, documentName, documentContent, reasonType, connection = nil, loggingObject = nil)
  ead = ExternalAccountDocument.new
  ead.customerId = customerId
  ead.externalAccountId = externalAccountId
  ead.documentType = documentType
  ead.documentName = documentName
  ead.documentContent = documentContent
  ead.reasonType = reasonType
  ead.upload connection, loggingObject
end

Instance Method Details

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



26
27
28
29
30
31
# File 'lib/corepro/external_account_document.rb', line 26

def upload(connection = nil, loggingObject = nil)
  # NOTE: documentContent is assumed to be raw content bytes.
  #       corepro API expects base64 encoded string. so we convert that here.
  self.documentContent = Base64.encode64(self.documentContent)
  CorePro::Utils::Requestor.post('/externalaccountdocument/upload', nil, self, connection, loggingObject)
end