Class: GoCardlessPro::Resources::Payout
- Inherits:
-
Object
- Object
- GoCardlessPro::Resources::Payout
- Defined in:
- lib/gocardless_pro/resources/payout.rb
Overview
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.
Defined Under Namespace
Classes: Links
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#arrival_date ⇒ Object
readonly
Returns the value of attribute arrival_date.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#deducted_fees ⇒ Object
readonly
Returns the value of attribute deducted_fees.
-
#fx ⇒ Object
readonly
Returns the value of attribute fx.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#payout_type ⇒ Object
readonly
Returns the value of attribute payout_type.
-
#reference ⇒ Object
readonly
Returns the value of attribute reference.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#tax_currency ⇒ Object
readonly
Returns the value of attribute tax_currency.
Instance Method Summary collapse
- #api_response ⇒ Object
-
#initialize(object, response = nil) ⇒ Payout
constructor
Initialize a payout resource instance.
-
#links ⇒ Object
Return the links that the resource has.
-
#to_h ⇒ Object
Provides the payout resource as a hash of all its readable attributes.
Constructor Details
#initialize(object, response = nil) ⇒ Payout
Initialize a payout resource instance
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/gocardless_pro/resources/payout.rb', line 25 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 |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
20 21 22 |
# File 'lib/gocardless_pro/resources/payout.rb', line 20 def amount @amount end |
#arrival_date ⇒ Object (readonly)
Returns the value of attribute arrival_date.
20 21 22 |
# File 'lib/gocardless_pro/resources/payout.rb', line 20 def arrival_date @arrival_date end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
20 21 22 |
# File 'lib/gocardless_pro/resources/payout.rb', line 20 def created_at @created_at end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
20 21 22 |
# File 'lib/gocardless_pro/resources/payout.rb', line 20 def currency @currency end |
#deducted_fees ⇒ Object (readonly)
Returns the value of attribute deducted_fees.
20 21 22 |
# File 'lib/gocardless_pro/resources/payout.rb', line 20 def deducted_fees @deducted_fees end |
#fx ⇒ Object (readonly)
Returns the value of attribute fx.
20 21 22 |
# File 'lib/gocardless_pro/resources/payout.rb', line 20 def fx @fx end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
20 21 22 |
# File 'lib/gocardless_pro/resources/payout.rb', line 20 def id @id end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
20 21 22 |
# File 'lib/gocardless_pro/resources/payout.rb', line 20 def @metadata end |
#payout_type ⇒ Object (readonly)
Returns the value of attribute payout_type.
20 21 22 |
# File 'lib/gocardless_pro/resources/payout.rb', line 20 def payout_type @payout_type end |
#reference ⇒ Object (readonly)
Returns the value of attribute reference.
20 21 22 |
# File 'lib/gocardless_pro/resources/payout.rb', line 20 def reference @reference end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
20 21 22 |
# File 'lib/gocardless_pro/resources/payout.rb', line 20 def status @status end |
#tax_currency ⇒ Object (readonly)
Returns the value of attribute tax_currency.
20 21 22 |
# File 'lib/gocardless_pro/resources/payout.rb', line 20 def tax_currency @tax_currency end |
Instance Method Details
#api_response ⇒ Object
44 45 46 |
# File 'lib/gocardless_pro/resources/payout.rb', line 44 def api_response ApiResponse.new(@response) end |
#links ⇒ Object
Return the links that the resource has
49 50 51 |
# File 'lib/gocardless_pro/resources/payout.rb', line 49 def links @payout_links ||= Links.new(@links) end |
#to_h ⇒ Object
Provides the payout resource as a hash of all its readable attributes
54 55 56 |
# File 'lib/gocardless_pro/resources/payout.rb', line 54 def to_h @object end |