Class: Io::Flow::V0::Models::ActionDisplayInlineWindow

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

Overview

Render a visible window or iframe and open the returned url with a ‘window.open` or an HTML form POST. This will load the payment provider’s experience, which the customer will interact with to complete the transaction. After several minutes, the payment request will asynchronously update based on the results of the transaction.

Instance Attribute Summary collapse

Attributes inherited from Action

#type

Instance Method Summary collapse

Methods inherited from Action

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ ActionDisplayInlineWindow

Returns a new instance of ActionDisplayInlineWindow.



25335
25336
25337
25338
25339
25340
25341
25342
25343
25344
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25335

def initialize(incoming={})
  super(:type => Action::Types::ACTION_DISPLAY_INLINE_WINDOW)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:method, :url], 'ActionDisplayInlineWindow')
  @expires_at = (x = opts.delete(:expires_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('expires_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
  @method = HttpClient::Preconditions.assert_class('method', opts.delete(:method), String)
  @url = HttpClient::Preconditions.assert_class('url', opts.delete(:url), String)
  @data = (x = opts.delete(:data); x.nil? ? nil : HttpClient::Preconditions.assert_class('data', HttpClient::Helper.to_object(x), Hash))
  @window_size = (x = opts.delete(:window_size); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::InlineWindowViewportSize) ? x : ::Io::Flow::V0::Models::InlineWindowViewportSize.apply(x)))
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



25333
25334
25335
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25333

def data
  @data
end

#expires_atObject (readonly)

Returns the value of attribute expires_at.



25333
25334
25335
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25333

def expires_at
  @expires_at
end

#methodObject (readonly)

Returns the value of attribute method.



25333
25334
25335
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25333

def method
  @method
end

#urlObject (readonly)

Returns the value of attribute url.



25333
25334
25335
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25333

def url
  @url
end

#window_sizeObject (readonly)

Returns the value of attribute window_size.



25333
25334
25335
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25333

def window_size
  @window_size
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



25350
25351
25352
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25350

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

#subtype_to_hashObject



25354
25355
25356
25357
25358
25359
25360
25361
25362
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25354

def subtype_to_hash
  {
    :expires_at => expires_at,
    :method => method,
    :url => url,
    :data => data,
    :window_size => window_size.nil? ? nil : window_size.value
  }
end

#to_jsonObject



25346
25347
25348
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25346

def to_json
  JSON.dump(to_hash)
end