Class: PaypalServerSdk::VenmoWalletRequest

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

Overview

Information needed to pay using Venmo.

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, experience_context: SKIP, attributes: SKIP) ⇒ VenmoWalletRequest

Returns a new instance of VenmoWalletRequest.



62
63
64
65
66
67
68
# File 'lib/paypal_server_sdk/models/venmo_wallet_request.rb', line 62

def initialize(vault_id: SKIP, email_address: SKIP,
               experience_context: SKIP, attributes: SKIP)
  @vault_id = vault_id unless vault_id == SKIP
  @email_address = email_address unless email_address == SKIP
  @experience_context = experience_context unless experience_context == SKIP
  @attributes = attributes unless attributes == SKIP
end

Instance Attribute Details

#attributesVenmoWalletAdditionalAttributes

Additional attributes associated with the use of this Venmo Wallet.



35
36
37
# File 'lib/paypal_server_sdk/models/venmo_wallet_request.rb', line 35

def attributes
  @attributes
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/venmo_wallet_request.rb', line 24

def email_address
  @email_address
end

#experience_contextVenmoWalletExperienceContext

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



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

def experience_context
  @experience_context
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/venmo_wallet_request.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.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/paypal_server_sdk/models/venmo_wallet_request.rb', line 71

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
  experience_context = VenmoWalletExperienceContext.from_hash(hash['experience_context']) if
    hash['experience_context']
  attributes = VenmoWalletAdditionalAttributes.from_hash(hash['attributes']) if
    hash['attributes']

  # Create object from extracted values.
  VenmoWalletRequest.new(vault_id: vault_id,
                         email_address: email_address,
                         experience_context: experience_context,
                         attributes: attributes)
end

.namesObject

A mapping from model property names to API property names.



38
39
40
41
42
43
44
45
# File 'lib/paypal_server_sdk/models/venmo_wallet_request.rb', line 38

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['vault_id'] = 'vault_id'
  @_hash['email_address'] = 'email_address'
  @_hash['experience_context'] = 'experience_context'
  @_hash['attributes'] = 'attributes'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



48
49
50
51
52
53
54
55
# File 'lib/paypal_server_sdk/models/venmo_wallet_request.rb', line 48

def self.optionals
  %w[
    vault_id
    email_address
    experience_context
    attributes
  ]
end