class Beaver::Disputes

Disputes Model.

Attributes

amount[RW]

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

api_version[RW]

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

card_brand[RW]

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

create_time[RW]

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

currency[RW]

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

custom_data[RW]

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

documentation[RW]

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

fee[RW]

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

id[RW]

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

owner[RW]

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

path[RW]

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

payment[RW]

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

reason[RW]

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

resolution[RW]

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

resource[RW]

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

status[RW]

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

txnr_chargeback_app_fees[RW]

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

txnr_chargeback_merchant[RW]

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

txnr_chargeback_reversal_app_fee[RW]

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

txnr_chargeback_reversal_merchant[RW]

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

txnr_merchant_chargeback_fee[RW]

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

type[RW]

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

Public Class Methods

from_hash(hash) click to toggle source

Creates an instance of the object from a hash.

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

  # Extract variables from the hash.
  amount = hash['amount']
  create_time = hash['create_time']
  currency = hash['currency']
  documentation = Documentation.from_hash(hash['documentation']) if
    hash['documentation']
  fee = hash['fee']
  id = hash['id']
  owner = OwnerIsAccount.from_hash(hash['owner']) if hash['owner']
  path = hash['path']
  payment = PaymentNonExpanded.from_hash(hash['payment']) if
    hash['payment']
  card_brand = hash['card_brand']
  reason = DisputeReason.from_hash(hash['reason']) if hash['reason']
  resolution = Resolution.from_hash(hash['resolution']) if
    hash['resolution']
  resource = hash['resource']
  status = hash['status']
  if hash['txnr_chargeback_app_fees']
    txnr_chargeback_app_fees = TransactionRecordNonExpanded.from_hash(hash['txnr_chargeback_app_fees'])
  end
  if hash['txnr_chargeback_merchant']
    txnr_chargeback_merchant = TransactionRecordNonExpanded.from_hash(hash['txnr_chargeback_merchant'])
  end
  if hash['txnr_chargeback_reversal_app_fee']
    txnr_chargeback_reversal_app_fee = TransactionRecordNonExpanded.from_hash(hash['txnr_chargeback_reversal_app_fee'])
  end
  if hash['txnr_chargeback_reversal_merchant']
    txnr_chargeback_reversal_merchant = TransactionRecordNonExpanded.from_hash(hash['txnr_chargeback_reversal_merchant'])
  end
  if hash['txnr_merchant_chargeback_fee']
    txnr_merchant_chargeback_fee = TransactionRecordNonExpanded.from_hash(hash['txnr_merchant_chargeback_fee'])
  end
  type = hash['type']
  custom_data = hash['custom_data']
  api_version = hash['api_version']

  # Create object from extracted values.
  Disputes.new(amount,
               create_time,
               currency,
               documentation,
               fee,
               id,
               owner,
               path,
               payment,
               card_brand,
               reason,
               resolution,
               resource,
               status,
               txnr_chargeback_app_fees,
               txnr_chargeback_merchant,
               txnr_chargeback_reversal_app_fee,
               txnr_chargeback_reversal_merchant,
               txnr_merchant_chargeback_fee,
               type,
               custom_data,
               api_version)
end
names() click to toggle source

A mapping from model property names to API property names.

# File lib/beaver/models/disputes.rb, line 98
def self.names
  @_hash = {} if @_hash.nil?
  @_hash['amount'] = 'amount'
  @_hash['create_time'] = 'create_time'
  @_hash['currency'] = 'currency'
  @_hash['custom_data'] = 'custom_data'
  @_hash['documentation'] = 'documentation'
  @_hash['fee'] = 'fee'
  @_hash['id'] = 'id'
  @_hash['owner'] = 'owner'
  @_hash['path'] = 'path'
  @_hash['payment'] = 'payment'
  @_hash['card_brand'] = 'card_brand'
  @_hash['reason'] = 'reason'
  @_hash['resolution'] = 'resolution'
  @_hash['resource'] = 'resource'
  @_hash['status'] = 'status'
  @_hash['txnr_chargeback_app_fees'] = 'txnr_chargeback_app_fees'
  @_hash['txnr_chargeback_merchant'] = 'txnr_chargeback_merchant'
  @_hash['txnr_chargeback_reversal_app_fee'] =
    'txnr_chargeback_reversal_app_fee'
  @_hash['txnr_chargeback_reversal_merchant'] =
    'txnr_chargeback_reversal_merchant'
  @_hash['txnr_merchant_chargeback_fee'] = 'txnr_merchant_chargeback_fee'
  @_hash['type'] = 'type'
  @_hash['api_version'] = 'api_version'
  @_hash
end
new(amount = nil, create_time = nil, currency = nil, documentation = nil, fee = nil, id = nil, owner = nil, path = nil, payment = nil, card_brand = nil, reason = nil, resolution = nil, resource = nil, status = nil, txnr_chargeback_app_fees = nil, txnr_chargeback_merchant = nil, txnr_chargeback_reversal_app_fee = nil, txnr_chargeback_reversal_merchant = nil, txnr_merchant_chargeback_fee = nil, type = nil, custom_data = nil, api_version = nil) click to toggle source
# File lib/beaver/models/disputes.rb, line 127
def initialize(amount = nil,
               create_time = nil,
               currency = nil,
               documentation = nil,
               fee = nil,
               id = nil,
               owner = nil,
               path = nil,
               payment = nil,
               card_brand = nil,
               reason = nil,
               resolution = nil,
               resource = nil,
               status = nil,
               txnr_chargeback_app_fees = nil,
               txnr_chargeback_merchant = nil,
               txnr_chargeback_reversal_app_fee = nil,
               txnr_chargeback_reversal_merchant = nil,
               txnr_merchant_chargeback_fee = nil,
               type = nil,
               custom_data = nil,
               api_version = nil)
  @amount = amount
  @create_time = create_time
  @currency = currency
  @custom_data = custom_data
  @documentation = documentation
  @fee = fee
  @id = id
  @owner = owner
  @path = path
  @payment = payment
  @card_brand = card_brand
  @reason = reason
  @resolution = resolution
  @resource = resource
  @status = status
  @txnr_chargeback_app_fees = txnr_chargeback_app_fees
  @txnr_chargeback_merchant = txnr_chargeback_merchant
  @txnr_chargeback_reversal_app_fee = txnr_chargeback_reversal_app_fee
  @txnr_chargeback_reversal_merchant = txnr_chargeback_reversal_merchant
  @txnr_merchant_chargeback_fee = txnr_merchant_chargeback_fee
  @type = type
  @api_version = api_version
end