Class: PaypalServerSdk::VenmoWalletExperienceContext

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

Overview

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>

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(brand_name: SKIP, shipping_preference: ShippingPreference::GET_FROM_FILE) ⇒ VenmoWalletExperienceContext

Returns a new instance of VenmoWalletExperienceContext.



45
46
47
48
49
# File 'lib/paypal_server_sdk/models/venmo_wallet_experience_context.rb', line 45

def initialize(brand_name: SKIP,
               shipping_preference: ShippingPreference::GET_FROM_FILE)
  @brand_name = brand_name unless brand_name == SKIP
  @shipping_preference = shipping_preference unless shipping_preference == SKIP
end

Instance Attribute Details

#brand_nameString

The business name of the merchant. The pattern is defined by an external party and supports Unicode.

Returns:

  • (String)


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

def brand_name
  @brand_name
end

#shipping_preferenceShippingPreference

The location from which the shipping address is derived.

Returns:



22
23
24
# File 'lib/paypal_server_sdk/models/venmo_wallet_experience_context.rb', line 22

def shipping_preference
  @shipping_preference
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/paypal_server_sdk/models/venmo_wallet_experience_context.rb', line 52

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  brand_name = hash.key?('brand_name') ? hash['brand_name'] : SKIP
  shipping_preference =
    hash['shipping_preference'] ||= ShippingPreference::GET_FROM_FILE

  # Create object from extracted values.
  VenmoWalletExperienceContext.new(brand_name: brand_name,
                                   shipping_preference: shipping_preference)
end

.namesObject

A mapping from model property names to API property names.



25
26
27
28
29
30
# File 'lib/paypal_server_sdk/models/venmo_wallet_experience_context.rb', line 25

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['brand_name'] = 'brand_name'
  @_hash['shipping_preference'] = 'shipping_preference'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



33
34
35
36
37
38
# File 'lib/paypal_server_sdk/models/venmo_wallet_experience_context.rb', line 33

def self.optionals
  %w[
    brand_name
    shipping_preference
  ]
end