Class: PaypalServerSdk::SepaDebitExperienceContext

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

Overview

Customizes the payer experience during the approval process for the SEPA Debit payment.

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(return_url:, cancel_url:, locale: SKIP) ⇒ SepaDebitExperienceContext

Returns a new instance of SepaDebitExperienceContext.



53
54
55
56
57
# File 'lib/paypal_server_sdk/models/sepa_debit_experience_context.rb', line 53

def initialize(return_url:, cancel_url:, locale: SKIP)
  @locale = locale unless locale == SKIP
  @return_url = return_url
  @cancel_url = cancel_url
end

Instance Attribute Details

#cancel_urlString

Describes the URL.

Returns:

  • (String)


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

def cancel_url
  @cancel_url
end

#localeString

The [language tag](tools.ietf.org/html/bcp47#section-2) for the language in which to localize the error-related strings, such as messages, issues, and suggested actions. The tag is made up of the [ISO 639-2 language code](www.loc.gov/standards/iso639-2/php/code_list.php), the optional [ISO-15924 script tag](www.unicode.org/iso15924/codelists.html), and the [ISO-3166 alpha-2 country code](/api/rest/reference/country-codes/) or [M49 region code](unstats.un.org/unsd/methodology/m49/).

Returns:

  • (String)


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

def locale
  @locale
end

#return_urlString

Describes the URL.

Returns:

  • (String)


26
27
28
# File 'lib/paypal_server_sdk/models/sepa_debit_experience_context.rb', line 26

def return_url
  @return_url
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/paypal_server_sdk/models/sepa_debit_experience_context.rb', line 60

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  return_url = hash.key?('return_url') ? hash['return_url'] : nil
  cancel_url = hash.key?('cancel_url') ? hash['cancel_url'] : nil
  locale = hash.key?('locale') ? hash['locale'] : SKIP

  # Create object from extracted values.
  SepaDebitExperienceContext.new(return_url: return_url,
                                 cancel_url: cancel_url,
                                 locale: locale)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['locale'] = 'locale'
  @_hash['return_url'] = 'return_url'
  @_hash['cancel_url'] = 'cancel_url'
  @_hash
end

.nullablesObject

An array for nullable fields



49
50
51
# File 'lib/paypal_server_sdk/models/sepa_debit_experience_context.rb', line 49

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    locale
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



82
83
84
85
86
# File 'lib/paypal_server_sdk/models/sepa_debit_experience_context.rb', line 82

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

#to_sObject

Provides a human-readable string representation of the object.



75
76
77
78
79
# File 'lib/paypal_server_sdk/models/sepa_debit_experience_context.rb', line 75

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