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.



29027
29028
29029
29030
29031
29032
29033
29034
29035
29036
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29027

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.



29025
29026
29027
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29025

def data
  @data
end

#expires_atObject (readonly)

Returns the value of attribute expires_at.



29025
29026
29027
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29025

def expires_at
  @expires_at
end

#methodObject (readonly)

Returns the value of attribute method.



29025
29026
29027
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29025

def method
  @method
end

#urlObject (readonly)

Returns the value of attribute url.



29025
29026
29027
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29025

def url
  @url
end

#window_sizeObject (readonly)

Returns the value of attribute window_size.



29025
29026
29027
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29025

def window_size
  @window_size
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



29042
29043
29044
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29042

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

#subtype_to_hashObject



29046
29047
29048
29049
29050
29051
29052
29053
29054
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29046

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



29038
29039
29040
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29038

def to_json
  JSON.dump(to_hash)
end