Class: Io::Flow::V0::Models::CheckoutTokenForm

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ CheckoutTokenForm

Returns a new instance of CheckoutTokenForm.



21397
21398
21399
21400
21401
21402
21403
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21397

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:order_number, :session_id, :urls], 'CheckoutTokenForm')
  @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.



21395
21396
21397
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21395

def order_number
  @order_number
end

#session_idObject (readonly)

Returns the value of attribute session_id.



21395
21396
21397
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21395

def session_id
  @session_id
end

#urlsObject (readonly)

Returns the value of attribute urls.



21395
21396
21397
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21395

def urls
  @urls
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



21409
21410
21411
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21409

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

#to_hashObject



21413
21414
21415
21416
21417
21418
21419
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21413

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

#to_jsonObject



21405
21406
21407
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21405

def to_json
  JSON.dump(to_hash)
end