Class: Balanced::Credit

Inherits:
Object
  • Object
show all
Includes:
HypermediaRegistry, Resource
Defined in:
lib/balanced/resources/credit.rb

Overview

A Credit represents a transfer of funds from your Marketplace’s escrow account to a Merchant’s Account within your Marketplace.

By default, a Credit is sent to the most recently added funding destination associated with an Account. You may specify a specific funding source.

Instance Attribute Summary

Attributes included from Resource

#attributes, #href, #hyperlinks, #id, #links

Instance Method Summary collapse

Methods included from HypermediaRegistry

included

Methods included from Resource

#copy_from, #does_resource_respond_to?, #fetch, #hydrate, included, #initialize, #method_missing, #reload, #respond_to?, #respond_to_missing?, #sanitize, #save, #unstore

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Balanced::Resource

Instance Method Details

#reverse(options = {}) ⇒ Object



15
16
17
18
19
20
# File 'lib/balanced/resources/credit.rb', line 15

def reverse(options={})
  options[:href] = self.reversals.href

  reversal = Reversal.new(options)
  reversal.save
end