class Beaver::InterchangeFee

InterchangeFee Model.

Attributes

currency[RW]

Transaction fee category. @return [CurrencyEnum]

fee_category[RW]

Transaction fee category. @return [String]

fee_type[RW]

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

fixed_fee_amount[RW]

Fixed fee amount. @return [Integer]

fixed_fee_markup_amount[RW]

Fixed fee markup amount. @return [Integer]

item_count[RW]

Number of transactions in a billing statement for the given fee type and fee category. @return [Integer]

total_amount[RW]

Total transaction amount in a billing statement for the given fee type and fee category. @return [Integer]

total_fees[RW]

Total fee amount, sum of interchange fee amount, markup fee amount, and fee amount for other types. @return [Integer]

total_interchange_fee[RW]

Total interchange fee amount. @return [Integer]

total_markup[RW]

Total markup fee amount. @return [Integer]

variable_fee_bps[RW]

Basis points to calculate variable fee amount. @return [Integer]

variable_fee_markup_bps[RW]

Basis points to calculate variable markup fee amount. @return [Integer]

Public Class Methods

from_hash(hash) click to toggle source

Creates an instance of the object from a hash.

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

  # Extract variables from the hash.
  fee_type = hash['fee_type']
  fee_category = hash['fee_category']
  currency = hash['currency']
  total_amount = hash['total_amount']
  item_count = hash['item_count']
  total_fees = hash['total_fees']
  variable_fee_bps = hash['variable_fee_bps']
  fixed_fee_amount = hash['fixed_fee_amount']
  variable_fee_markup_bps = hash['variable_fee_markup_bps']
  fixed_fee_markup_amount = hash['fixed_fee_markup_amount']
  total_interchange_fee = hash['total_interchange_fee']
  total_markup = hash['total_markup']

  # Create object from extracted values.
  InterchangeFee.new(fee_type,
                     fee_category,
                     currency,
                     total_amount,
                     item_count,
                     total_fees,
                     variable_fee_bps,
                     fixed_fee_amount,
                     variable_fee_markup_bps,
                     fixed_fee_markup_amount,
                     total_interchange_fee,
                     total_markup)
end
names() click to toggle source

A mapping from model property names to API property names.

# File lib/beaver/models/interchange_fee.rb, line 61
def self.names
  @_hash = {} if @_hash.nil?
  @_hash['fee_type'] = 'fee_type'
  @_hash['fee_category'] = 'fee_category'
  @_hash['currency'] = 'currency'
  @_hash['total_amount'] = 'total_amount'
  @_hash['item_count'] = 'item_count'
  @_hash['variable_fee_bps'] = 'variable_fee_bps'
  @_hash['fixed_fee_amount'] = 'fixed_fee_amount'
  @_hash['variable_fee_markup_bps'] = 'variable_fee_markup_bps'
  @_hash['fixed_fee_markup_amount'] = 'fixed_fee_markup_amount'
  @_hash['total_interchange_fee'] = 'total_interchange_fee'
  @_hash['total_markup'] = 'total_markup'
  @_hash['total_fees'] = 'total_fees'
  @_hash
end
new(fee_type = nil, fee_category = nil, currency = nil, total_amount = nil, item_count = nil, total_fees = nil, variable_fee_bps = nil, fixed_fee_amount = nil, variable_fee_markup_bps = nil, fixed_fee_markup_amount = nil, total_interchange_fee = nil, total_markup = nil) click to toggle source
# File lib/beaver/models/interchange_fee.rb, line 78
def initialize(fee_type = nil,
               fee_category = nil,
               currency = nil,
               total_amount = nil,
               item_count = nil,
               total_fees = nil,
               variable_fee_bps = nil,
               fixed_fee_amount = nil,
               variable_fee_markup_bps = nil,
               fixed_fee_markup_amount = nil,
               total_interchange_fee = nil,
               total_markup = nil)
  @fee_type = fee_type
  @fee_category = fee_category
  @currency = currency
  @total_amount = total_amount
  @item_count = item_count
  @variable_fee_bps = variable_fee_bps
  @fixed_fee_amount = fixed_fee_amount
  @variable_fee_markup_bps = variable_fee_markup_bps
  @fixed_fee_markup_amount = fixed_fee_markup_amount
  @total_interchange_fee = total_interchange_fee
  @total_markup = total_markup
  @total_fees = total_fees
end