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 (https://developer.gocardless.com/api-reference/#core-endpoints-creditors). Each payout contains the funds collected from one or many payments (https://developer.gocardless.com/api-reference/#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
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/gocardless_pro/resources/payout.rb', line 36 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.
21 22 23 |
# File 'lib/gocardless_pro/resources/payout.rb', line 21 def amount @amount end |
#arrival_date ⇒ Object (readonly)
Returns the value of attribute arrival_date.
22 23 24 |
# File 'lib/gocardless_pro/resources/payout.rb', line 22 def arrival_date @arrival_date end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
23 24 25 |
# File 'lib/gocardless_pro/resources/payout.rb', line 23 def created_at @created_at end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
24 25 26 |
# File 'lib/gocardless_pro/resources/payout.rb', line 24 def currency @currency end |
#deducted_fees ⇒ Object (readonly)
Returns the value of attribute deducted_fees.
25 26 27 |
# File 'lib/gocardless_pro/resources/payout.rb', line 25 def deducted_fees @deducted_fees end |
#fx ⇒ Object (readonly)
Returns the value of attribute fx.
26 27 28 |
# File 'lib/gocardless_pro/resources/payout.rb', line 26 def fx @fx end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
27 28 29 |
# File 'lib/gocardless_pro/resources/payout.rb', line 27 def id @id end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
28 29 30 |
# File 'lib/gocardless_pro/resources/payout.rb', line 28 def @metadata end |
#payout_type ⇒ Object (readonly)
Returns the value of attribute payout_type.
29 30 31 |
# File 'lib/gocardless_pro/resources/payout.rb', line 29 def payout_type @payout_type end |
#reference ⇒ Object (readonly)
Returns the value of attribute reference.
30 31 32 |
# File 'lib/gocardless_pro/resources/payout.rb', line 30 def reference @reference end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
31 32 33 |
# File 'lib/gocardless_pro/resources/payout.rb', line 31 def status @status end |
#tax_currency ⇒ Object (readonly)
Returns the value of attribute tax_currency.
32 33 34 |
# File 'lib/gocardless_pro/resources/payout.rb', line 32 def tax_currency @tax_currency end |
Instance Method Details
#api_response ⇒ Object
55 56 57 |
# File 'lib/gocardless_pro/resources/payout.rb', line 55 def api_response ApiResponse.new(@response) end |
#links ⇒ Object
Return the links that the resource has
60 61 62 |
# File 'lib/gocardless_pro/resources/payout.rb', line 60 def links @payout_links ||= Links.new(@links) end |
#to_h ⇒ Object
Provides the payout resource as a hash of all its readable attributes
65 66 67 |
# File 'lib/gocardless_pro/resources/payout.rb', line 65 def to_h @object end |