Class: PaypalServerSdk::PaypalWallet

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

Overview

A resource that identifies a PayPal Wallet is used for payment.

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(vault_id: SKIP, email_address: SKIP, name: SKIP, phone: SKIP, birth_date: SKIP, tax_info: SKIP, address: SKIP, attributes: SKIP, experience_context: SKIP, billing_agreement_id: SKIP, stored_credential: SKIP) ⇒ PaypalWallet

Returns a new instance of PaypalWallet.



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

def initialize(vault_id: SKIP, email_address: SKIP, name: SKIP, phone: SKIP,
               birth_date: SKIP, tax_info: SKIP, address: SKIP,
               attributes: SKIP, experience_context: SKIP,
               billing_agreement_id: SKIP, stored_credential: SKIP)
  @vault_id = vault_id unless vault_id == SKIP
  @email_address = email_address unless email_address == SKIP
  @name = name unless name == SKIP
  @phone = phone unless phone == SKIP
  @birth_date = birth_date unless birth_date == SKIP
  @tax_info = tax_info unless tax_info == SKIP
  @address = address unless address == SKIP
  @attributes = attributes unless attributes == SKIP
  @experience_context = experience_context unless experience_context == SKIP
  @billing_agreement_id = billing_agreement_id unless billing_agreement_id == SKIP
  @stored_credential = stored_credential unless stored_credential == SKIP
end

Instance Attribute Details

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



54
55
56
# File 'lib/paypal_server_sdk/models/paypal_wallet.rb', line 54

def address
  @address
end

#attributesPaypalWalletAttributes

Additional attributes associated with the use of this PayPal Wallet.



58
59
60
# File 'lib/paypal_server_sdk/models/paypal_wallet.rb', line 58

def attributes
  @attributes
end

#billing_agreement_idString

The PayPal billing agreement ID. References an approved recurring payment for goods or services.

Returns:

  • (String)


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

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


40
41
42
# File 'lib/paypal_server_sdk/models/paypal_wallet.rb', line 40

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


23
24
25
# File 'lib/paypal_server_sdk/models/paypal_wallet.rb', line 23

def email_address
  @email_address
end

#experience_contextPaypalWalletExperienceContext

Customizes the payer experience during the approval process for payment with PayPal. Note: Partners and Marketplaces might configure brand_name and shipping_preference during partner account setup, which overrides the request values.



65
66
67
# File 'lib/paypal_server_sdk/models/paypal_wallet.rb', line 65

def experience_context
  @experience_context
end

#nameName

The name of the party.

Returns:



27
28
29
# File 'lib/paypal_server_sdk/models/paypal_wallet.rb', line 27

def name
  @name
end

#phonePhoneWithType

The phone information.

Returns:



31
32
33
# File 'lib/paypal_server_sdk/models/paypal_wallet.rb', line 31

def phone
  @phone
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.



76
77
78
# File 'lib/paypal_server_sdk/models/paypal_wallet.rb', line 76

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:



45
46
47
# File 'lib/paypal_server_sdk/models/paypal_wallet.rb', line 45

def tax_info
  @tax_info
end

#vault_idString

The PayPal-generated ID for the vaulted payment source. This ID should be stored on the merchant’s server so the saved payment source can be used for future transactions.

Returns:

  • (String)


16
17
18
# File 'lib/paypal_server_sdk/models/paypal_wallet.rb', line 16

def vault_id
  @vault_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
165
166
# File 'lib/paypal_server_sdk/models/paypal_wallet.rb', line 135

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  vault_id = hash.key?('vault_id') ? hash['vault_id'] : SKIP
  email_address = hash.key?('email_address') ? hash['email_address'] : SKIP
  name = Name.from_hash(hash['name']) if hash['name']
  phone = PhoneWithType.from_hash(hash['phone']) if hash['phone']
  birth_date = hash.key?('birth_date') ? hash['birth_date'] : SKIP
  tax_info = TaxInfo.from_hash(hash['tax_info']) if hash['tax_info']
  address = Address.from_hash(hash['address']) if hash['address']
  attributes = PaypalWalletAttributes.from_hash(hash['attributes']) if hash['attributes']
  experience_context = PaypalWalletExperienceContext.from_hash(hash['experience_context']) if
    hash['experience_context']
  billing_agreement_id =
    hash.key?('billing_agreement_id') ? hash['billing_agreement_id'] : SKIP
  stored_credential = PaypalWalletStoredCredential.from_hash(hash['stored_credential']) if
    hash['stored_credential']

  # Create object from extracted values.
  PaypalWallet.new(vault_id: vault_id,
                   email_address: email_address,
                   name: name,
                   phone: phone,
                   birth_date: birth_date,
                   tax_info: tax_info,
                   address: address,
                   attributes: attributes,
                   experience_context: experience_context,
                   billing_agreement_id: billing_agreement_id,
                   stored_credential: stored_credential)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['vault_id'] = 'vault_id'
  @_hash['email_address'] = 'email_address'
  @_hash['name'] = 'name'
  @_hash['phone'] = 'phone'
  @_hash['birth_date'] = 'birth_date'
  @_hash['tax_info'] = 'tax_info'
  @_hash['address'] = 'address'
  @_hash['attributes'] = 'attributes'
  @_hash['experience_context'] = 'experience_context'
  @_hash['billing_agreement_id'] = 'billing_agreement_id'
  @_hash['stored_credential'] = 'stored_credential'
  @_hash
end

.nullablesObject

An array for nullable fields



113
114
115
# File 'lib/paypal_server_sdk/models/paypal_wallet.rb', line 113

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    vault_id
    email_address
    name
    phone
    birth_date
    tax_info
    address
    attributes
    experience_context
    billing_agreement_id
    stored_credential
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} vault_id: #{@vault_id.inspect}, email_address: #{@email_address.inspect},"\
  " name: #{@name.inspect}, phone: #{@phone.inspect}, birth_date: #{@birth_date.inspect},"\
  " tax_info: #{@tax_info.inspect}, address: #{@address.inspect}, attributes:"\
  " #{@attributes.inspect}, experience_context: #{@experience_context.inspect},"\
  " billing_agreement_id: #{@billing_agreement_id.inspect}, stored_credential:"\
  " #{@stored_credential.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



169
170
171
172
173
174
175
# File 'lib/paypal_server_sdk/models/paypal_wallet.rb', line 169

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} vault_id: #{@vault_id}, email_address: #{@email_address}, name: #{@name},"\
  " phone: #{@phone}, birth_date: #{@birth_date}, tax_info: #{@tax_info}, address:"\
  " #{@address}, attributes: #{@attributes}, experience_context: #{@experience_context},"\
  " billing_agreement_id: #{@billing_agreement_id}, stored_credential: #{@stored_credential}>"
end