Class: Inttegro::Resources::Payouts
- Inherits:
-
Object
- Object
- Inttegro::Resources::Payouts
- Defined in:
- lib/inttegro/resources/payouts.rb
Overview
Payouts resource for configuring and managing automatic balance payouts.
Payouts transfer available balance from Inttegro to your financial accounts. Use this resource to configure payout destinations, manage payout schedules, enable foreign exchange conversion, and retrieve payout history.
Instance Method Summary collapse
-
#cancel(payout_id:) ⇒ Inttegro::Payout
Cancel a scheduled payout before execution.
-
#disable_automatic ⇒ Inttegro::PayoutSettingsMutation
Disable automatic payouts by switching to manual payout mode.
-
#disable_fx ⇒ Inttegro::PayoutSettingsLookup
Disable foreign exchange conversion for payouts.
- #enable_automatic ⇒ Object (also: #enable)
-
#enable_fx ⇒ Inttegro::PayoutSettingsLookup
Enable foreign exchange conversion for payouts.
-
#initialize(http) ⇒ Payouts
constructor
A new instance of Payouts.
- #lookup(payout_id:) ⇒ Object
-
#page(payload = {}) ⇒ Inttegro::PayoutPage
Retrieve a paginated list of payouts.
- #schedule(payload) ⇒ Object
-
#set_destinations(destinations:) ⇒ Inttegro::PayoutSettingsMutation
Configure which financial account should be used for payouts in each currency.
-
#settings ⇒ Inttegro::PayoutSettingsLookup
Retrieve the current payout settings for your application.
Constructor Details
#initialize(http) ⇒ Payouts
Returns a new instance of Payouts.
14 15 16 |
# File 'lib/inttegro/resources/payouts.rb', line 14 def initialize(http) @http = T.let(http, Inttegro::HTTPClient) end |
Instance Method Details
#cancel(payout_id:) ⇒ Inttegro::Payout
Cancel a scheduled payout before execution.
Only payouts in scheduled status with a future execution time can be canceled.
191 192 193 194 195 196 197 |
# File 'lib/inttegro/resources/payouts.rb', line 191 def cancel(payout_id:) @http.post_resource( "/payouts/cancel", Inttegro::Payout, :payout, { payout_id: payout_id } ) end |
#disable_automatic ⇒ Inttegro::PayoutSettingsMutation
Disable automatic payouts by switching to manual payout mode.
Disables automatic payouts for your application. When automatic payouts are disabled, the system will not automatically schedule payouts—you must manually trigger them. Balance transactions must still be at least 7 days old before they can be paid out, but the payout will only occur when you explicitly request it.
79 80 81 82 83 84 85 |
# File 'lib/inttegro/resources/payouts.rb', line 79 def disable_automatic @http.post_resource( "/payouts/disable", Inttegro::PayoutSettingsMutation, :settings, {} ) end |
#disable_fx ⇒ Inttegro::PayoutSettingsLookup
Disable foreign exchange conversion for payouts.
Disables FX conversion, restricting payouts to accounts that match the transaction currency. After disabling FX, GHS balance can only be paid out to GHS accounts, USD balance only to USD accounts, etc.
134 135 136 |
# File 'lib/inttegro/resources/payouts.rb', line 134 def disable_fx @http.post_resource("/payouts/disable_fx", Inttegro::PayoutSettingsLookup, :settings, {}) end |
#enable_automatic ⇒ Object Also known as: enable
87 88 89 90 91 92 93 |
# File 'lib/inttegro/resources/payouts.rb', line 87 def enable_automatic @http.post_resource( "/payouts/enable", Inttegro::PayoutSettingsMutation, :settings, {} ) end |
#enable_fx ⇒ Inttegro::PayoutSettingsLookup
Enable foreign exchange conversion for payouts.
Enables FX conversion for payouts. When FX is enabled, Inttegro can automatically convert payout funds from one currency to another when routing to destination accounts. This allows you to consolidate multiple currencies into a single operating account or hold funds in a preferred currency.
With FX disabled (default), payouts only transfer funds to accounts matching the transaction currency. With FX enabled, GHS balance can be converted and paid out to USD accounts, for example.
Important: FX conversion incurs additional fees beyond standard payout fees, and exchange rates are determined at payout execution time. FX-enabled payouts require approval and special configuration.
117 118 119 |
# File 'lib/inttegro/resources/payouts.rb', line 117 def enable_fx @http.post_resource("/payouts/enable_fx", Inttegro::PayoutSettingsLookup, :settings, {}) end |
#lookup(payout_id:) ⇒ Object
176 177 178 179 180 181 182 |
# File 'lib/inttegro/resources/payouts.rb', line 176 def lookup(payout_id:) @http.post_resource( "/payouts/lookup", Inttegro::Payout, :payout, { payout_id: payout_id } ) end |
#page(payload = {}) ⇒ Inttegro::PayoutPage
Retrieve a paginated list of payouts.
Returns payouts in reverse chronological order (most recent first). Use the has_more field and page parameter to navigate through results. Supports filtering by status and time range.
168 169 170 |
# File 'lib/inttegro/resources/payouts.rb', line 168 def page(payload = {}) @http.post_resource("/payouts/page", Inttegro::PayoutPage, :page, payload || {}) end |
#schedule(payload) ⇒ Object
172 173 174 |
# File 'lib/inttegro/resources/payouts.rb', line 172 def schedule(payload) @http.post_resource("/payouts/schedule", Inttegro::Payout, :payout, payload) end |
#set_destinations(destinations:) ⇒ Inttegro::PayoutSettingsMutation
Configure which financial account should be used for payouts in each currency.
Sets payout destinations by mapping currency codes to financial account IDs. Each financial account must be owned by your application, have push operations enabled, and its currency must match the currency key in the destinations map.
39 40 41 42 43 44 45 |
# File 'lib/inttegro/resources/payouts.rb', line 39 def set_destinations(destinations:) @http.post_resource( "/payouts/set_destinations", Inttegro::PayoutSettingsMutation, :settings, { destinations: destinations } ) end |
#settings ⇒ Inttegro::PayoutSettingsLookup
Retrieve the current payout settings for your application.
Returns payout settings including configured payout destinations, schedule information, and whether foreign exchange is enabled.
60 61 62 |
# File 'lib/inttegro/resources/payouts.rb', line 60 def settings @http.post_resource("/payouts/settings", Inttegro::PayoutSettingsLookup, :settings, {}) end |