class Braintree::Disbursement

Attributes

amount[R]
disbursement_date[R]
disbursement_type[R]
exception_message[R]
follow_up_action[R]
id[R]
merchant_account[R]
retry[R]
success[R]
success?[R]
transaction_ids[R]

Public Class Methods

_inspect_attributes() click to toggle source
# File lib/braintree/disbursement.rb, line 59
def self._inspect_attributes
  [:id, :exception_message, :follow_up_action, :merchant_account, :transaction_ids, :retry, :success]
end
_new(*args) click to toggle source
# File lib/braintree/disbursement.rb, line 54
def _new(*args)
  self.new(*args)
end

Protected Class Methods

new(gateway, attributes) click to toggle source
# File lib/braintree/disbursement.rb, line 23
def initialize(gateway, attributes)
  @gateway = gateway
  set_instance_variables_from_hash(attributes)
  @amount = Util.to_big_decimal(amount)
  @disbursement_date = Date.parse(disbursement_date)
  @merchant_account = MerchantAccount._new(gateway, @merchant_account)
end

Public Instance Methods

credit?() click to toggle source
# File lib/braintree/disbursement.rb, line 48
def credit?
  disbursement_type == Types::Credit
end
debit?() click to toggle source
# File lib/braintree/disbursement.rb, line 44
def debit?
  disbursement_type == Types::Debit
end
inspect() click to toggle source
# File lib/braintree/disbursement.rb, line 37
def inspect
  nice_attributes = self.class._inspect_attributes.map { |attr| "#{attr}: #{send(attr).inspect}" }
  nice_attributes << "amount: #{self.amount.to_s("F").inspect}"
  nice_attributes << "disbursement_date: #{self.disbursement_date}"
  "#<#{self.class} #{nice_attributes.join(', ')}>"
end
transactions() click to toggle source
# File lib/braintree/disbursement.rb, line 31
def transactions
  @gateway.transaction.search do |search|
    search.ids.in transaction_ids
  end
end