Class: CnpOnline::EcheckToken

Inherits:
Object
  • Object
show all
Includes:
XML::Mapping
Defined in:
lib/XMLFields.rb

Class Method Summary collapse

Class Method Details

.from_hash(hash, name = 'echeckToken') ⇒ Object



1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
# File 'lib/XMLFields.rb', line 1084

def self.from_hash(hash, name='echeckToken')
  base = hash[name]
  if(base)
    this = EcheckToken.new
    this.cnpToken = base['cnpToken']
    this.routingNum = base['routingNum']
    this.accType = base['accType']
    this.checkNum = base['checkNum']
    SchemaValidation.validate_length(this.cnpToken, true, 13, 25, name, 'cnpToken')
    SchemaValidation.validate_length(this.routingNum, true, 9, 9, name, 'routingNum')
    SchemaValidation.validate_enum(this.accType, true, ['Checking','Savings','Corporate','Corp Savings'], name, 'accType')
    SchemaValidation.validate_length(this.checkNum, false, 1, 15, name, 'checkNum')
    this
  else
    nil
  end
end