class Beaver::TerminalResp

TerminalResp Model.

Attributes

api_version[RW]

Owner structure to be used in any resource where an account is the owner @return [String]

gateway_id[RW]

Unique identifier of the terminal used by our payment gateway @return [String]

id[RW]

TODO: Write general description for this method @return [String]

last_call_home[RW]

The epoch timestamp of the last time this terminal called home. @return [Integer]

model[RW]

The serial number of the terminal. @return [ModelEnum]

owner[RW]

Owner structure to be used in any resource where an account is the owner @return [OwnerIsAccount]

path[RW]

TODO: Write general description for this method @return [String]

reference_id[RW]

The serial number of the terminal. @return [String]

resource[RW]

TODO: Write general description for this method @return [String]

serial_number[RW]

The serial number of the terminal. @return [String]

status[RW]

The status of the terminal. Active means the terminal is able to accept authorizations. Inactive means the terminal has been deactivated and is unable to accept payments (this can occur for risk and fraud related reasons). @return [TerminalsStatusEnum]

terminal_application_version[RW]

The version of the application running on the terminal. @return [String]

terminal_configuration[RW]

The version of the application running on the terminal. @return [TerminalConfiguration]

Public Class Methods

from_hash(hash) click to toggle source

Creates an instance of the object from a hash.

# File lib/beaver/models/terminal_resp.rb, line 112
def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash['id']
  resource = hash['resource']
  path = hash['path']
  owner = OwnerIsAccount.from_hash(hash['owner']) if hash['owner']
  api_version = hash['api_version']
  status = hash['status']
  serial_number = hash['serial_number']
  model = hash['model']
  last_call_home = hash['last_call_home']
  terminal_application_version = hash['terminal_application_version']
  if hash['terminal_configuration']
    terminal_configuration = TerminalConfiguration.from_hash(hash['terminal_configuration'])
  end
  reference_id = hash['reference_id']
  gateway_id = hash['gateway_id']

  # Create object from extracted values.
  TerminalResp.new(id,
                   resource,
                   path,
                   owner,
                   api_version,
                   status,
                   serial_number,
                   model,
                   last_call_home,
                   terminal_application_version,
                   terminal_configuration,
                   reference_id,
                   gateway_id)
end
names() click to toggle source

A mapping from model property names to API property names.

# File lib/beaver/models/terminal_resp.rb, line 65
def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['resource'] = 'resource'
  @_hash['path'] = 'path'
  @_hash['owner'] = 'owner'
  @_hash['api_version'] = 'api_version'
  @_hash['status'] = 'status'
  @_hash['serial_number'] = 'serial_number'
  @_hash['model'] = 'model'
  @_hash['reference_id'] = 'reference_id'
  @_hash['last_call_home'] = 'last_call_home'
  @_hash['terminal_application_version'] = 'terminal_application_version'
  @_hash['terminal_configuration'] = 'terminal_configuration'
  @_hash['gateway_id'] = 'gateway_id'
  @_hash
end
new(id = nil, resource = nil, path = nil, owner = nil, api_version = nil, status = nil, serial_number = nil, model = nil, last_call_home = nil, terminal_application_version = nil, terminal_configuration = nil, reference_id = nil, gateway_id = nil) click to toggle source
# File lib/beaver/models/terminal_resp.rb, line 83
def initialize(id = nil,
               resource = nil,
               path = nil,
               owner = nil,
               api_version = nil,
               status = nil,
               serial_number = nil,
               model = nil,
               last_call_home = nil,
               terminal_application_version = nil,
               terminal_configuration = nil,
               reference_id = nil,
               gateway_id = nil)
  @id = id
  @resource = resource
  @path = path
  @owner = owner
  @api_version = api_version
  @status = status
  @serial_number = serial_number
  @model = model
  @reference_id = reference_id
  @last_call_home = last_call_home
  @terminal_application_version = terminal_application_version
  @terminal_configuration = terminal_configuration
  @gateway_id = gateway_id
end