Class: CnpOnline::CardPaypage

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

Class Method Summary collapse

Class Method Details

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



839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
# File 'lib/XMLFields.rb', line 839

def self.from_hash(hash, name='cardPaypage')
  base = hash[name]
  if(base)
    this = CardPaypage.new
    this.paypageRegistrationId = base['paypageRegistrationId']
    this.expDate = base['expDate']
    this.cardValidationNum = base['cardValidationNum']
    this.mop = base['type']
    SchemaValidation.validate_length(this.paypageRegistrationId, true, 1, 512, name, 'paypageRegistrationId')
    SchemaValidation.validate_length(this.expDate, false, 4, 4, name, 'expDate')
    SchemaValidation.validate_length(this.cardValidationNum, false, 1, 4, name, 'cardValidationNum')
    SchemaValidation.validate_enum(this.mop, false, ['','MC','VI','AX','DC','DI','PP','JC','BL','EC'], name, 'type')
    this
  else
    nil
  end
end