Class: Io::Flow::V0::Models::BrowserInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

Shopper browser info used as part of card authentication. All of these fields are required if you are using 3DS2.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ BrowserInfo

Returns a new instance of BrowserInfo.



30084
30085
30086
30087
30088
30089
30090
30091
30092
30093
30094
30095
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30084

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @origin = (x = opts.delete(:origin); x.nil? ? nil : HttpClient::Preconditions.assert_class('origin', x, String))
  @language = (x = opts.delete(:language); x.nil? ? nil : HttpClient::Preconditions.assert_class('language', x, String))
  @java_enabled = (x = opts.delete(:java_enabled); x.nil? ? nil : HttpClient::Preconditions.assert_boolean('java_enabled', x))
  @color_depth = (x = opts.delete(:color_depth); x.nil? ? nil : HttpClient::Preconditions.assert_class('color_depth', x, Integer))
  @screen_height = (x = opts.delete(:screen_height); x.nil? ? nil : HttpClient::Preconditions.assert_class('screen_height', x, Integer))
  @screen_width = (x = opts.delete(:screen_width); x.nil? ? nil : HttpClient::Preconditions.assert_class('screen_width', x, Integer))
  @time_zone_offset = (x = opts.delete(:time_zone_offset); x.nil? ? nil : HttpClient::Preconditions.assert_class('time_zone_offset', x, Integer))
  @user_agent = (x = opts.delete(:user_agent); x.nil? ? nil : HttpClient::Preconditions.assert_class('user_agent', x, String))
  @accept = (x = opts.delete(:accept); x.nil? ? nil : HttpClient::Preconditions.assert_class('accept', x, String))
end

Instance Attribute Details

#acceptObject (readonly)

Returns the value of attribute accept.



30082
30083
30084
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30082

def accept
  @accept
end

#color_depthObject (readonly)

Returns the value of attribute color_depth.



30082
30083
30084
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30082

def color_depth
  @color_depth
end

#java_enabledObject (readonly)

Returns the value of attribute java_enabled.



30082
30083
30084
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30082

def java_enabled
  @java_enabled
end

#languageObject (readonly)

Returns the value of attribute language.



30082
30083
30084
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30082

def language
  @language
end

#originObject (readonly)

Returns the value of attribute origin.



30082
30083
30084
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30082

def origin
  @origin
end

#screen_heightObject (readonly)

Returns the value of attribute screen_height.



30082
30083
30084
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30082

def screen_height
  @screen_height
end

#screen_widthObject (readonly)

Returns the value of attribute screen_width.



30082
30083
30084
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30082

def screen_width
  @screen_width
end

#time_zone_offsetObject (readonly)

Returns the value of attribute time_zone_offset.



30082
30083
30084
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30082

def time_zone_offset
  @time_zone_offset
end

#user_agentObject (readonly)

Returns the value of attribute user_agent.



30082
30083
30084
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30082

def user_agent
  @user_agent
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



30101
30102
30103
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30101

def copy(incoming={})
  BrowserInfo.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



30105
30106
30107
30108
30109
30110
30111
30112
30113
30114
30115
30116
30117
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30105

def to_hash
  {
    :origin => origin,
    :language => language,
    :java_enabled => java_enabled,
    :color_depth => color_depth,
    :screen_height => screen_height,
    :screen_width => screen_width,
    :time_zone_offset => time_zone_offset,
    :user_agent => user_agent,
    :accept => accept
  }
end

#to_jsonObject



30097
30098
30099
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30097

def to_json
  JSON.dump(to_hash)
end