Class: PaypalServerSdk::BLIKExperienceContext

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

Overview

Customizes the payer experience during the approval process for the BLIK payment.

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, locale: SKIP, shipping_preference: ShippingPreference::GET_FROM_FILE, return_url: SKIP, cancel_url: SKIP, consumer_ip: SKIP, consumer_user_agent: SKIP) ⇒ BLIKExperienceContext

Returns a new instance of BLIKExperienceContext.



84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/paypal_server_sdk/models/blik_experience_context.rb', line 84

def initialize(brand_name: SKIP, locale: SKIP,
               shipping_preference: ShippingPreference::GET_FROM_FILE,
               return_url: SKIP, cancel_url: SKIP, consumer_ip: SKIP,
               consumer_user_agent: SKIP)
  @brand_name = brand_name unless brand_name == SKIP
  @locale = locale unless locale == SKIP
  @shipping_preference = shipping_preference unless shipping_preference == SKIP
  @return_url = return_url unless return_url == SKIP
  @cancel_url = cancel_url unless cancel_url == SKIP
  @consumer_ip = consumer_ip unless consumer_ip == SKIP
  @consumer_user_agent = consumer_user_agent unless consumer_user_agent == SKIP
end

Instance Attribute Details

#brand_nameString

The label that overrides the business name in the PayPal account on the PayPal site. The pattern is defined by an external party and supports Unicode.

Returns:

  • (String)


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

def brand_name
  @brand_name
end

#cancel_urlString

Describes the URL.

Returns:

  • (String)


40
41
42
# File 'lib/paypal_server_sdk/models/blik_experience_context.rb', line 40

def cancel_url
  @cancel_url
end

#consumer_ipString

An Internet Protocol address (IP address). This address assigns a numerical label to each device that is connected to a computer network through the Internet Protocol. Supports IPv4 and IPv6 addresses.

Returns:

  • (String)


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

def consumer_ip
  @consumer_ip
end

#consumer_user_agentString

The payer’s User Agent. For example, Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0).

Returns:

  • (String)


51
52
53
# File 'lib/paypal_server_sdk/models/blik_experience_context.rb', line 51

def consumer_user_agent
  @consumer_user_agent
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)


28
29
30
# File 'lib/paypal_server_sdk/models/blik_experience_context.rb', line 28

def locale
  @locale
end

#return_urlString

Describes the URL.

Returns:

  • (String)


36
37
38
# File 'lib/paypal_server_sdk/models/blik_experience_context.rb', line 36

def return_url
  @return_url
end

#shipping_preferenceShippingPreference

The location from which the shipping address is derived.

Returns:



32
33
34
# File 'lib/paypal_server_sdk/models/blik_experience_context.rb', line 32

def shipping_preference
  @shipping_preference
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/paypal_server_sdk/models/blik_experience_context.rb', line 98

def self.from_hash(hash)
  return nil unless hash

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

  # Create object from extracted values.
  BLIKExperienceContext.new(brand_name: brand_name,
                            locale: locale,
                            shipping_preference: shipping_preference,
                            return_url: return_url,
                            cancel_url: cancel_url,
                            consumer_ip: consumer_ip,
                            consumer_user_agent: consumer_user_agent)
end

.namesObject

A mapping from model property names to API property names.



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

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

.nullablesObject

An array for nullable fields



80
81
82
# File 'lib/paypal_server_sdk/models/blik_experience_context.rb', line 80

def self.nullables
  []
end

.optionalsObject

An array for optional fields



67
68
69
70
71
72
73
74
75
76
77
# File 'lib/paypal_server_sdk/models/blik_experience_context.rb', line 67

def self.optionals
  %w[
    brand_name
    locale
    shipping_preference
    return_url
    cancel_url
    consumer_ip
    consumer_user_agent
  ]
end