class GoCardlessPro::Resources::Payout

Payouts represent transfers from GoCardless to a [creditor](core-endpoints-creditors). Each payout contains the funds collected from one or many [payments](core-endpoints-payments). All the payments in a payout will have been collected in the same currency. Payouts are created automatically after a payment has been successfully collected.

Attributes

amount[R]
arrival_date[R]
created_at[R]
currency[R]
deducted_fees[R]
fx[R]
id[R]
metadata[R]
payout_type[R]
reference[R]
status[R]
tax_currency[R]

Public Class Methods

new(object, response = nil) click to toggle source

Initialize a payout resource instance @param object [Hash] an object returned from the API

# File lib/gocardless_pro/resources/payout.rb, line 37
def initialize(object, response = nil)
  @object = object

  @amount = object['amount']
  @arrival_date = object['arrival_date']
  @created_at = object['created_at']
  @currency = object['currency']
  @deducted_fees = object['deducted_fees']
  @fx = object['fx']
  @id = object['id']
  @links = object['links']
  @metadata = object['metadata']
  @payout_type = object['payout_type']
  @reference = object['reference']
  @status = object['status']
  @tax_currency = object['tax_currency']
  @response = response
end

Public Instance Methods

api_response() click to toggle source
# File lib/gocardless_pro/resources/payout.rb, line 56
def api_response
  ApiResponse.new(@response)
end
to_h() click to toggle source

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

# File lib/gocardless_pro/resources/payout.rb, line 66
def to_h
  @object
end