Class: GoCardlessPro::Resources::PayoutItem

Inherits:
Object
  • Object
show all
Defined in:
lib/gocardless_pro/resources/payout_item.rb

Overview

When we collect a payment on your behalf, we add the money you’ve collected to your GoCardless balance, minus any fees paid. Periodically (usually every working day), we take any positive balance in your GoCardless account, and pay it out to your nominated bank account.

Other actions in your GoCardless account can also affect your balance. For example, if a customer charges back a payment, we’ll deduct the payment’s amount from your balance, but add any fees you paid for that payment back to your balance.

The Payout Items API allows you to view, on a per-payout basis, the credit and debit items that make up that payout’s amount.

Defined Under Namespace

Classes: Links

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, response = nil) ⇒ PayoutItem

Initialize a payout_item resource instance

Parameters:

  • object (Hash)

    an object returned from the API



39
40
41
42
43
44
45
46
# File 'lib/gocardless_pro/resources/payout_item.rb', line 39

def initialize(object, response = nil)
  @object = object

  @amount = object['amount']
  @links = object['links']
  @type = object['type']
  @response = response
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



34
35
36
# File 'lib/gocardless_pro/resources/payout_item.rb', line 34

def amount
  @amount
end

#typeObject (readonly)

Returns the value of attribute type.



35
36
37
# File 'lib/gocardless_pro/resources/payout_item.rb', line 35

def type
  @type
end

Instance Method Details

#api_responseObject



48
49
50
# File 'lib/gocardless_pro/resources/payout_item.rb', line 48

def api_response
  ApiResponse.new(@response)
end

Return the links that the resource has



53
54
55
# File 'lib/gocardless_pro/resources/payout_item.rb', line 53

def links
  @payout_item_links ||= Links.new(@links)
end

#to_hObject

Provides the payout_item resource as a hash of all its readable attributes



58
59
60
# File 'lib/gocardless_pro/resources/payout_item.rb', line 58

def to_h
  @object
end