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. Note: Partners and Marketplaces might configure shipping_preference during partner account setup, which overrides the request values.

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(brand_name: SKIP, shipping_preference: ShippingPreference::GET_FROM_FILE, order_update_callback_config: SKIP) ⇒ VenmoWalletExperienceContext

Returns a new instance of VenmoWalletExperienceContext.



50
51
52
53
54
55
56
57
58
59
# File 'lib/paypal_server_sdk/models/venmo_wallet_experience_context.rb', line 50

def initialize(brand_name: SKIP,
               shipping_preference: ShippingPreference::GET_FROM_FILE,
               order_update_callback_config: SKIP)
  @brand_name = brand_name unless brand_name == SKIP
  @shipping_preference = shipping_preference unless shipping_preference == SKIP
  unless order_update_callback_config == SKIP
    @order_update_callback_config =
      order_update_callback_config
  end
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)


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

def brand_name
  @brand_name
end

#order_update_callback_configCallbackConfiguration

CallBack Configuration that the merchant can provide to PayPal/Venmo.



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

def order_update_callback_config
  @order_update_callback_config
end

#shipping_preferenceShippingPreference

The location from which the shipping address is derived.

Returns:



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

def shipping_preference
  @shipping_preference
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/paypal_server_sdk/models/venmo_wallet_experience_context.rb', line 62

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
  if hash['order_update_callback_config']
    order_update_callback_config = CallbackConfiguration.from_hash(hash['order_update_callback_config'])
  end

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

.namesObject

A mapping from model property names to API property names.



28
29
30
31
32
33
34
# File 'lib/paypal_server_sdk/models/venmo_wallet_experience_context.rb', line 28

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

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    brand_name
    shipping_preference
    order_update_callback_config
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



87
88
89
90
91
92
# File 'lib/paypal_server_sdk/models/venmo_wallet_experience_context.rb', line 87

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} brand_name: #{@brand_name.inspect}, shipping_preference:"\
  " #{@shipping_preference.inspect}, order_update_callback_config:"\
  " #{@order_update_callback_config.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



80
81
82
83
84
# File 'lib/paypal_server_sdk/models/venmo_wallet_experience_context.rb', line 80

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} brand_name: #{@brand_name}, shipping_preference: #{@shipping_preference},"\
  " order_update_callback_config: #{@order_update_callback_config}>"
end