Class: PaypalServerSdk::PayerBase
- 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
-
#email_address ⇒ String
The internationalized email address.<blockquote><strong>Note:</strong> Up to 64 characters are allowed before and 255 characters are allowed after the
@
sign. -
#payer_id ⇒ String
The account identifier for a PayPal account.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(email_address: SKIP, payer_id: SKIP) ⇒ PayerBase
constructor
A new instance of PayerBase.
Methods inherited from BaseModel
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_address ⇒ String
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>
19 20 21 |
# File 'lib/paypal_server_sdk/models/payer_base.rb', line 19 def email_address @email_address end |
#payer_id ⇒ String
The account identifier for a PayPal account.
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 |
.names ⇒ Object
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 |
.nullables ⇒ Object
An array for nullable fields
42 43 44 |
# File 'lib/paypal_server_sdk/models/payer_base.rb', line 42 def self.nullables [] end |
.optionals ⇒ Object
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 |