class Io::Flow::V0::Models::TokenType

Attributes

value[R]

Public Class Methods

ALL() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 27738
def TokenType.ALL
  @@all ||= [TokenType.permanent, TokenType.one_time]
end
apply(value) click to toggle source

Returns the instance of TokenType for this value, creating a new instance for an unknown value

# File lib/flow_commerce/flow_api_v0_client.rb, line 27723
def TokenType.apply(value)
  if value.instance_of?(TokenType)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || TokenType.new(value))
  end
end
from_string(value) click to toggle source

Returns the instance of TokenType for this value, or nil if not found

# File lib/flow_commerce/flow_api_v0_client.rb, line 27733
def TokenType.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  TokenType.ALL.find { |v| v.value == value }
end
new(value) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 27718
def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end
one_time() click to toggle source

Create a one time token for the card. This token can be used to either authorized payment or later exchange for a permanent token. Once used, this token cannot be used for future activity.

# File lib/flow_commerce/flow_api_v0_client.rb, line 27750
def TokenType.one_time
  @@_one_time ||= TokenType.new('one_time')
end
permanent() click to toggle source

Create a permanent token for the card (stored up until normal purge interval)

# File lib/flow_commerce/flow_api_v0_client.rb, line 27743
def TokenType.permanent
  @@_permanent ||= TokenType.new('permanent')
end

Public Instance Methods

to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 27754
def to_hash
  value
end