Class: PaypalServerSdk::PayerInformation
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::PayerInformation
- Defined in:
- lib/paypal_server_sdk/models/payer_information.rb
Overview
The payer information.
Instance Attribute Summary collapse
-
#account_id ⇒ String
The PayPal` customer account ID.
-
#address ⇒ SimplePostalAddressCoarseGrained
A simple postal address with coarse-grained fields.
-
#address_status ⇒ String
The address status of the payer.
-
#country_code ⇒ String
The [two-character ISO 3166-1 code](/docs/integration/direct/rest/country-codes/) that identifies the country or region.
-
#email_address ⇒ String
The internationalized email address.
-
#payer_name ⇒ PayerName
The name of the party.
-
#payer_status ⇒ String
The status of the payer.
-
#phone_number ⇒ Phone
The phone number, in its canonical international [E.164 numbering plan format](www.itu.int/rec/T-REC-E.164/en).
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(account_id: SKIP, email_address: SKIP, phone_number: SKIP, address_status: SKIP, payer_status: SKIP, payer_name: SKIP, country_code: SKIP, address: SKIP) ⇒ PayerInformation
constructor
A new instance of PayerInformation.
-
#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(account_id: SKIP, email_address: SKIP, phone_number: SKIP, address_status: SKIP, payer_status: SKIP, payer_name: SKIP, country_code: SKIP, address: SKIP) ⇒ PayerInformation
Returns a new instance of PayerInformation.
89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/paypal_server_sdk/models/payer_information.rb', line 89 def initialize(account_id: SKIP, email_address: SKIP, phone_number: SKIP, address_status: SKIP, payer_status: SKIP, payer_name: SKIP, country_code: SKIP, address: SKIP) @account_id = account_id unless account_id == SKIP @email_address = email_address unless email_address == SKIP @phone_number = phone_number unless phone_number == SKIP @address_status = address_status unless address_status == SKIP @payer_status = payer_status unless payer_status == SKIP @payer_name = payer_name unless payer_name == SKIP @country_code = country_code unless country_code == SKIP @address = address unless address == SKIP end |
Instance Attribute Details
#account_id ⇒ String
The PayPal` customer account ID.
14 15 16 |
# File 'lib/paypal_server_sdk/models/payer_information.rb', line 14 def account_id @account_id end |
#address ⇒ SimplePostalAddressCoarseGrained
A simple postal address with coarse-grained fields. Do not use for an international address. Use for backward compatibility only. Does not contain phone.
54 55 56 |
# File 'lib/paypal_server_sdk/models/payer_information.rb', line 54 def address @address end |
#address_status ⇒ String
The address status of the payer. Value is either: Y. Verified. N. Not verified.
31 32 33 |
# File 'lib/paypal_server_sdk/models/payer_information.rb', line 31 def address_status @address_status end |
#country_code ⇒ String
The [two-character ISO 3166-1 code](/docs/integration/direct/rest/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the ‘C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.
48 49 50 |
# File 'lib/paypal_server_sdk/models/payer_information.rb', line 48 def country_code @country_code end |
#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.
21 22 23 |
# File 'lib/paypal_server_sdk/models/payer_information.rb', line 21 def email_address @email_address end |
#payer_name ⇒ PayerName
The name of the party.
39 40 41 |
# File 'lib/paypal_server_sdk/models/payer_information.rb', line 39 def payer_name @payer_name end |
#payer_status ⇒ String
The status of the payer. Value is ‘Y` or `N`.
35 36 37 |
# File 'lib/paypal_server_sdk/models/payer_information.rb', line 35 def payer_status @payer_status end |
#phone_number ⇒ Phone
The phone number, in its canonical international [E.164 numbering plan format](www.itu.int/rec/T-REC-E.164/en).
26 27 28 |
# File 'lib/paypal_server_sdk/models/payer_information.rb', line 26 def phone_number @phone_number end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/paypal_server_sdk/models/payer_information.rb', line 103 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_id = hash.key?('account_id') ? hash['account_id'] : SKIP email_address = hash.key?('email_address') ? hash['email_address'] : SKIP phone_number = Phone.from_hash(hash['phone_number']) if hash['phone_number'] address_status = hash.key?('address_status') ? hash['address_status'] : SKIP payer_status = hash.key?('payer_status') ? hash['payer_status'] : SKIP payer_name = PayerName.from_hash(hash['payer_name']) if hash['payer_name'] country_code = hash.key?('country_code') ? hash['country_code'] : SKIP address = SimplePostalAddressCoarseGrained.from_hash(hash['address']) if hash['address'] # Create object from extracted values. PayerInformation.new(account_id: account_id, email_address: email_address, phone_number: phone_number, address_status: address_status, payer_status: payer_status, payer_name: payer_name, country_code: country_code, address: address) end |
.names ⇒ Object
A mapping from model property names to API property names.
57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/paypal_server_sdk/models/payer_information.rb', line 57 def self.names @_hash = {} if @_hash.nil? @_hash['account_id'] = 'account_id' @_hash['email_address'] = 'email_address' @_hash['phone_number'] = 'phone_number' @_hash['address_status'] = 'address_status' @_hash['payer_status'] = 'payer_status' @_hash['payer_name'] = 'payer_name' @_hash['country_code'] = 'country_code' @_hash['address'] = 'address' @_hash end |
.nullables ⇒ Object
An array for nullable fields
85 86 87 |
# File 'lib/paypal_server_sdk/models/payer_information.rb', line 85 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/paypal_server_sdk/models/payer_information.rb', line 71 def self.optionals %w[ account_id email_address phone_number address_status payer_status payer_name country_code address ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
137 138 139 140 141 142 143 144 |
# File 'lib/paypal_server_sdk/models/payer_information.rb', line 137 def inspect class_name = self.class.name.split('::').last "<#{class_name} account_id: #{@account_id.inspect}, email_address:"\ " #{@email_address.inspect}, phone_number: #{@phone_number.inspect}, address_status:"\ " #{@address_status.inspect}, payer_status: #{@payer_status.inspect}, payer_name:"\ " #{@payer_name.inspect}, country_code: #{@country_code.inspect}, address:"\ " #{@address.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
129 130 131 132 133 134 |
# File 'lib/paypal_server_sdk/models/payer_information.rb', line 129 def to_s class_name = self.class.name.split('::').last "<#{class_name} account_id: #{@account_id}, email_address: #{@email_address}, phone_number:"\ " #{@phone_number}, address_status: #{@address_status}, payer_status: #{@payer_status},"\ " payer_name: #{@payer_name}, country_code: #{@country_code}, address: #{@address}>" end |