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.
-
#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.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(email_address: SKIP, payer_id: SKIP) ⇒ PayerBase
Returns a new instance of PayerBase.
45 46 47 48 |
# File 'lib/paypal_server_sdk/models/payer_base.rb', line 45 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. Note: 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.
18 19 20 |
# File 'lib/paypal_server_sdk/models/payer_base.rb', line 18 def email_address @email_address end |
#payer_id ⇒ String
The account identifier for a PayPal account.
22 23 24 |
# File 'lib/paypal_server_sdk/models/payer_base.rb', line 22 def payer_id @payer_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/paypal_server_sdk/models/payer_base.rb', line 51 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.
25 26 27 28 29 30 |
# File 'lib/paypal_server_sdk/models/payer_base.rb', line 25 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
41 42 43 |
# File 'lib/paypal_server_sdk/models/payer_base.rb', line 41 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
33 34 35 36 37 38 |
# File 'lib/paypal_server_sdk/models/payer_base.rb', line 33 def self.optionals %w[ email_address payer_id ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
70 71 72 73 |
# File 'lib/paypal_server_sdk/models/payer_base.rb', line 70 def inspect class_name = self.class.name.split('::').last "<#{class_name} email_address: #{@email_address.inspect}, payer_id: #{@payer_id.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
64 65 66 67 |
# File 'lib/paypal_server_sdk/models/payer_base.rb', line 64 def to_s class_name = self.class.name.split('::').last "<#{class_name} email_address: #{@email_address}, payer_id: #{@payer_id}>" end |