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: VenmoWalletExperienceContextShippingPreference::GET_FROM_FILE, order_update_callback_config: SKIP, user_action: VenmoWalletExperienceContextUserAction::CONTINUE) ⇒ VenmoWalletExperienceContext

Returns a new instance of VenmoWalletExperienceContext.



56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/paypal_server_sdk/models/venmo_wallet_experience_context.rb', line 56

def initialize(
  brand_name: SKIP,
  shipping_preference: VenmoWalletExperienceContextShippingPreference::GET_FROM_FILE,
  order_update_callback_config: SKIP,
  user_action: VenmoWalletExperienceContextUserAction::CONTINUE
)
  @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
  @user_action = user_action unless user_action == 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)


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_preferenceVenmoWalletExperienceContextShippingPreference

The location from which the shipping address is derived.



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

def shipping_preference
  @shipping_preference
end

#user_actionVenmoWalletExperienceContextUserAction

Configures a Continue or Pay Now checkout flow.



29
30
31
# File 'lib/paypal_server_sdk/models/venmo_wallet_experience_context.rb', line 29

def user_action
  @user_action
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

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'] ||= VenmoWalletExperienceContextShippingPreference::GET_FROM_FILE
  if hash['order_update_callback_config']
    order_update_callback_config = CallbackConfiguration.from_hash(hash['order_update_callback_config'])
  end
  user_action =
    hash['user_action'] ||= VenmoWalletExperienceContextUserAction::CONTINUE

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

.namesObject

A mapping from model property names to API property names.



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

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['user_action'] = 'user_action'
  @_hash
end

.nullablesObject

An array for nullable fields



52
53
54
# File 'lib/paypal_server_sdk/models/venmo_wallet_experience_context.rb', line 52

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

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

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



101
102
103
104
105
106
# File 'lib/paypal_server_sdk/models/venmo_wallet_experience_context.rb', line 101

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}, user_action: #{@user_action.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



93
94
95
96
97
98
# File 'lib/paypal_server_sdk/models/venmo_wallet_experience_context.rb', line 93

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}, user_action:"\
  " #{@user_action}>"
end