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

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

Returns a new instance of VenmoWalletRequest.



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

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.



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

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

def email_address
  @email_address
end

#experience_contextVenmoWalletExperienceContext

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



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

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.



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

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.



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

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



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

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

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



96
97
98
99
100
# File 'lib/paypal_server_sdk/models/venmo_wallet_request.rb', line 96

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

#to_sObject

Provides a human-readable string representation of the object.



89
90
91
92
93
# File 'lib/paypal_server_sdk/models/venmo_wallet_request.rb', line 89

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