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

#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) ⇒ PaypalWalletResponse

Returns a new instance of PaypalWalletResponse.



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/paypal_server_sdk/models/paypal_wallet_response.rb', line 116

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)
  @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
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)


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

def 
  @account_id
end

#account_statusPaypalWalletAccountVerificationStatus

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



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

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:



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

def address
  @address
end

#attributesPaypalWalletAttributesResponse

Additional attributes associated with the use of a PayPal Wallet.



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

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)


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

def birth_date
  @birth_date
end

#business_nameString

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

Returns:

  • (String)


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

def business_name
  @business_name
end

#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)


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

def email_address
  @email_address
end

#nameName

The name of the party.

Returns:



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

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:



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

def phone_number
  @phone_number
end

#phone_typePhoneType

The phone type.

Returns:



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

def phone_type
  @phone_type
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:



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

def tax_info
  @tax_info
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/paypal_server_sdk/models/paypal_wallet_response.rb', line 134

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']

  # 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)
end

.namesObject

A mapping from model property names to API property names.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/paypal_server_sdk/models/paypal_wallet_response.rb', line 78

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
end

.nullablesObject

An array for nullable fields



112
113
114
# File 'lib/paypal_server_sdk/models/paypal_wallet_response.rb', line 112

def self.nullables
  []
end

.optionalsObject

An array for optional fields



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/paypal_server_sdk/models/paypal_wallet_response.rb', line 95

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