Class: Io::Flow::V0::Models::BrowserActionConfiguration

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

Overview

Configurations to support payment authentication done in the browser experience e.g. card authentication with 3DS by an issuer ACS.

Defined Under Namespace

Modules: Types

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ BrowserActionConfiguration

Returns a new instance of BrowserActionConfiguration.



10048
10049
10050
10051
10052
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10048

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:discriminator], 'BrowserActionConfiguration')
  @discriminator = HttpClient::Preconditions.assert_class('discriminator', opts.delete(:discriminator), String)
end

Instance Attribute Details

#discriminatorObject (readonly)

Returns the value of attribute discriminator.



10046
10047
10048
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10046

def discriminator
  @discriminator
end

Class Method Details

.from_json(hash) ⇒ Object



10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10062

def BrowserActionConfiguration.from_json(hash)
  HttpClient::Preconditions.assert_class('hash', hash, Hash)
  discriminator = HttpClient::Helper.symbolize_keys(hash)[:discriminator].to_s.strip
  if discriminator.empty?
    raise "Union type[browser_action_configuration] requires a field named 'discriminator'"
  end
  case discriminator
    when Types::CARD_BROWSER_ACTION_CONFIGURATION; CardBrowserActionConfiguration.new(hash)
    else BrowserActionConfigurationUndefinedType.new(:discriminator => discriminator)
  end
end

Instance Method Details

#subtype_to_hashObject



10054
10055
10056
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10054

def subtype_to_hash
  raise 'Cannot serialize an instance of browser_action_configuration directly - must use one of the specific types: card_browser_action_configuration'
end

#to_hashObject



10058
10059
10060
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10058

def to_hash
  subtype_to_hash.merge(:discriminator => @discriminator)
end