Class: Io::Flow::V0::Models::ActionExecuteScript

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

Overview

Render the returned HTML script from the payment provider, which will gather browser data to inform the authorization decision. After several seconds, the payment request will asynchronously update based on the results of the script.

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 = {}) ⇒ ActionExecuteScript

Returns a new instance of ActionExecuteScript.



25373
25374
25375
25376
25377
25378
25379
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25373

def initialize(incoming={})
  super(:type => Action::Types::ACTION_EXECUTE_SCRIPT)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:script], 'ActionExecuteScript')
  @expires_at = (x = opts.delete(:expires_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('expires_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
  @script = HttpClient::Preconditions.assert_class('script', opts.delete(:script), String)
end

Instance Attribute Details

#expires_atObject (readonly)

Returns the value of attribute expires_at.



25371
25372
25373
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25371

def expires_at
  @expires_at
end

#scriptObject (readonly)

Returns the value of attribute script.



25371
25372
25373
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25371

def script
  @script
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



25385
25386
25387
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25385

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

#subtype_to_hashObject



25389
25390
25391
25392
25393
25394
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25389

def subtype_to_hash
  {
    :expires_at => expires_at,
    :script => script
  }
end

#to_jsonObject



25381
25382
25383
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25381

def to_json
  JSON.dump(to_hash)
end