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.



25208
25209
25210
25211
25212
25213
25214
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25208

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

Instance Attribute Details

#client_tokenObject (readonly)

Returns the value of attribute client_token.



25206
25207
25208
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25206

def client_token
  @client_token
end

#idObject (readonly)

Returns the value of attribute id.



25206
25207
25208
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25206

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



25220
25221
25222
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25220

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

#subtype_to_hashObject



25224
25225
25226
25227
25228
25229
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25224

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

#to_jsonObject



25216
25217
25218
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25216

def to_json
  JSON.dump(to_hash)
end