Class: Io::Flow::V0::Models::InlineAuthorizationDetails

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

Overview

Represents an online payment that requires the client token from underlying payment processor before entering their payment information.

Instance Attribute Summary collapse

Attributes inherited from OnlineAuthorizationDetails

#discriminator

Instance Method Summary collapse

Methods inherited from OnlineAuthorizationDetails

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ InlineAuthorizationDetails

Returns a new instance of InlineAuthorizationDetails.



30970
30971
30972
30973
30974
30975
30976
30977
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30970

def initialize(incoming={})
  super(:discriminator => OnlineAuthorizationDetails::Types::INLINE_AUTHORIZATION_DETAILS)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id], 'InlineAuthorizationDetails')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @client_token = (x = opts.delete(:client_token); x.nil? ? nil : HttpClient::Preconditions.assert_class('client_token', x, String))
  @parameters = (x = opts.delete(:parameters); x.nil? ? nil : HttpClient::Preconditions.assert_class('parameters', HttpClient::Helper.to_object(x), Hash))
end

Instance Attribute Details

#client_tokenObject (readonly)

Returns the value of attribute client_token.



30968
30969
30970
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30968

def client_token
  @client_token
end

#idObject (readonly)

Returns the value of attribute id.



30968
30969
30970
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30968

def id
  @id
end

#parametersObject (readonly)

Returns the value of attribute parameters.



30968
30969
30970
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30968

def parameters
  @parameters
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



30983
30984
30985
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30983

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

#subtype_to_hashObject



30987
30988
30989
30990
30991
30992
30993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30987

def subtype_to_hash
  {
    :id => id,
    :client_token => client_token,
    :parameters => parameters
  }
end

#to_jsonObject



30979
30980
30981
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30979

def to_json
  JSON.dump(to_hash)
end