Class: CnpOnline::PayPal

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

Class Method Summary collapse

Class Method Details

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



863
864
865
866
867
868
869
870
871
872
873
874
875
876
# File 'lib/XMLFields.rb', line 863

def self.from_hash(hash, name='payPal')
  base = hash[name]
  if(base)
    this = PayPal.new
    this.payerId = base['payerId']
    this.token = base['token']
    this.transactionId = base['transactionId']
    SchemaValidation.validate_required(this.payerId, true, name, 'payerId')
    SchemaValidation.validate_required(this.transactionId, true, name, 'transactionId')
    this
  else
    nil
  end
end