Class: PaypalServerSdk::Payee

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

Overview

The merchant who receives the funds and fulfills the order. The merchant is also known as the payee., The details for the merchant who receives the funds and fulfills the order. The merchant is also known as the payee.

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, merchant_id: SKIP) ⇒ Payee

Returns a new instance of Payee.



47
48
49
50
# File 'lib/paypal_server_sdk/models/payee.rb', line 47

def initialize(email_address: SKIP, merchant_id: SKIP)
  @email_address = email_address unless email_address == SKIP
  @merchant_id = merchant_id unless merchant_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)


20
21
22
# File 'lib/paypal_server_sdk/models/payee.rb', line 20

def email_address
  @email_address
end

#merchant_idString

The account identifier for a PayPal account.

Returns:

  • (String)


24
25
26
# File 'lib/paypal_server_sdk/models/payee.rb', line 24

def merchant_id
  @merchant_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

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

  # Create object from extracted values.
  Payee.new(email_address: email_address,
            merchant_id: merchant_id)
end

.namesObject

A mapping from model property names to API property names.



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

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

.nullablesObject

An array for nullable fields



43
44
45
# File 'lib/paypal_server_sdk/models/payee.rb', line 43

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    email_address
    merchant_id
  ]
end