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

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

Returns a new instance of PaypalWallet.



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/paypal_server_sdk/models/paypal_wallet.rb', line 111

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



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

def address
  @address
end

#attributesPaypalWalletAttributes

Additional attributes associated with the use of this PayPal Wallet.



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

def attributes
  @attributes
end

#billing_agreement_idString

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

Returns:

  • (String)


72
73
74
# File 'lib/paypal_server_sdk/models/paypal_wallet.rb', line 72

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)


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

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


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

def email_address
  @email_address
end

#experience_contextPaypalWalletExperienceContext

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



67
68
69
# File 'lib/paypal_server_sdk/models/paypal_wallet.rb', line 67

def experience_context
  @experience_context
end

#nameName

The name of the party.

Returns:



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

def name
  @name
end

#phonePhoneWithType

The phone information.

Returns:



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

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



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

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.



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/paypal_server_sdk/models/paypal_wallet.rb', line 128

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

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

.namesObject

A mapping from model property names to API property names.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/paypal_server_sdk/models/paypal_wallet.rb', line 75

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
end

.nullablesObject

An array for nullable fields



107
108
109
# File 'lib/paypal_server_sdk/models/paypal_wallet.rb', line 107

def self.nullables
  []
end

.optionalsObject

An array for optional fields



91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/paypal_server_sdk/models/paypal_wallet.rb', line 91

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