Class: PaypalServerSdk::PayerBase

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/paypal_server_sdk/models/payer_base.rb

Overview

The customer who approves and pays for the order. The customer is also known as the payer.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(email_address: SKIP, payer_id: SKIP) ⇒ PayerBase

Returns a new instance of PayerBase.



46
47
48
49
# File 'lib/paypal_server_sdk/models/payer_base.rb', line 46

def initialize(email_address: SKIP, payer_id: SKIP)
  @email_address = email_address unless email_address == SKIP
  @payer_id = payer_id unless payer_id == SKIP
end

Instance Attribute Details

#email_addressString

The internationalized email address.<blockquote><strong>Note:</strong> Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.</blockquote>

Returns:

  • (String)


19
20
21
# File 'lib/paypal_server_sdk/models/payer_base.rb', line 19

def email_address
  @email_address
end

#payer_idString

The account identifier for a PayPal account.

Returns:

  • (String)


23
24
25
# File 'lib/paypal_server_sdk/models/payer_base.rb', line 23

def payer_id
  @payer_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



52
53
54
55
56
57
58
59
60
61
62
# File 'lib/paypal_server_sdk/models/payer_base.rb', line 52

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  email_address = hash.key?('email_address') ? hash['email_address'] : SKIP
  payer_id = hash.key?('payer_id') ? hash['payer_id'] : SKIP

  # Create object from extracted values.
  PayerBase.new(email_address: email_address,
                payer_id: payer_id)
end

.namesObject

A mapping from model property names to API property names.



26
27
28
29
30
31
# File 'lib/paypal_server_sdk/models/payer_base.rb', line 26

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['email_address'] = 'email_address'
  @_hash['payer_id'] = 'payer_id'
  @_hash
end

.nullablesObject

An array for nullable fields



42
43
44
# File 'lib/paypal_server_sdk/models/payer_base.rb', line 42

def self.nullables
  []
end

.optionalsObject

An array for optional fields



34
35
36
37
38
39
# File 'lib/paypal_server_sdk/models/payer_base.rb', line 34

def self.optionals
  %w[
    email_address
    payer_id
  ]
end