Sha256: 7893d0674a1fa10a524841697a95b12f34fdabbc71474a004693a8f3cc9340cb

Contents?: true

Size: 1.23 KB

Versions: 4

Compression:

Stored size: 1.23 KB

Contents

require_relative 'Models/model_base'
require_relative 'utils/requestor'
require 'base64'

module CorePro
  class ExternalAccountDocument < Models::ModelBase

    attr_accessor :customerId
    attr_accessor :externalAccountId
    attr_accessor :documentType
    attr_accessor :documentName
    attr_accessor :documentContent
    attr_accessor :reasonType

    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

    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

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
corepro-1.0.0 lib/corepro/external_account_document.rb
corepro-0.0.9 lib/corepro/external_account_document.rb
corepro-0.0.8 lib/corepro/external_account_document.rb
corepro-0.0.7 lib/corepro/external_account_document.rb