|
| 1 | +# File generated from our OpenAPI spec |
| 2 | +# frozen_string_literal: true |
| 3 | + |
| 4 | +module Stripe |
| 5 | + # Options for customizing account balances and payout settings for a Stripe platform's connected accounts. |
| 6 | + class BalanceSettings < SingletonAPIResource |
| 7 | + include Stripe::APIOperations::SingletonSave |
| 8 | + |
| 9 | + OBJECT_NAME = "balance_settings" |
| 10 | + def self.object_name |
| 11 | + "balance_settings" |
| 12 | + end |
| 13 | + |
| 14 | + class Payments < Stripe::StripeObject |
| 15 | + class Payouts < Stripe::StripeObject |
| 16 | + class Schedule < Stripe::StripeObject |
| 17 | + # How frequently funds will be paid out. One of `manual` (payouts only created via API call), `daily`, `weekly`, or `monthly`. |
| 18 | + attr_reader :interval |
| 19 | + # The day of the month funds will be paid out. Only shown if `interval` is monthly. Payouts scheduled between the 29th and 31st of the month are sent on the last day of shorter months. |
| 20 | + attr_reader :monthly_payout_days |
| 21 | + # The days of the week when available funds are paid out, specified as an array, for example, [`monday`, `tuesday`]. Only shown if `interval` is weekly. |
| 22 | + attr_reader :weekly_payout_days |
| 23 | + |
| 24 | + def self.inner_class_types |
| 25 | + @inner_class_types = {} |
| 26 | + end |
| 27 | + |
| 28 | + def self.field_remappings |
| 29 | + @field_remappings = {} |
| 30 | + end |
| 31 | + end |
| 32 | + # The minimum balance amount to retain per currency after automatic payouts. Only funds that exceed these amounts are paid out. Learn more about the [minimum balances for automatic payouts](/payouts/minimum-balances-for-automatic-payouts). |
| 33 | + attr_reader :minimum_balance_by_currency |
| 34 | + # Details on when funds from charges are available, and when they are paid out to an external account. See our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation for details. |
| 35 | + attr_reader :schedule |
| 36 | + # The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard. |
| 37 | + attr_reader :statement_descriptor |
| 38 | + # Whether the funds in this account can be paid out. |
| 39 | + attr_reader :status |
| 40 | + |
| 41 | + def self.inner_class_types |
| 42 | + @inner_class_types = { schedule: Schedule } |
| 43 | + end |
| 44 | + |
| 45 | + def self.field_remappings |
| 46 | + @field_remappings = {} |
| 47 | + end |
| 48 | + end |
| 49 | + |
| 50 | + class SettlementTiming < Stripe::StripeObject |
| 51 | + # The number of days charge funds are held before becoming available. |
| 52 | + attr_reader :delay_days |
| 53 | + # The number of days charge funds are held before becoming available. If present, overrides the default, or minimum available, for the account. |
| 54 | + attr_reader :delay_days_override |
| 55 | + |
| 56 | + def self.inner_class_types |
| 57 | + @inner_class_types = {} |
| 58 | + end |
| 59 | + |
| 60 | + def self.field_remappings |
| 61 | + @field_remappings = {} |
| 62 | + end |
| 63 | + end |
| 64 | + # A Boolean indicating if Stripe should try to reclaim negative balances from an attached bank account. See [Understanding Connect account balances](/connect/account-balances) for details. The default value is `false` when [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts, otherwise `true`. |
| 65 | + attr_reader :debit_negative_balances |
| 66 | + # Settings specific to the account's payouts. |
| 67 | + attr_reader :payouts |
| 68 | + # Attribute for field settlement_timing |
| 69 | + attr_reader :settlement_timing |
| 70 | + |
| 71 | + def self.inner_class_types |
| 72 | + @inner_class_types = { payouts: Payouts, settlement_timing: SettlementTiming } |
| 73 | + end |
| 74 | + |
| 75 | + def self.field_remappings |
| 76 | + @field_remappings = {} |
| 77 | + end |
| 78 | + end |
| 79 | + |
| 80 | + class UpdateParams < Stripe::RequestParams |
| 81 | + class Payments < Stripe::RequestParams |
| 82 | + class Payouts < Stripe::RequestParams |
| 83 | + class Schedule < Stripe::RequestParams |
| 84 | + # How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or `monthly`. Default is `daily`. |
| 85 | + attr_accessor :interval |
| 86 | + # The days of the month when available funds are paid out, specified as an array of numbers between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`. |
| 87 | + attr_accessor :monthly_payout_days |
| 88 | + # The days of the week when available funds are paid out, specified as an array, e.g., [`monday`, `tuesday`]. Required and applicable only if `interval` is `weekly`. |
| 89 | + attr_accessor :weekly_payout_days |
| 90 | + |
| 91 | + def initialize(interval: nil, monthly_payout_days: nil, weekly_payout_days: nil) |
| 92 | + @interval = interval |
| 93 | + @monthly_payout_days = monthly_payout_days |
| 94 | + @weekly_payout_days = weekly_payout_days |
| 95 | + end |
| 96 | + end |
| 97 | + # The minimum balance amount to retain per currency after automatic payouts. Only funds that exceed these amounts are paid out. Learn more about the [minimum balances for automatic payouts](/payouts/minimum-balances-for-automatic-payouts). |
| 98 | + attr_accessor :minimum_balance_by_currency |
| 99 | + # Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](/connect/bank-transfers#payout-information) documentation. |
| 100 | + attr_accessor :schedule |
| 101 | + # The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard. |
| 102 | + attr_accessor :statement_descriptor |
| 103 | + |
| 104 | + def initialize(minimum_balance_by_currency: nil, schedule: nil, statement_descriptor: nil) |
| 105 | + @minimum_balance_by_currency = minimum_balance_by_currency |
| 106 | + @schedule = schedule |
| 107 | + @statement_descriptor = statement_descriptor |
| 108 | + end |
| 109 | + end |
| 110 | + |
| 111 | + class SettlementTiming < Stripe::RequestParams |
| 112 | + # Change `delay_days` for this account, which determines the number of days charge funds are held before becoming available. The maximum value is 31. Passing an empty string to `delay_days_override` will return `delay_days` to the default, which is the lowest available value for the account. [Learn more about controlling delay days](/connect/manage-payout-schedule). |
| 113 | + attr_accessor :delay_days_override |
| 114 | + |
| 115 | + def initialize(delay_days_override: nil) |
| 116 | + @delay_days_override = delay_days_override |
| 117 | + end |
| 118 | + end |
| 119 | + # A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](/connect/account-balances). |
| 120 | + attr_accessor :debit_negative_balances |
| 121 | + # Settings specific to the account's payouts. |
| 122 | + attr_accessor :payouts |
| 123 | + # Settings related to the account's balance settlement timing. |
| 124 | + attr_accessor :settlement_timing |
| 125 | + |
| 126 | + def initialize(debit_negative_balances: nil, payouts: nil, settlement_timing: nil) |
| 127 | + @debit_negative_balances = debit_negative_balances |
| 128 | + @payouts = payouts |
| 129 | + @settlement_timing = settlement_timing |
| 130 | + end |
| 131 | + end |
| 132 | + # Specifies which fields in the response should be expanded. |
| 133 | + attr_accessor :expand |
| 134 | + # Settings that apply to the [Payments Balance](https://docs.stripe.com/api/balance). |
| 135 | + attr_accessor :payments |
| 136 | + |
| 137 | + def initialize(expand: nil, payments: nil) |
| 138 | + @expand = expand |
| 139 | + @payments = payments |
| 140 | + end |
| 141 | + end |
| 142 | + # String representing the object's type. Objects of the same type share the same value. |
| 143 | + attr_reader :object |
| 144 | + # Attribute for field payments |
| 145 | + attr_reader :payments |
| 146 | + |
| 147 | + def self.inner_class_types |
| 148 | + @inner_class_types = { payments: Payments } |
| 149 | + end |
| 150 | + |
| 151 | + def self.field_remappings |
| 152 | + @field_remappings = {} |
| 153 | + end |
| 154 | + end |
| 155 | +end |
0 commit comments