Class: LitleOnline::FraudResult

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

Class Method Summary collapse

Class Method Details

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



354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
# File 'lib/XMLFields.rb', line 354

def self.from_hash(hash, name='fraudResult')
  base = hash[name]
  if(base)
    this = FraudResult.new
    this.avsResult = base['avsResult']
    this.cardValidationResult = base['cardValidationResult']
    this.authenticationResult = base['authenticationResult']
    this.advancedAVSResult = base['advancedAVSResult']
    this.advancedFraudResults = AdvancedFraudResults.from_hash(base)
    SchemaValidation.validate_length(this.avsResult, false, 1, 2, name, "avsResult")
    SchemaValidation.validate_length(this.authenticationResult, false, 1, 1, name, "authenticationResult")
    SchemaValidation.validate_length(this.advancedAVSResult, false, 1, 3, name, "advancedAVSResult")
    this
  else
    nil
  end
end