Class: PaypalServerSdk::PaypalWalletResponse

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

Overview

The PayPal Wallet response.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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, account_id: SKIP, account_status: SKIP, name: SKIP, phone_type: SKIP, phone_number: SKIP, birth_date: SKIP, business_name: SKIP, tax_info: SKIP, address: SKIP, attributes: SKIP, stored_credential: SKIP) ⇒ PaypalWalletResponse

Returns a new instance of PaypalWalletResponse.



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/paypal_server_sdk/models/paypal_wallet_response.rb', line 123

def initialize(email_address: SKIP, account_id: SKIP, account_status: SKIP,
               name: SKIP, phone_type: SKIP, phone_number: SKIP,
               birth_date: SKIP, business_name: SKIP, tax_info: SKIP,
               address: SKIP, attributes: SKIP, stored_credential: SKIP)
  @email_address = email_address unless email_address == SKIP
  @account_id =  unless  == SKIP
  @account_status =  unless  == SKIP
  @name = name unless name == SKIP
  @phone_type = phone_type unless phone_type == SKIP
  @phone_number = phone_number unless phone_number == SKIP
  @birth_date = birth_date unless birth_date == SKIP
  @business_name = business_name unless business_name == SKIP
  @tax_info = tax_info unless tax_info == SKIP
  @address = address unless address == SKIP
  @attributes = attributes unless attributes == SKIP
  @stored_credential = stored_credential unless stored_credential == SKIP
end

Instance Attribute Details

#account_idString

The PayPal payer ID, which is a masked version of the PayPal account number intended for use with third parties. The account number is reversibly encrypted and a proprietary variant of Base32 is used to encode the result.

Returns:

  • (String)


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

def 
  @account_id
end

#account_statusPaypalWalletAccountVerificationStatus

The account status indicates whether the buyer has verified the financial details associated with their PayPal account.



29
30
31
# File 'lib/paypal_server_sdk/models/paypal_wallet_response.rb', line 29

def 
  @account_status
end

#addressAddress

The portable international postal address. Maps to [AddressValidationMetadata](github.com/googlei18n/libaddressinput/ wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](www.w3.org/TR/html51/sec-forms.html#autofilling-form-co ntrols-the-autocomplete-attribute).

Returns:



70
71
72
# File 'lib/paypal_server_sdk/models/paypal_wallet_response.rb', line 70

def address
  @address
end

#attributesPaypalWalletAttributesResponse

Additional attributes associated with the use of a PayPal Wallet.



74
75
76
# File 'lib/paypal_server_sdk/models/paypal_wallet_response.rb', line 74

def attributes
  @attributes
end

#birth_dateString

The stand-alone date, in [Internet date and time format](tools.ietf.org/html/rfc3339#section-5.6). To represent special legal values, such as a date of birth, you should use dates with no associated time or time-zone data. Whenever possible, use the standard ‘date_time` type. This regular expression does not validate all dates. For example, February 31 is valid and nothing is known about leap years.

Returns:

  • (String)


51
52
53
# File 'lib/paypal_server_sdk/models/paypal_wallet_response.rb', line 51

def birth_date
  @birth_date
end

#business_nameString

The business name of the PayPal account holder (populated for business accounts only)

Returns:

  • (String)


56
57
58
# File 'lib/paypal_server_sdk/models/paypal_wallet_response.rb', line 56

def business_name
  @business_name
end

#email_addressString

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.

Returns:

  • (String)


17
18
19
# File 'lib/paypal_server_sdk/models/paypal_wallet_response.rb', line 17

def email_address
  @email_address
end

#nameName

The name of the party.

Returns:



33
34
35
# File 'lib/paypal_server_sdk/models/paypal_wallet_response.rb', line 33

def name
  @name
end

#phone_numberPhoneNumber

The phone number in its canonical international [E.164 numbering plan format](www.itu.int/rec/T-REC-E.164/en).

Returns:



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

def phone_number
  @phone_number
end

#phone_typePhoneType

The phone type.

Returns:



37
38
39
# File 'lib/paypal_server_sdk/models/paypal_wallet_response.rb', line 37

def phone_type
  @phone_type
end

#stored_credentialPaypalWalletStoredCredential

Provides additional details to process a payment using the PayPal wallet billing agreement or a vaulted payment method that has been stored or is intended to be stored.



80
81
82
# File 'lib/paypal_server_sdk/models/paypal_wallet_response.rb', line 80

def stored_credential
  @stored_credential
end

#tax_infoTaxInfo

The tax ID of the customer. The customer is also known as the payer. Both ‘tax_id` and `tax_id_type` are required.

Returns:



61
62
63
# File 'lib/paypal_server_sdk/models/paypal_wallet_response.rb', line 61

def tax_info
  @tax_info
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/paypal_server_sdk/models/paypal_wallet_response.rb', line 142

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  email_address = hash.key?('email_address') ? hash['email_address'] : SKIP
   = hash.key?('account_id') ? hash['account_id'] : SKIP
   =
    hash.key?('account_status') ? hash['account_status'] : SKIP
  name = Name.from_hash(hash['name']) if hash['name']
  phone_type = hash.key?('phone_type') ? hash['phone_type'] : SKIP
  phone_number = PhoneNumber.from_hash(hash['phone_number']) if hash['phone_number']
  birth_date = hash.key?('birth_date') ? hash['birth_date'] : SKIP
  business_name = hash.key?('business_name') ? hash['business_name'] : SKIP
  tax_info = TaxInfo.from_hash(hash['tax_info']) if hash['tax_info']
  address = Address.from_hash(hash['address']) if hash['address']
  attributes = PaypalWalletAttributesResponse.from_hash(hash['attributes']) if
    hash['attributes']
  stored_credential = PaypalWalletStoredCredential.from_hash(hash['stored_credential']) if
    hash['stored_credential']

  # Create object from extracted values.
  PaypalWalletResponse.new(email_address: email_address,
                           account_id: ,
                           account_status: ,
                           name: name,
                           phone_type: phone_type,
                           phone_number: phone_number,
                           birth_date: birth_date,
                           business_name: business_name,
                           tax_info: tax_info,
                           address: address,
                           attributes: attributes,
                           stored_credential: stored_credential)
end

.namesObject

A mapping from model property names to API property names.



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/paypal_server_sdk/models/paypal_wallet_response.rb', line 83

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['email_address'] = 'email_address'
  @_hash['account_id'] = 'account_id'
  @_hash['account_status'] = 'account_status'
  @_hash['name'] = 'name'
  @_hash['phone_type'] = 'phone_type'
  @_hash['phone_number'] = 'phone_number'
  @_hash['birth_date'] = 'birth_date'
  @_hash['business_name'] = 'business_name'
  @_hash['tax_info'] = 'tax_info'
  @_hash['address'] = 'address'
  @_hash['attributes'] = 'attributes'
  @_hash['stored_credential'] = 'stored_credential'
  @_hash
end

.nullablesObject

An array for nullable fields



119
120
121
# File 'lib/paypal_server_sdk/models/paypal_wallet_response.rb', line 119

def self.nullables
  []
end

.optionalsObject

An array for optional fields



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/paypal_server_sdk/models/paypal_wallet_response.rb', line 101

def self.optionals
  %w[
    email_address
    account_id
    account_status
    name
    phone_type
    phone_number
    birth_date
    business_name
    tax_info
    address
    attributes
    stored_credential
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



188
189
190
191
192
193
194
195
196
# File 'lib/paypal_server_sdk/models/paypal_wallet_response.rb', line 188

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} email_address: #{@email_address.inspect}, account_id:"\
  " #{@account_id.inspect}, account_status: #{@account_status.inspect}, name:"\
  " #{@name.inspect}, phone_type: #{@phone_type.inspect}, phone_number:"\
  " #{@phone_number.inspect}, birth_date: #{@birth_date.inspect}, business_name:"\
  " #{@business_name.inspect}, tax_info: #{@tax_info.inspect}, address: #{@address.inspect},"\
  " attributes: #{@attributes.inspect}, stored_credential: #{@stored_credential.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



178
179
180
181
182
183
184
185
# File 'lib/paypal_server_sdk/models/paypal_wallet_response.rb', line 178

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} email_address: #{@email_address}, account_id: #{@account_id},"\
  " account_status: #{@account_status}, name: #{@name}, phone_type: #{@phone_type},"\
  " phone_number: #{@phone_number}, birth_date: #{@birth_date}, business_name:"\
  " #{@business_name}, tax_info: #{@tax_info}, address: #{@address}, attributes:"\
  " #{@attributes}, stored_credential: #{@stored_credential}>"
end