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.



26880
26881
26882
26883
26884
26885
26886
26887
26888
26889
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26880

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.



26878
26879
26880
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26878

def data
  @data
end

#expires_atObject (readonly)

Returns the value of attribute expires_at.



26878
26879
26880
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26878

def expires_at
  @expires_at
end

#methodObject (readonly)

Returns the value of attribute method.



26878
26879
26880
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26878

def method
  @method
end

#urlObject (readonly)

Returns the value of attribute url.



26878
26879
26880
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26878

def url
  @url
end

#window_sizeObject (readonly)

Returns the value of attribute window_size.



26878
26879
26880
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26878

def window_size
  @window_size
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



26895
26896
26897
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26895

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

#subtype_to_hashObject



26899
26900
26901
26902
26903
26904
26905
26906
26907
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26899

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



26891
26892
26893
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26891

def to_json
  JSON.dump(to_hash)
end