Class: Io::Flow::V0::Models::CheckoutTokenReferenceForm

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

Overview

Use this form when order number and session id are known. Optional customer information will be created or updated.

Instance Attribute Summary collapse

Attributes inherited from CheckoutTokenForm

#discriminator

Instance Method Summary collapse

Methods inherited from CheckoutTokenForm

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ CheckoutTokenReferenceForm

Returns a new instance of CheckoutTokenReferenceForm.



26968
26969
26970
26971
26972
26973
26974
26975
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26968

def initialize(incoming={})
  super(:discriminator => CheckoutTokenForm::Types::CHECKOUT_TOKEN_REFERENCE_FORM)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:order_number, :session_id, :urls], 'CheckoutTokenReferenceForm')
  @order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String)
  @session_id = HttpClient::Preconditions.assert_class('session_id', opts.delete(:session_id), String)
  @urls = (x = opts.delete(:urls); x.is_a?(::Io::Flow::V0::Models::CheckoutUrlsForm) ? x : ::Io::Flow::V0::Models::CheckoutUrlsForm.new(x))
end

Instance Attribute Details

#order_numberObject (readonly)

Returns the value of attribute order_number.



26966
26967
26968
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26966

def order_number
  @order_number
end

#session_idObject (readonly)

Returns the value of attribute session_id.



26966
26967
26968
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26966

def session_id
  @session_id
end

#urlsObject (readonly)

Returns the value of attribute urls.



26966
26967
26968
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26966

def urls
  @urls
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



26981
26982
26983
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26981

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

#subtype_to_hashObject



26985
26986
26987
26988
26989
26990
26991
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26985

def subtype_to_hash
  {
    :order_number => order_number,
    :session_id => session_id,
    :urls => urls.to_hash
  }
end

#to_jsonObject



26977
26978
26979
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26977

def to_json
  JSON.dump(to_hash)
end