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::Payout::SettingsMutation
Disable automatic payouts by switching to manual payout mode.
-
#disable_fx ⇒ Inttegro::Payout::SettingsMutation
Disable foreign exchange conversion for payouts.
-
#enable_automatic ⇒ Inttegro::Payout::SettingsMutation
(also: #enable)
Re-enable automatic payouts using the application's retained schedule settings.
-
#enable_fx ⇒ Inttegro::Payout::SettingsMutation
Enable foreign exchange conversion for payouts.
-
#initialize(http) ⇒ Payouts
constructor
A new instance of Payouts.
-
#lookup(payout_id:) ⇒ Inttegro::Payout
Retrieve the current state of one payout.
-
#page(payload) ⇒ Inttegro::Payout::Page
Retrieve a paginated list of payouts.
-
#schedule(payload) ⇒ Inttegro::Payout
Schedule a payout from the application's available balance.
-
#search(payload) ⇒ Inttegro::Search::Page
Search payouts using indexed fields and full-text matching.
-
#set_destinations(destinations:) ⇒ Inttegro::Payout::SettingsMutation
Configure which financial account should be used for payouts in each currency.
-
#settings ⇒ Inttegro::Payout::SettingsLookup
Retrieve the current payout settings for your application.
Constructor Details
#initialize(http) ⇒ Payouts
Returns a new instance of Payouts.
15 16 17 |
# File 'lib/inttegro/resources/payouts.rb', line 15 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.
194 195 196 197 198 199 200 |
# File 'lib/inttegro/resources/payouts.rb', line 194 def cancel(payout_id:) @http.post_resource( "/payouts/cancel", Inttegro::Payout, :payout, { payout_id: payout_id } ) end |
#disable_automatic ⇒ Inttegro::Payout::SettingsMutation
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.
76 77 78 79 80 81 82 |
# File 'lib/inttegro/resources/payouts.rb', line 76 def disable_automatic @http.post_resource( "/payouts/disable", Inttegro::Payout::SettingsMutation, :settings, {} ) end |
#disable_fx ⇒ Inttegro::Payout::SettingsMutation
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::Payout::SettingsMutation, :settings, {}) end |
#enable_automatic ⇒ Inttegro::Payout::SettingsMutation Also known as: enable
Re-enable automatic payouts using the application's retained schedule settings.
87 88 89 90 91 92 93 |
# File 'lib/inttegro/resources/payouts.rb', line 87 def enable_automatic @http.post_resource( "/payouts/enable", Inttegro::Payout::SettingsMutation, :settings, {} ) end |
#enable_fx ⇒ Inttegro::Payout::SettingsMutation
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::Payout::SettingsMutation, :settings, {}) end |
#lookup(payout_id:) ⇒ Inttegro::Payout
Retrieve the current state of one payout.
179 180 181 182 183 184 185 |
# File 'lib/inttegro/resources/payouts.rb', line 179 def lookup(payout_id:) @http.post_resource( "/payouts/lookup", Inttegro::Payout, :payout, { payout_id: payout_id } ) end |
#page(payload) ⇒ Inttegro::Payout::Page
Retrieve a paginated list of payouts.
Returns payouts in reverse chronological order (most recent first).
155 156 157 |
# File 'lib/inttegro/resources/payouts.rb', line 155 def page(payload) @http.post_resource("/payouts/page", Inttegro::Payout::Page, :page, payload) end |
#schedule(payload) ⇒ Inttegro::Payout
Schedule a payout from the application's available balance.
171 172 173 |
# File 'lib/inttegro/resources/payouts.rb', line 171 def schedule(payload) @http.post_resource("/payouts/schedule", Inttegro::Payout, :payout, payload) end |
#search(payload) ⇒ Inttegro::Search::Page
Search payouts using indexed fields and full-text matching.
163 164 165 |
# File 'lib/inttegro/resources/payouts.rb', line 163 def search(payload) @http.post_resource("/payouts/search", Inttegro::Search::Page, :search, payload) end |
#set_destinations(destinations:) ⇒ Inttegro::Payout::SettingsMutation
Configure which financial account should be used for payouts in each currency.
Sets the supported GHS payout destination. The financial account must be owned by your application, have push operations enabled, and use Ghana cedi.
36 37 38 39 40 41 42 |
# File 'lib/inttegro/resources/payouts.rb', line 36 def set_destinations(destinations:) @http.post_resource( "/payouts/set_destinations", Inttegro::Payout::SettingsMutation, :settings, { destinations: destinations } ) end |
#settings ⇒ Inttegro::Payout::SettingsLookup
Retrieve the current payout settings for your application.
Returns payout settings including configured payout destinations, schedule information, and whether foreign exchange is enabled.
57 58 59 |
# File 'lib/inttegro/resources/payouts.rb', line 57 def settings @http.post_resource("/payouts/settings", Inttegro::Payout::SettingsLookup, :settings, {}) end |