Class: PaypalServerSdk::CallbackConfiguration

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

Overview

CallBack Configuration that the merchant can provide to PayPal/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(callback_events:, callback_url:) ⇒ CallbackConfiguration

Returns a new instance of CallbackConfiguration.



42
43
44
45
# File 'lib/paypal_server_sdk/models/callback_configuration.rb', line 42

def initialize(callback_events:, callback_url:)
  @callback_events = callback_events
  @callback_url = callback_url
end

Instance Attribute Details

#callback_eventsArray[CallbackEvents]

An array of callback events merchant can subscribe to for the corresponding callback url.

Returns:



15
16
17
# File 'lib/paypal_server_sdk/models/callback_configuration.rb', line 15

def callback_events
  @callback_events
end

#callback_urlString

Merchant provided CallBack url.PayPal/Venmo will use this url to call the merchant back when the events occur .PayPal/Venmo expects a secured url usually in the https format.merchant can append the cart id or other params part of the url as query or path params.

Returns:

  • (String)


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

def callback_url
  @callback_url
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  callback_events =
    hash.key?('callback_events') ? hash['callback_events'] : nil
  callback_url = hash.key?('callback_url') ? hash['callback_url'] : nil

  # Create object from extracted values.
  CallbackConfiguration.new(callback_events: callback_events,
                            callback_url: callback_url)
end

.namesObject

A mapping from model property names to API property names.



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

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

.nullablesObject

An array for nullable fields



38
39
40
# File 'lib/paypal_server_sdk/models/callback_configuration.rb', line 38

def self.nullables
  []
end

.optionalsObject

An array for optional fields



33
34
35
# File 'lib/paypal_server_sdk/models/callback_configuration.rb', line 33

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



68
69
70
71
72
# File 'lib/paypal_server_sdk/models/callback_configuration.rb', line 68

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

#to_sObject

Provides a human-readable string representation of the object.



62
63
64
65
# File 'lib/paypal_server_sdk/models/callback_configuration.rb', line 62

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} callback_events: #{@callback_events}, callback_url: #{@callback_url}>"
end