stripe 12.5.0 → 15.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (688) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +197 -9
  3. data/Gemfile +4 -0
  4. data/Makefile +2 -0
  5. data/OPENAPI_VERSION +1 -1
  6. data/README.md +48 -13
  7. data/Rakefile +0 -5
  8. data/VERSION +1 -1
  9. data/examples/README.md +16 -0
  10. data/examples/example_template.rb +36 -0
  11. data/examples/meter_event_stream.rb +57 -0
  12. data/examples/thinevent_webhook_handler.rb +39 -0
  13. data/justfile +43 -0
  14. data/lib/stripe/api_operations/nested_resource.rb +1 -21
  15. data/lib/stripe/api_operations/request.rb +20 -69
  16. data/lib/stripe/api_operations/save.rb +5 -3
  17. data/lib/stripe/api_operations/singleton_save.rb +6 -2
  18. data/lib/stripe/api_requestor.rb +1136 -0
  19. data/lib/stripe/api_resource.rb +38 -17
  20. data/lib/stripe/api_version.rb +1 -1
  21. data/lib/stripe/connection_manager.rb +1 -1
  22. data/lib/stripe/errors.rb +8 -9
  23. data/lib/stripe/event_types.rb +14 -0
  24. data/lib/stripe/events/v1_billing_meter_error_report_triggered_event.rb +23 -0
  25. data/lib/stripe/events/v1_billing_meter_no_meter_found_event.rb +13 -0
  26. data/lib/stripe/list_object.rb +2 -3
  27. data/lib/stripe/oauth.rb +8 -15
  28. data/lib/stripe/object_types.rb +26 -3
  29. data/lib/stripe/request_options.rb +129 -0
  30. data/lib/stripe/request_params.rb +24 -0
  31. data/lib/stripe/resources/account.rb +4642 -8
  32. data/lib/stripe/resources/account_link.rb +54 -0
  33. data/lib/stripe/resources/account_session.rb +739 -0
  34. data/lib/stripe/resources/apple_pay_domain.rb +58 -9
  35. data/lib/stripe/resources/application.rb +20 -0
  36. data/lib/stripe/resources/application_fee.rb +89 -2
  37. data/lib/stripe/resources/application_fee_refund.rb +17 -0
  38. data/lib/stripe/resources/apps/secret.rb +143 -2
  39. data/lib/stripe/resources/balance.rb +122 -0
  40. data/lib/stripe/resources/balance_transaction.rb +105 -2
  41. data/lib/stripe/resources/bank_account.rb +85 -3
  42. data/lib/stripe/resources/billing/alert.rb +137 -2
  43. data/lib/stripe/resources/billing/alert_triggered.rb +26 -0
  44. data/lib/stripe/resources/billing/credit_balance_summary.rb +54 -0
  45. data/lib/stripe/resources/billing/credit_balance_transaction.rb +133 -0
  46. data/lib/stripe/resources/billing/credit_grant.rb +307 -0
  47. data/lib/stripe/resources/billing/meter.rb +180 -9
  48. data/lib/stripe/resources/billing/meter_event.rb +37 -3
  49. data/lib/stripe/resources/billing/meter_event_adjustment.rb +44 -1
  50. data/lib/stripe/resources/billing/meter_event_summary.rb +17 -0
  51. data/lib/stripe/resources/billing_portal/configuration.rb +557 -4
  52. data/lib/stripe/resources/billing_portal/session.rb +271 -0
  53. data/lib/stripe/resources/capability.rb +84 -0
  54. data/lib/stripe/resources/card.rb +78 -1
  55. data/lib/stripe/resources/cash_balance.rb +17 -0
  56. data/lib/stripe/resources/charge.rb +1616 -4
  57. data/lib/stripe/resources/checkout/session.rb +3534 -10
  58. data/lib/stripe/resources/climate/order.rb +171 -4
  59. data/lib/stripe/resources/climate/product.rb +49 -2
  60. data/lib/stripe/resources/climate/supplier.rb +47 -2
  61. data/lib/stripe/resources/confirmation_token.rb +1448 -0
  62. data/lib/stripe/resources/connect_collection_transfer.rb +24 -0
  63. data/lib/stripe/resources/country_spec.rb +56 -2
  64. data/lib/stripe/resources/coupon.rb +195 -6
  65. data/lib/stripe/resources/credit_note.rb +641 -2
  66. data/lib/stripe/resources/credit_note_line_item.rb +67 -0
  67. data/lib/stripe/resources/customer.rb +832 -9
  68. data/lib/stripe/resources/customer_balance_transaction.rb +29 -0
  69. data/lib/stripe/resources/customer_cash_balance_transaction.rb +109 -0
  70. data/lib/stripe/resources/customer_session.rb +163 -0
  71. data/lib/stripe/resources/discount.rb +29 -0
  72. data/lib/stripe/resources/dispute.rb +614 -4
  73. data/lib/stripe/resources/entitlements/active_entitlement.rb +39 -2
  74. data/lib/stripe/resources/entitlements/active_entitlement_summary.rb +23 -0
  75. data/lib/stripe/resources/entitlements/feature.rb +83 -2
  76. data/lib/stripe/resources/ephemeral_key.rb +23 -2
  77. data/lib/stripe/resources/event.rb +92 -2
  78. data/lib/stripe/resources/exchange_rate.rb +26 -2
  79. data/lib/stripe/resources/file.rb +123 -15
  80. data/lib/stripe/resources/file_link.rb +107 -4
  81. data/lib/stripe/resources/financial_connections/account.rb +239 -2
  82. data/lib/stripe/resources/financial_connections/account_owner.rb +17 -0
  83. data/lib/stripe/resources/financial_connections/account_ownership.rb +9 -0
  84. data/lib/stripe/resources/financial_connections/session.rb +95 -0
  85. data/lib/stripe/resources/financial_connections/transaction.rb +94 -2
  86. data/lib/stripe/resources/forwarding/request.rb +158 -2
  87. data/lib/stripe/resources/funding_instructions.rb +308 -0
  88. data/lib/stripe/resources/identity/verification_report.rb +259 -2
  89. data/lib/stripe/resources/identity/verification_session.rb +356 -4
  90. data/lib/stripe/resources/invoice.rb +3210 -27
  91. data/lib/stripe/resources/invoice_item.rb +406 -6
  92. data/lib/stripe/resources/invoice_line_item.rb +356 -3
  93. data/lib/stripe/resources/invoice_payment.rb +105 -0
  94. data/lib/stripe/resources/invoice_rendering_template.rb +120 -0
  95. data/lib/stripe/resources/issuing/authorization.rb +1132 -6
  96. data/lib/stripe/resources/issuing/card.rb +682 -5
  97. data/lib/stripe/resources/issuing/cardholder.rb +653 -5
  98. data/lib/stripe/resources/issuing/dispute.rb +785 -4
  99. data/lib/stripe/resources/issuing/personalization_design.rb +280 -4
  100. data/lib/stripe/resources/issuing/physical_bundle.rb +56 -2
  101. data/lib/stripe/resources/issuing/token.rb +170 -4
  102. data/lib/stripe/resources/issuing/transaction.rb +916 -4
  103. data/lib/stripe/resources/line_item.rb +47 -0
  104. data/lib/stripe/resources/login_link.rb +7 -0
  105. data/lib/stripe/resources/mandate.rb +142 -0
  106. data/lib/stripe/resources/payment_intent.rb +8660 -4
  107. data/lib/stripe/resources/payment_link.rb +1636 -4
  108. data/lib/stripe/resources/payment_method.rb +1546 -4
  109. data/lib/stripe/resources/payment_method_configuration.rb +2780 -4
  110. data/lib/stripe/resources/payment_method_domain.rb +154 -10
  111. data/lib/stripe/resources/payout.rb +213 -4
  112. data/lib/stripe/resources/person.rb +264 -1
  113. data/lib/stripe/resources/plan.rb +308 -6
  114. data/lib/stripe/resources/price.rb +609 -5
  115. data/lib/stripe/resources/product.rb +474 -2
  116. data/lib/stripe/resources/product_feature.rb +12 -0
  117. data/lib/stripe/resources/promotion_code.rb +216 -4
  118. data/lib/stripe/resources/quote.rb +927 -10
  119. data/lib/stripe/resources/radar/early_fraud_warning.rb +70 -2
  120. data/lib/stripe/resources/radar/value_list.rb +122 -6
  121. data/lib/stripe/resources/radar/value_list_item.rb +90 -4
  122. data/lib/stripe/resources/refund.rb +396 -4
  123. data/lib/stripe/resources/reporting/report_run.rb +143 -2
  124. data/lib/stripe/resources/reporting/report_type.rb +29 -2
  125. data/lib/stripe/resources/reserve_transaction.rb +22 -0
  126. data/lib/stripe/resources/reversal.rb +21 -0
  127. data/lib/stripe/resources/review.rb +101 -2
  128. data/lib/stripe/resources/setup_attempt.rb +370 -2
  129. data/lib/stripe/resources/setup_intent.rb +3477 -4
  130. data/lib/stripe/resources/shipping_rate.rb +254 -4
  131. data/lib/stripe/resources/sigma/scheduled_query_run.rb +47 -2
  132. data/lib/stripe/resources/source.rb +1203 -4
  133. data/lib/stripe/resources/source_mandate_notification.rb +66 -0
  134. data/lib/stripe/resources/source_transaction.rb +85 -0
  135. data/lib/stripe/resources/subscription.rb +1697 -11
  136. data/lib/stripe/resources/subscription_item.rb +319 -11
  137. data/lib/stripe/resources/subscription_schedule.rb +1285 -4
  138. data/lib/stripe/resources/tax/calculation.rb +378 -0
  139. data/lib/stripe/resources/tax/calculation_line_item.rb +56 -0
  140. data/lib/stripe/resources/tax/registration.rb +2375 -2
  141. data/lib/stripe/resources/tax/settings.rb +117 -0
  142. data/lib/stripe/resources/tax/transaction.rb +258 -0
  143. data/lib/stripe/resources/tax/transaction_line_item.rb +31 -0
  144. data/lib/stripe/resources/tax_code.rb +28 -2
  145. data/lib/stripe/resources/tax_deducted_at_source.rb +22 -0
  146. data/lib/stripe/resources/tax_id.rb +114 -2
  147. data/lib/stripe/resources/tax_rate.rb +197 -6
  148. data/lib/stripe/resources/terminal/configuration.rb +1266 -6
  149. data/lib/stripe/resources/terminal/connection_token.rb +18 -0
  150. data/lib/stripe/resources/terminal/location.rb +172 -6
  151. data/lib/stripe/resources/terminal/reader.rb +433 -6
  152. data/lib/stripe/resources/test_helpers/test_clock.rb +81 -4
  153. data/lib/stripe/resources/token.rb +1160 -1
  154. data/lib/stripe/resources/topup.rb +169 -4
  155. data/lib/stripe/resources/transfer.rb +148 -4
  156. data/lib/stripe/resources/treasury/credit_reversal.rb +85 -2
  157. data/lib/stripe/resources/treasury/debit_reversal.rb +96 -2
  158. data/lib/stripe/resources/treasury/financial_account.rb +749 -5
  159. data/lib/stripe/resources/treasury/financial_account_features.rb +189 -0
  160. data/lib/stripe/resources/treasury/inbound_transfer.rb +231 -3
  161. data/lib/stripe/resources/treasury/outbound_payment.rb +491 -3
  162. data/lib/stripe/resources/treasury/outbound_transfer.rb +346 -3
  163. data/lib/stripe/resources/treasury/received_credit.rb +239 -2
  164. data/lib/stripe/resources/treasury/received_debit.rb +198 -2
  165. data/lib/stripe/resources/treasury/transaction.rb +169 -2
  166. data/lib/stripe/resources/treasury/transaction_entry.rb +150 -2
  167. data/lib/stripe/resources/v2/amount.rb +9 -0
  168. data/lib/stripe/resources/v2/billing/meter_event.rb +34 -0
  169. data/lib/stripe/resources/v2/billing/meter_event_adjustment.rb +36 -0
  170. data/lib/stripe/resources/v2/billing/meter_event_session.rb +29 -0
  171. data/lib/stripe/resources/v2/event.rb +41 -0
  172. data/lib/stripe/resources/v2/event_destination.rb +73 -0
  173. data/lib/stripe/resources/webhook_endpoint.rb +119 -11
  174. data/lib/stripe/resources.rb +19 -2
  175. data/lib/stripe/search_result_object.rb +1 -1
  176. data/lib/stripe/services/account_capability_service.rb +71 -0
  177. data/lib/stripe/services/account_external_account_service.rb +318 -0
  178. data/lib/stripe/services/account_link_service.rb +63 -0
  179. data/lib/stripe/services/account_login_link_service.rb +28 -0
  180. data/lib/stripe/services/account_person_service.rb +936 -0
  181. data/lib/stripe/services/account_service.rb +4100 -0
  182. data/lib/stripe/services/account_session_service.rb +501 -0
  183. data/lib/stripe/services/apple_pay_domain_service.rb +101 -0
  184. data/lib/stripe/services/application_fee_refund_service.rb +114 -0
  185. data/lib/stripe/services/application_fee_service.rb +92 -0
  186. data/lib/stripe/services/apps/secret_service.rb +168 -0
  187. data/lib/stripe/services/apps_service.rb +13 -0
  188. data/lib/stripe/services/balance_service.rb +21 -0
  189. data/lib/stripe/services/balance_transaction_service.rb +101 -0
  190. data/lib/stripe/services/billing/alert_service.rb +187 -0
  191. data/lib/stripe/services/billing/credit_balance_summary_service.rb +67 -0
  192. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +70 -0
  193. data/lib/stripe/services/billing/credit_grant_service.rb +240 -0
  194. data/lib/stripe/services/billing/meter_event_adjustment_service.rb +45 -0
  195. data/lib/stripe/services/billing/meter_event_service.rb +40 -0
  196. data/lib/stripe/services/billing/meter_event_summary_service.rb +58 -0
  197. data/lib/stripe/services/billing/meter_service.rb +211 -0
  198. data/lib/stripe/services/billing_portal/configuration_service.rb +496 -0
  199. data/lib/stripe/services/billing_portal/session_service.rb +192 -0
  200. data/lib/stripe/services/billing_portal_service.rb +14 -0
  201. data/lib/stripe/services/billing_service.rb +20 -0
  202. data/lib/stripe/services/charge_service.rb +471 -0
  203. data/lib/stripe/services/checkout/session_line_item_service.rb +37 -0
  204. data/lib/stripe/services/checkout/session_service.rb +2466 -0
  205. data/lib/stripe/services/checkout_service.rb +13 -0
  206. data/lib/stripe/services/climate/order_service.rb +170 -0
  207. data/lib/stripe/services/climate/product_service.rb +57 -0
  208. data/lib/stripe/services/climate/supplier_service.rb +57 -0
  209. data/lib/stripe/services/climate_service.rb +15 -0
  210. data/lib/stripe/services/confirmation_token_service.rb +26 -0
  211. data/lib/stripe/services/country_spec_service.rb +55 -0
  212. data/lib/stripe/services/coupon_service.rb +203 -0
  213. data/lib/stripe/services/credit_note_line_item_service.rb +35 -0
  214. data/lib/stripe/services/credit_note_preview_lines_service.rb +169 -0
  215. data/lib/stripe/services/credit_note_service.rb +458 -0
  216. data/lib/stripe/services/customer_balance_transaction_service.rb +113 -0
  217. data/lib/stripe/services/customer_cash_balance_service.rb +57 -0
  218. data/lib/stripe/services/customer_cash_balance_transaction_service.rb +55 -0
  219. data/lib/stripe/services/customer_funding_instructions_service.rb +61 -0
  220. data/lib/stripe/services/customer_payment_method_service.rb +68 -0
  221. data/lib/stripe/services/customer_payment_source_service.rb +255 -0
  222. data/lib/stripe/services/customer_service.rb +666 -0
  223. data/lib/stripe/services/customer_session_service.rb +113 -0
  224. data/lib/stripe/services/customer_tax_id_service.rb +95 -0
  225. data/lib/stripe/services/dispute_service.rb +422 -0
  226. data/lib/stripe/services/entitlements/active_entitlement_service.rb +66 -0
  227. data/lib/stripe/services/entitlements/feature_service.rb +128 -0
  228. data/lib/stripe/services/entitlements_service.rb +14 -0
  229. data/lib/stripe/services/ephemeral_key_service.rb +64 -0
  230. data/lib/stripe/services/event_service.rb +87 -0
  231. data/lib/stripe/services/exchange_rate_service.rb +55 -0
  232. data/lib/stripe/services/file_link_service.rb +132 -0
  233. data/lib/stripe/services/file_service.rb +124 -0
  234. data/lib/stripe/services/financial_connections/account_owner_service.rb +46 -0
  235. data/lib/stripe/services/financial_connections/account_service.rb +177 -0
  236. data/lib/stripe/services/financial_connections/session_service.rb +98 -0
  237. data/lib/stripe/services/financial_connections/transaction_service.rb +100 -0
  238. data/lib/stripe/services/financial_connections_service.rb +15 -0
  239. data/lib/stripe/services/forwarding/request_service.rb +147 -0
  240. data/lib/stripe/services/forwarding_service.rb +13 -0
  241. data/lib/stripe/services/identity/verification_report_service.rb +95 -0
  242. data/lib/stripe/services/identity/verification_session_service.rb +337 -0
  243. data/lib/stripe/services/identity_service.rb +14 -0
  244. data/lib/stripe/services/invoice_item_service.rb +395 -0
  245. data/lib/stripe/services/invoice_line_item_service.rb +252 -0
  246. data/lib/stripe/services/invoice_payment_service.rb +83 -0
  247. data/lib/stripe/services/invoice_rendering_template_service.rb +101 -0
  248. data/lib/stripe/services/invoice_service.rb +2831 -0
  249. data/lib/stripe/services/issuing/authorization_service.rb +169 -0
  250. data/lib/stripe/services/issuing/card_service.rb +507 -0
  251. data/lib/stripe/services/issuing/cardholder_service.rb +577 -0
  252. data/lib/stripe/services/issuing/dispute_service.rb +696 -0
  253. data/lib/stripe/services/issuing/personalization_design_service.rb +245 -0
  254. data/lib/stripe/services/issuing/physical_bundle_service.rb +70 -0
  255. data/lib/stripe/services/issuing/token_service.rb +114 -0
  256. data/lib/stripe/services/issuing/transaction_service.rb +118 -0
  257. data/lib/stripe/services/issuing_service.rb +20 -0
  258. data/lib/stripe/services/mandate_service.rb +26 -0
  259. data/lib/stripe/services/oauth_service.rb +63 -0
  260. data/lib/stripe/services/payment_intent_service.rb +7258 -0
  261. data/lib/stripe/services/payment_link_line_item_service.rb +35 -0
  262. data/lib/stripe/services/payment_link_service.rb +1333 -0
  263. data/lib/stripe/services/payment_method_configuration_service.rb +2054 -0
  264. data/lib/stripe/services/payment_method_domain_service.rb +142 -0
  265. data/lib/stripe/services/payment_method_service.rb +894 -0
  266. data/lib/stripe/services/payout_service.rb +225 -0
  267. data/lib/stripe/services/plan_service.rb +298 -0
  268. data/lib/stripe/services/price_service.rb +545 -0
  269. data/lib/stripe/services/product_feature_service.rb +92 -0
  270. data/lib/stripe/services/product_service.rb +495 -0
  271. data/lib/stripe/services/promotion_code_service.rb +228 -0
  272. data/lib/stripe/services/quote_computed_upfront_line_items_service.rb +35 -0
  273. data/lib/stripe/services/quote_line_item_service.rb +35 -0
  274. data/lib/stripe/services/quote_service.rb +703 -0
  275. data/lib/stripe/services/radar/early_fraud_warning_service.rb +93 -0
  276. data/lib/stripe/services/radar/value_list_item_service.rb +131 -0
  277. data/lib/stripe/services/radar/value_list_service.rb +166 -0
  278. data/lib/stripe/services/radar_service.rb +15 -0
  279. data/lib/stripe/services/refund_service.rb +200 -0
  280. data/lib/stripe/services/reporting/report_run_service.rb +147 -0
  281. data/lib/stripe/services/reporting/report_type_service.rb +48 -0
  282. data/lib/stripe/services/reporting_service.rb +14 -0
  283. data/lib/stripe/services/review_service.rb +89 -0
  284. data/lib/stripe/services/setup_attempt_service.rb +68 -0
  285. data/lib/stripe/services/setup_intent_service.rb +3268 -0
  286. data/lib/stripe/services/shipping_rate_service.rb +250 -0
  287. data/lib/stripe/services/sigma/scheduled_query_run_service.rb +57 -0
  288. data/lib/stripe/services/sigma_service.rb +13 -0
  289. data/lib/stripe/services/source_service.rb +665 -0
  290. data/lib/stripe/services/source_transaction_service.rb +35 -0
  291. data/lib/stripe/services/subscription_item_service.rb +346 -0
  292. data/lib/stripe/services/subscription_schedule_service.rb +1134 -0
  293. data/lib/stripe/services/subscription_service.rb +1539 -0
  294. data/lib/stripe/services/tax/calculation_line_item_service.rb +37 -0
  295. data/lib/stripe/services/tax/calculation_service.rb +242 -0
  296. data/lib/stripe/services/tax/registration_service.rb +1618 -0
  297. data/lib/stripe/services/tax/settings_service.rb +104 -0
  298. data/lib/stripe/services/tax/transaction_line_item_service.rb +37 -0
  299. data/lib/stripe/services/tax/transaction_service.rb +159 -0
  300. data/lib/stripe/services/tax_code_service.rb +49 -0
  301. data/lib/stripe/services/tax_id_service.rb +117 -0
  302. data/lib/stripe/services/tax_rate_service.rb +193 -0
  303. data/lib/stripe/services/tax_service.rb +16 -0
  304. data/lib/stripe/services/terminal/configuration_service.rb +1060 -0
  305. data/lib/stripe/services/terminal/connection_token_service.rb +31 -0
  306. data/lib/stripe/services/terminal/location_service.rb +208 -0
  307. data/lib/stripe/services/terminal/reader_service.rb +384 -0
  308. data/lib/stripe/services/terminal_service.rb +16 -0
  309. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +661 -0
  310. data/lib/stripe/services/test_helpers/customer_service.rb +37 -0
  311. data/lib/stripe/services/test_helpers/issuing/authorization_service.rb +832 -0
  312. data/lib/stripe/services/test_helpers/issuing/card_service.rb +110 -0
  313. data/lib/stripe/services/test_helpers/issuing/personalization_design_service.rb +84 -0
  314. data/lib/stripe/services/test_helpers/issuing/transaction_service.rb +675 -0
  315. data/lib/stripe/services/test_helpers/issuing_service.rb +19 -0
  316. data/lib/stripe/services/test_helpers/refund_service.rb +28 -0
  317. data/lib/stripe/services/test_helpers/terminal/reader_service.rb +65 -0
  318. data/lib/stripe/services/test_helpers/terminal_service.rb +15 -0
  319. data/lib/stripe/services/test_helpers/test_clock_service.rb +120 -0
  320. data/lib/stripe/services/test_helpers/treasury/inbound_transfer_service.rb +81 -0
  321. data/lib/stripe/services/test_helpers/treasury/outbound_payment_service.rb +141 -0
  322. data/lib/stripe/services/test_helpers/treasury/outbound_transfer_service.rb +141 -0
  323. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +81 -0
  324. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +81 -0
  325. data/lib/stripe/services/test_helpers/treasury_service.rb +19 -0
  326. data/lib/stripe/services/test_helpers_service.rb +19 -0
  327. data/lib/stripe/services/token_service.rb +1163 -0
  328. data/lib/stripe/services/topup_service.rb +191 -0
  329. data/lib/stripe/services/transfer_reversal_service.rb +122 -0
  330. data/lib/stripe/services/transfer_service.rb +166 -0
  331. data/lib/stripe/services/treasury/credit_reversal_service.rb +100 -0
  332. data/lib/stripe/services/treasury/debit_reversal_service.rb +104 -0
  333. data/lib/stripe/services/treasury/financial_account_features_service.rb +196 -0
  334. data/lib/stripe/services/treasury/financial_account_service.rb +554 -0
  335. data/lib/stripe/services/treasury/inbound_transfer_service.rb +140 -0
  336. data/lib/stripe/services/treasury/outbound_payment_service.rb +310 -0
  337. data/lib/stripe/services/treasury/outbound_transfer_service.rb +176 -0
  338. data/lib/stripe/services/treasury/received_credit_service.rb +82 -0
  339. data/lib/stripe/services/treasury/received_debit_service.rb +70 -0
  340. data/lib/stripe/services/treasury/transaction_entry_service.rb +117 -0
  341. data/lib/stripe/services/treasury/transaction_service.rb +125 -0
  342. data/lib/stripe/services/treasury_service.rb +22 -0
  343. data/lib/stripe/services/v1_services.rb +90 -0
  344. data/lib/stripe/services/v2/billing/meter_event_adjustment_service.rb +44 -0
  345. data/lib/stripe/services/v2/billing/meter_event_service.rb +46 -0
  346. data/lib/stripe/services/v2/billing/meter_event_session_service.rb +24 -0
  347. data/lib/stripe/services/v2/billing/meter_event_stream_service.rb +56 -0
  348. data/lib/stripe/services/v2/billing_service.rb +18 -0
  349. data/lib/stripe/services/v2/core/event_destination_service.rb +241 -0
  350. data/lib/stripe/services/v2/core/event_service.rb +49 -0
  351. data/lib/stripe/services/v2/core_service.rb +16 -0
  352. data/lib/stripe/services/v2_services.rb +14 -0
  353. data/lib/stripe/services/webhook_endpoint_service.rb +157 -0
  354. data/lib/stripe/services.rb +180 -0
  355. data/lib/stripe/singleton_api_resource.rb +1 -18
  356. data/lib/stripe/stripe_client.rb +53 -1031
  357. data/lib/stripe/stripe_configuration.rb +52 -19
  358. data/lib/stripe/stripe_object.rb +54 -20
  359. data/lib/stripe/stripe_service.rb +32 -0
  360. data/lib/stripe/thin_event.rb +37 -0
  361. data/lib/stripe/util.rb +78 -37
  362. data/lib/stripe/v2_list_object.rb +84 -0
  363. data/lib/stripe/version.rb +1 -1
  364. data/lib/stripe/webhook.rb +1 -1
  365. data/lib/stripe.rb +38 -25
  366. data/rbi/stripe/resources/account.rbi +4840 -0
  367. data/rbi/stripe/resources/account_link.rbi +74 -0
  368. data/rbi/stripe/resources/account_session.rbi +894 -0
  369. data/rbi/stripe/resources/apple_pay_domain.rbi +90 -0
  370. data/rbi/stripe/resources/application.rbi +20 -0
  371. data/rbi/stripe/resources/application_fee.rbi +118 -0
  372. data/rbi/stripe/resources/application_fee_refund.rbi +37 -0
  373. data/rbi/stripe/resources/apps/secret.rbi +195 -0
  374. data/rbi/stripe/resources/balance.rbi +180 -0
  375. data/rbi/stripe/resources/balance_transaction.rbi +144 -0
  376. data/rbi/stripe/resources/bank_account.rbi +127 -0
  377. data/rbi/stripe/resources/billing/alert.rbi +201 -0
  378. data/rbi/stripe/resources/billing/alert_triggered.rbi +28 -0
  379. data/rbi/stripe/resources/billing/credit_balance_summary.rbi +63 -0
  380. data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +147 -0
  381. data/rbi/stripe/resources/billing/credit_grant.rbi +291 -0
  382. data/rbi/stripe/resources/billing/meter.rbi +226 -0
  383. data/rbi/stripe/resources/billing/meter_event.rbi +64 -0
  384. data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +64 -0
  385. data/rbi/stripe/resources/billing/meter_event_summary.rbi +35 -0
  386. data/rbi/stripe/resources/billing_portal/configuration.rbi +645 -0
  387. data/rbi/stripe/resources/billing_portal/session.rbi +345 -0
  388. data/rbi/stripe/resources/capability.rbi +125 -0
  389. data/rbi/stripe/resources/card.rbi +125 -0
  390. data/rbi/stripe/resources/cash_balance.rbi +32 -0
  391. data/rbi/stripe/resources/charge.rbi +2054 -0
  392. data/rbi/stripe/resources/checkout/session.rbi +3951 -0
  393. data/rbi/stripe/resources/climate/order.rbi +245 -0
  394. data/rbi/stripe/resources/climate/product.rbi +75 -0
  395. data/rbi/stripe/resources/climate/supplier.rbi +72 -0
  396. data/rbi/stripe/resources/confirmation_token.rbi +1793 -0
  397. data/rbi/stripe/resources/connect_collection_transfer.rbi +26 -0
  398. data/rbi/stripe/resources/country_spec.rbi +85 -0
  399. data/rbi/stripe/resources/coupon.rbi +252 -0
  400. data/rbi/stripe/resources/credit_note.rbi +747 -0
  401. data/rbi/stripe/resources/credit_note_line_item.rbi +101 -0
  402. data/rbi/stripe/resources/customer.rbi +1009 -0
  403. data/rbi/stripe/resources/customer_balance_transaction.rbi +56 -0
  404. data/rbi/stripe/resources/customer_cash_balance_transaction.rbi +151 -0
  405. data/rbi/stripe/resources/customer_session.rbi +200 -0
  406. data/rbi/stripe/resources/discount.rbi +53 -0
  407. data/rbi/stripe/resources/dispute.rbi +761 -0
  408. data/rbi/stripe/resources/entitlements/active_entitlement.rbi +58 -0
  409. data/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi +23 -0
  410. data/rbi/stripe/resources/entitlements/feature.rbi +117 -0
  411. data/rbi/stripe/resources/ephemeral_key.rbi +44 -0
  412. data/rbi/stripe/resources/event.rbi +146 -0
  413. data/rbi/stripe/resources/exchange_rate.rbi +66 -0
  414. data/rbi/stripe/resources/file.rbi +143 -0
  415. data/rbi/stripe/resources/file_link.rbi +141 -0
  416. data/rbi/stripe/resources/financial_connections/account.rbi +339 -0
  417. data/rbi/stripe/resources/financial_connections/account_owner.rbi +35 -0
  418. data/rbi/stripe/resources/financial_connections/account_ownership.rbi +23 -0
  419. data/rbi/stripe/resources/financial_connections/session.rbi +123 -0
  420. data/rbi/stripe/resources/financial_connections/transaction.rbi +124 -0
  421. data/rbi/stripe/resources/forwarding/request.rbi +216 -0
  422. data/rbi/stripe/resources/funding_instructions.rbi +437 -0
  423. data/rbi/stripe/resources/identity/verification_report.rbi +351 -0
  424. data/rbi/stripe/resources/identity/verification_session.rbi +517 -0
  425. data/rbi/stripe/resources/invoice.rbi +3733 -0
  426. data/rbi/stripe/resources/invoice_item.rbi +475 -0
  427. data/rbi/stripe/resources/invoice_line_item.rbi +432 -0
  428. data/rbi/stripe/resources/invoice_payment.rbi +114 -0
  429. data/rbi/stripe/resources/invoice_rendering_template.rbi +104 -0
  430. data/rbi/stripe/resources/issuing/authorization.rbi +1283 -0
  431. data/rbi/stripe/resources/issuing/card.rbi +741 -0
  432. data/rbi/stripe/resources/issuing/cardholder.rbi +744 -0
  433. data/rbi/stripe/resources/issuing/dispute.rbi +913 -0
  434. data/rbi/stripe/resources/issuing/personalization_design.rbi +338 -0
  435. data/rbi/stripe/resources/issuing/physical_bundle.rbi +79 -0
  436. data/rbi/stripe/resources/issuing/token.rbi +226 -0
  437. data/rbi/stripe/resources/issuing/transaction.rbi +1061 -0
  438. data/rbi/stripe/resources/line_item.rbi +72 -0
  439. data/rbi/stripe/resources/login_link.rbi +18 -0
  440. data/rbi/stripe/resources/mandate.rbi +187 -0
  441. data/rbi/stripe/resources/payment_intent.rbi +9731 -0
  442. data/rbi/stripe/resources/payment_link.rbi +1801 -0
  443. data/rbi/stripe/resources/payment_method.rbi +1822 -0
  444. data/rbi/stripe/resources/payment_method_configuration.rbi +3154 -0
  445. data/rbi/stripe/resources/payment_method_domain.rbi +212 -0
  446. data/rbi/stripe/resources/payout.rbi +300 -0
  447. data/rbi/stripe/resources/person.rbi +371 -0
  448. data/rbi/stripe/resources/plan.rbi +373 -0
  449. data/rbi/stripe/resources/price.rbi +694 -0
  450. data/rbi/stripe/resources/product.rbi +557 -0
  451. data/rbi/stripe/resources/product_feature.rbi +26 -0
  452. data/rbi/stripe/resources/promotion_code.rbi +261 -0
  453. data/rbi/stripe/resources/quote.rbi +1123 -0
  454. data/rbi/stripe/resources/radar/early_fraud_warning.rbi +98 -0
  455. data/rbi/stripe/resources/radar/value_list.rbi +170 -0
  456. data/rbi/stripe/resources/radar/value_list_item.rbi +131 -0
  457. data/rbi/stripe/resources/refund.rbi +516 -0
  458. data/rbi/stripe/resources/reporting/report_run.rbi +191 -0
  459. data/rbi/stripe/resources/reporting/report_type.rbi +57 -0
  460. data/rbi/stripe/resources/reserve_transaction.rbi +23 -0
  461. data/rbi/stripe/resources/reversal.rbi +51 -0
  462. data/rbi/stripe/resources/review.rbi +154 -0
  463. data/rbi/stripe/resources/setup_attempt.rbi +477 -0
  464. data/rbi/stripe/resources/setup_intent.rbi +3860 -0
  465. data/rbi/stripe/resources/shipping_rate.rbi +305 -0
  466. data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +75 -0
  467. data/rbi/stripe/resources/source.rbi +1496 -0
  468. data/rbi/stripe/resources/source_mandate_notification.rbi +77 -0
  469. data/rbi/stripe/resources/source_transaction.rbi +127 -0
  470. data/rbi/stripe/resources/subscription.rbi +1964 -0
  471. data/rbi/stripe/resources/subscription_item.rbi +370 -0
  472. data/rbi/stripe/resources/subscription_schedule.rbi +1495 -0
  473. data/rbi/stripe/resources/tax/calculation.rbi +474 -0
  474. data/rbi/stripe/resources/tax/calculation_line_item.rbi +88 -0
  475. data/rbi/stripe/resources/tax/registration.rbi +2485 -0
  476. data/rbi/stripe/resources/tax/settings.rbi +141 -0
  477. data/rbi/stripe/resources/tax/transaction.rbi +351 -0
  478. data/rbi/stripe/resources/tax/transaction_line_item.rbi +54 -0
  479. data/rbi/stripe/resources/tax_code.rbi +44 -0
  480. data/rbi/stripe/resources/tax_deducted_at_source.rbi +23 -0
  481. data/rbi/stripe/resources/tax_id.rbi +167 -0
  482. data/rbi/stripe/resources/tax_rate.rbi +239 -0
  483. data/rbi/stripe/resources/terminal/configuration.rbi +1388 -0
  484. data/rbi/stripe/resources/terminal/connection_token.rbi +37 -0
  485. data/rbi/stripe/resources/terminal/location.rbi +224 -0
  486. data/rbi/stripe/resources/terminal/reader.rbi +587 -0
  487. data/rbi/stripe/resources/test_helpers/test_clock.rbi +134 -0
  488. data/rbi/stripe/resources/token.rbi +1217 -0
  489. data/rbi/stripe/resources/topup.rbi +222 -0
  490. data/rbi/stripe/resources/transfer.rbi +199 -0
  491. data/rbi/stripe/resources/treasury/credit_reversal.rbi +119 -0
  492. data/rbi/stripe/resources/treasury/debit_reversal.rbi +131 -0
  493. data/rbi/stripe/resources/treasury/financial_account.rbi +865 -0
  494. data/rbi/stripe/resources/treasury/financial_account_features.rbi +260 -0
  495. data/rbi/stripe/resources/treasury/inbound_transfer.rbi +295 -0
  496. data/rbi/stripe/resources/treasury/outbound_payment.rbi +592 -0
  497. data/rbi/stripe/resources/treasury/outbound_transfer.rbi +431 -0
  498. data/rbi/stripe/resources/treasury/received_credit.rbi +302 -0
  499. data/rbi/stripe/resources/treasury/received_debit.rbi +256 -0
  500. data/rbi/stripe/resources/treasury/transaction.rbi +215 -0
  501. data/rbi/stripe/resources/treasury/transaction_entry.rbi +192 -0
  502. data/rbi/stripe/resources/v2/amount.rbi +14 -0
  503. data/rbi/stripe/resources/v2/billing/meter_event.rbi +37 -0
  504. data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +41 -0
  505. data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +31 -0
  506. data/rbi/stripe/resources/v2/event.rbi +48 -0
  507. data/rbi/stripe/resources/v2/event_destination.rbi +91 -0
  508. data/rbi/stripe/resources/webhook_endpoint.rbi +170 -0
  509. data/rbi/stripe/services/account_capability_service.rbi +51 -0
  510. data/rbi/stripe/services/account_external_account_service.rbi +306 -0
  511. data/rbi/stripe/services/account_link_service.rbi +58 -0
  512. data/rbi/stripe/services/account_login_link_service.rbi +22 -0
  513. data/rbi/stripe/services/account_person_service.rbi +923 -0
  514. data/rbi/stripe/services/account_service.rbi +4143 -0
  515. data/rbi/stripe/services/account_session_service.rbi +572 -0
  516. data/rbi/stripe/services/apple_pay_domain_service.rbi +78 -0
  517. data/rbi/stripe/services/application_fee_refund_service.rbi +93 -0
  518. data/rbi/stripe/services/application_fee_service.rbi +78 -0
  519. data/rbi/stripe/services/apps/secret_service.rbi +151 -0
  520. data/rbi/stripe/services/apps_service.rbi +9 -0
  521. data/rbi/stripe/services/balance_service.rbi +21 -0
  522. data/rbi/stripe/services/balance_transaction_service.rbi +93 -0
  523. data/rbi/stripe/services/billing/alert_service.rbi +152 -0
  524. data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +68 -0
  525. data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +59 -0
  526. data/rbi/stripe/services/billing/credit_grant_service.rbi +211 -0
  527. data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +42 -0
  528. data/rbi/stripe/services/billing/meter_event_service.rbi +42 -0
  529. data/rbi/stripe/services/billing/meter_event_summary_service.rbi +54 -0
  530. data/rbi/stripe/services/billing/meter_service.rbi +163 -0
  531. data/rbi/stripe/services/billing_portal/configuration_service.rbi +511 -0
  532. data/rbi/stripe/services/billing_portal/session_service.rbi +204 -0
  533. data/rbi/stripe/services/billing_portal_service.rbi +10 -0
  534. data/rbi/stripe/services/billing_service.rbi +15 -0
  535. data/rbi/stripe/services/charge_service.rbi +448 -0
  536. data/rbi/stripe/services/checkout/session_line_item_service.rbi +33 -0
  537. data/rbi/stripe/services/checkout/session_service.rbi +2585 -0
  538. data/rbi/stripe/services/checkout_service.rbi +9 -0
  539. data/rbi/stripe/services/climate/order_service.rbi +142 -0
  540. data/rbi/stripe/services/climate/product_service.rbi +46 -0
  541. data/rbi/stripe/services/climate/supplier_service.rbi +46 -0
  542. data/rbi/stripe/services/climate_service.rbi +11 -0
  543. data/rbi/stripe/services/confirmation_token_service.rbi +20 -0
  544. data/rbi/stripe/services/country_spec_service.rbi +44 -0
  545. data/rbi/stripe/services/coupon_service.rbi +196 -0
  546. data/rbi/stripe/services/credit_note_line_item_service.rbi +31 -0
  547. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +167 -0
  548. data/rbi/stripe/services/credit_note_service.rbi +416 -0
  549. data/rbi/stripe/services/customer_balance_transaction_service.rbi +92 -0
  550. data/rbi/stripe/services/customer_cash_balance_service.rbi +45 -0
  551. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +44 -0
  552. data/rbi/stripe/services/customer_funding_instructions_service.rbi +59 -0
  553. data/rbi/stripe/services/customer_payment_method_service.rbi +57 -0
  554. data/rbi/stripe/services/customer_payment_source_service.rbi +232 -0
  555. data/rbi/stripe/services/customer_service.rbi +651 -0
  556. data/rbi/stripe/services/customer_session_service.rbi +116 -0
  557. data/rbi/stripe/services/customer_tax_id_service.rbi +72 -0
  558. data/rbi/stripe/services/dispute_service.rbi +424 -0
  559. data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +55 -0
  560. data/rbi/stripe/services/entitlements/feature_service.rbi +107 -0
  561. data/rbi/stripe/services/entitlements_service.rbi +10 -0
  562. data/rbi/stripe/services/ephemeral_key_service.rbi +53 -0
  563. data/rbi/stripe/services/event_service.rbi +83 -0
  564. data/rbi/stripe/services/exchange_rate_service.rbi +44 -0
  565. data/rbi/stripe/services/file_link_service.rbi +124 -0
  566. data/rbi/stripe/services/file_service.rbi +116 -0
  567. data/rbi/stripe/services/financial_connections/account_owner_service.rbi +42 -0
  568. data/rbi/stripe/services/financial_connections/account_service.rbi +133 -0
  569. data/rbi/stripe/services/financial_connections/session_service.rbi +88 -0
  570. data/rbi/stripe/services/financial_connections/transaction_service.rbi +92 -0
  571. data/rbi/stripe/services/financial_connections_service.rbi +11 -0
  572. data/rbi/stripe/services/forwarding/request_service.rbi +134 -0
  573. data/rbi/stripe/services/forwarding_service.rbi +9 -0
  574. data/rbi/stripe/services/identity/verification_report_service.rbi +87 -0
  575. data/rbi/stripe/services/identity/verification_session_service.rbi +323 -0
  576. data/rbi/stripe/services/identity_service.rbi +10 -0
  577. data/rbi/stripe/services/invoice_item_service.rbi +368 -0
  578. data/rbi/stripe/services/invoice_line_item_service.rbi +259 -0
  579. data/rbi/stripe/services/invoice_payment_service.rbi +71 -0
  580. data/rbi/stripe/services/invoice_rendering_template_service.rbi +82 -0
  581. data/rbi/stripe/services/invoice_service.rbi +2920 -0
  582. data/rbi/stripe/services/issuing/authorization_service.rbi +146 -0
  583. data/rbi/stripe/services/issuing/card_service.rbi +495 -0
  584. data/rbi/stripe/services/issuing/cardholder_service.rbi +587 -0
  585. data/rbi/stripe/services/issuing/dispute_service.rbi +707 -0
  586. data/rbi/stripe/services/issuing/personalization_design_service.rbi +243 -0
  587. data/rbi/stripe/services/issuing/physical_bundle_service.rbi +59 -0
  588. data/rbi/stripe/services/issuing/token_service.rbi +99 -0
  589. data/rbi/stripe/services/issuing/transaction_service.rbi +105 -0
  590. data/rbi/stripe/services/issuing_service.rbi +16 -0
  591. data/rbi/stripe/services/mandate_service.rbi +20 -0
  592. data/rbi/stripe/services/payment_intent_service.rbi +7759 -0
  593. data/rbi/stripe/services/payment_link_line_item_service.rbi +31 -0
  594. data/rbi/stripe/services/payment_link_service.rbi +1352 -0
  595. data/rbi/stripe/services/payment_method_configuration_service.rbi +2211 -0
  596. data/rbi/stripe/services/payment_method_domain_service.rbi +112 -0
  597. data/rbi/stripe/services/payment_method_service.rbi +840 -0
  598. data/rbi/stripe/services/payout_service.rbi +205 -0
  599. data/rbi/stripe/services/plan_service.rbi +284 -0
  600. data/rbi/stripe/services/price_service.rbi +546 -0
  601. data/rbi/stripe/services/product_feature_service.rbi +69 -0
  602. data/rbi/stripe/services/product_service.rbi +479 -0
  603. data/rbi/stripe/services/promotion_code_service.rbi +214 -0
  604. data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +31 -0
  605. data/rbi/stripe/services/quote_line_item_service.rbi +31 -0
  606. data/rbi/stripe/services/quote_service.rbi +686 -0
  607. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +85 -0
  608. data/rbi/stripe/services/radar/value_list_item_service.rbi +111 -0
  609. data/rbi/stripe/services/radar/value_list_service.rbi +143 -0
  610. data/rbi/stripe/services/radar_service.rbi +11 -0
  611. data/rbi/stripe/services/refund_service.rbi +185 -0
  612. data/rbi/stripe/services/reporting/report_run_service.rbi +135 -0
  613. data/rbi/stripe/services/reporting/report_type_service.rbi +35 -0
  614. data/rbi/stripe/services/reporting_service.rbi +10 -0
  615. data/rbi/stripe/services/review_service.rbi +84 -0
  616. data/rbi/stripe/services/setup_attempt_service.rbi +65 -0
  617. data/rbi/stripe/services/setup_intent_service.rbi +3596 -0
  618. data/rbi/stripe/services/shipping_rate_service.rbi +241 -0
  619. data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +46 -0
  620. data/rbi/stripe/services/sigma_service.rbi +9 -0
  621. data/rbi/stripe/services/source_service.rbi +663 -0
  622. data/rbi/stripe/services/source_transaction_service.rbi +31 -0
  623. data/rbi/stripe/services/subscription_item_service.rbi +324 -0
  624. data/rbi/stripe/services/subscription_schedule_service.rbi +1192 -0
  625. data/rbi/stripe/services/subscription_service.rbi +1596 -0
  626. data/rbi/stripe/services/tax/calculation_line_item_service.rbi +33 -0
  627. data/rbi/stripe/services/tax/calculation_service.rbi +230 -0
  628. data/rbi/stripe/services/tax/registration_service.rbi +1689 -0
  629. data/rbi/stripe/services/tax/settings_service.rbi +93 -0
  630. data/rbi/stripe/services/tax/transaction_line_item_service.rbi +33 -0
  631. data/rbi/stripe/services/tax/transaction_service.rbi +146 -0
  632. data/rbi/stripe/services/tax_code_service.rbi +44 -0
  633. data/rbi/stripe/services/tax_id_service.rbi +112 -0
  634. data/rbi/stripe/services/tax_rate_service.rbi +185 -0
  635. data/rbi/stripe/services/tax_service.rbi +12 -0
  636. data/rbi/stripe/services/terminal/configuration_service.rbi +1120 -0
  637. data/rbi/stripe/services/terminal/connection_token_service.rbi +25 -0
  638. data/rbi/stripe/services/terminal/location_service.rbi +184 -0
  639. data/rbi/stripe/services/terminal/reader_service.rbi +344 -0
  640. data/rbi/stripe/services/terminal_service.rbi +12 -0
  641. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +746 -0
  642. data/rbi/stripe/services/test_helpers/customer_service.rbi +33 -0
  643. data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +848 -0
  644. data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +76 -0
  645. data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +69 -0
  646. data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +711 -0
  647. data/rbi/stripe/services/test_helpers/issuing_service.rbi +14 -0
  648. data/rbi/stripe/services/test_helpers/refund_service.rbi +22 -0
  649. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +62 -0
  650. data/rbi/stripe/services/test_helpers/terminal_service.rbi +11 -0
  651. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +92 -0
  652. data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +64 -0
  653. data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +125 -0
  654. data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +125 -0
  655. data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +87 -0
  656. data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +87 -0
  657. data/rbi/stripe/services/test_helpers/treasury_service.rbi +15 -0
  658. data/rbi/stripe/services/test_helpers_service.rbi +15 -0
  659. data/rbi/stripe/services/token_service.rbi +1189 -0
  660. data/rbi/stripe/services/topup_service.rbi +176 -0
  661. data/rbi/stripe/services/transfer_reversal_service.rbi +101 -0
  662. data/rbi/stripe/services/transfer_service.rbi +152 -0
  663. data/rbi/stripe/services/treasury/credit_reversal_service.rbi +84 -0
  664. data/rbi/stripe/services/treasury/debit_reversal_service.rbi +88 -0
  665. data/rbi/stripe/services/treasury/financial_account_features_service.rbi +198 -0
  666. data/rbi/stripe/services/treasury/financial_account_service.rbi +562 -0
  667. data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +117 -0
  668. data/rbi/stripe/services/treasury/outbound_payment_service.rbi +304 -0
  669. data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +157 -0
  670. data/rbi/stripe/services/treasury/received_credit_service.rbi +72 -0
  671. data/rbi/stripe/services/treasury/received_debit_service.rbi +59 -0
  672. data/rbi/stripe/services/treasury/transaction_entry_service.rbi +111 -0
  673. data/rbi/stripe/services/treasury/transaction_service.rbi +122 -0
  674. data/rbi/stripe/services/treasury_service.rbi +18 -0
  675. data/rbi/stripe/services/v1_services.rbi +77 -0
  676. data/rbi/stripe/services/v2/billing/meter_event_adjustment_service.rbi +39 -0
  677. data/rbi/stripe/services/v2/billing/meter_event_service.rbi +42 -0
  678. data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +20 -0
  679. data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +55 -0
  680. data/rbi/stripe/services/v2/billing_service.rbi +14 -0
  681. data/rbi/stripe/services/v2/core/event_destination_service.rbi +200 -0
  682. data/rbi/stripe/services/v2/core/event_service.rbi +38 -0
  683. data/rbi/stripe/services/v2/core_service.rbi +12 -0
  684. data/rbi/stripe/services/v2_services.rbi +10 -0
  685. data/rbi/stripe/services/webhook_endpoint_service.rbi +131 -0
  686. metadata +533 -4
  687. data/lib/stripe/resources/usage_record.rb +0 -17
  688. data/lib/stripe/resources/usage_record_summary.rb +0 -11
@@ -49,6 +49,3210 @@ module Stripe
49
49
 
50
50
  nested_resource_class_methods :line, operations: %i[list]
51
51
 
52
+ class AutomaticTax < Stripe::StripeObject
53
+ class Liability < Stripe::StripeObject
54
+ # The connected account being referenced when `type` is `account`.
55
+ attr_reader :account
56
+ # Type of the account referenced.
57
+ attr_reader :type
58
+ end
59
+ # If Stripe disabled automatic tax, this enum describes why.
60
+ attr_reader :disabled_reason
61
+ # Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.
62
+ attr_reader :enabled
63
+ # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
64
+ attr_reader :liability
65
+ # The status of the most recent automated tax calculation for this invoice.
66
+ attr_reader :status
67
+ end
68
+
69
+ class ConfirmationSecret < Stripe::StripeObject
70
+ # The client_secret of the payment that Stripe creates for the invoice after finalization.
71
+ attr_reader :client_secret
72
+ # The type of client_secret. Currently this is always payment_intent, referencing the default payment_intent that Stripe creates during invoice finalization
73
+ attr_reader :type
74
+ end
75
+
76
+ class CustomField < Stripe::StripeObject
77
+ # The name of the custom field.
78
+ attr_reader :name
79
+ # The value of the custom field.
80
+ attr_reader :value
81
+ end
82
+
83
+ class CustomerAddress < Stripe::StripeObject
84
+ # City, district, suburb, town, or village.
85
+ attr_reader :city
86
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
87
+ attr_reader :country
88
+ # Address line 1 (e.g., street, PO Box, or company name).
89
+ attr_reader :line1
90
+ # Address line 2 (e.g., apartment, suite, unit, or building).
91
+ attr_reader :line2
92
+ # ZIP or postal code.
93
+ attr_reader :postal_code
94
+ # State, county, province, or region.
95
+ attr_reader :state
96
+ end
97
+
98
+ class CustomerShipping < Stripe::StripeObject
99
+ class Address < Stripe::StripeObject
100
+ # City, district, suburb, town, or village.
101
+ attr_reader :city
102
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
103
+ attr_reader :country
104
+ # Address line 1 (e.g., street, PO Box, or company name).
105
+ attr_reader :line1
106
+ # Address line 2 (e.g., apartment, suite, unit, or building).
107
+ attr_reader :line2
108
+ # ZIP or postal code.
109
+ attr_reader :postal_code
110
+ # State, county, province, or region.
111
+ attr_reader :state
112
+ end
113
+ # Attribute for field address
114
+ attr_reader :address
115
+ # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
116
+ attr_reader :carrier
117
+ # Recipient name.
118
+ attr_reader :name
119
+ # Recipient phone (including extension).
120
+ attr_reader :phone
121
+ # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.
122
+ attr_reader :tracking_number
123
+ end
124
+
125
+ class CustomerTaxId < Stripe::StripeObject
126
+ # The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `al_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, `ao_tin`, `bs_tin`, `bb_tin`, `cd_nif`, `mr_nif`, `me_pib`, `zw_tin`, `ba_tin`, `gn_nif`, `mk_vat`, `sr_fin`, `sn_ninea`, `am_tin`, `np_pan`, `tj_tin`, `ug_tin`, `zm_tin`, `kh_tin`, or `unknown`
127
+ attr_reader :type
128
+ # The value of the tax ID.
129
+ attr_reader :value
130
+ end
131
+
132
+ class FromInvoice < Stripe::StripeObject
133
+ # The relation between this invoice and the cloned invoice
134
+ attr_reader :action
135
+ # The invoice that was cloned.
136
+ attr_reader :invoice
137
+ end
138
+
139
+ class Issuer < Stripe::StripeObject
140
+ # The connected account being referenced when `type` is `account`.
141
+ attr_reader :account
142
+ # Type of the account referenced.
143
+ attr_reader :type
144
+ end
145
+
146
+ class LastFinalizationError < Stripe::StripeObject
147
+ # For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://stripe.com/docs/declines#retrying-issuer-declines) if they provide one.
148
+ attr_reader :advice_code
149
+ # For card errors, the ID of the failed charge.
150
+ attr_reader :charge
151
+ # For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported.
152
+ attr_reader :code
153
+ # For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one.
154
+ attr_reader :decline_code
155
+ # A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported.
156
+ attr_reader :doc_url
157
+ # A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.
158
+ attr_reader :message
159
+ # For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error.
160
+ attr_reader :network_advice_code
161
+ # For card errors resulting from a card issuer decline, a brand specific 2, 3, or 4 digit code which indicates the reason the authorization failed.
162
+ attr_reader :network_decline_code
163
+ # If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.
164
+ attr_reader :param
165
+ # A PaymentIntent guides you through the process of collecting a payment from your customer.
166
+ # We recommend that you create exactly one PaymentIntent for each order or
167
+ # customer session in your system. You can reference the PaymentIntent later to
168
+ # see the history of payment attempts for a particular session.
169
+ #
170
+ # A PaymentIntent transitions through
171
+ # [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses)
172
+ # throughout its lifetime as it interfaces with Stripe.js to perform
173
+ # authentication flows and ultimately creates at most one successful charge.
174
+ #
175
+ # Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents)
176
+ attr_reader :payment_intent
177
+ # PaymentMethod objects represent your customer's payment instruments.
178
+ # You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to
179
+ # Customer objects to store instrument details for future payments.
180
+ #
181
+ # Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios).
182
+ attr_reader :payment_method
183
+ # If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors.
184
+ attr_reader :payment_method_type
185
+ # A URL to the request log entry in your dashboard.
186
+ attr_reader :request_log_url
187
+ # A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments.
188
+ # For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment.
189
+ # Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow.
190
+ #
191
+ # Create a SetupIntent when you're ready to collect your customer's payment credentials.
192
+ # Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid.
193
+ # The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides
194
+ # you through the setup process.
195
+ #
196
+ # Successful SetupIntents result in payment credentials that are optimized for future payments.
197
+ # For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through
198
+ # [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection
199
+ # to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents).
200
+ # If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer),
201
+ # it automatically attaches the resulting payment method to that Customer after successful setup.
202
+ # We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on
203
+ # PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods.
204
+ #
205
+ # By using SetupIntents, you can reduce friction for your customers, even as regulations change over time.
206
+ #
207
+ # Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents)
208
+ attr_reader :setup_intent
209
+ # Attribute for field source
210
+ attr_reader :source
211
+ # The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error`
212
+ attr_reader :type
213
+ end
214
+
215
+ class Parent < Stripe::StripeObject
216
+ class QuoteDetails < Stripe::StripeObject
217
+ # The quote that generated this invoice
218
+ attr_reader :quote
219
+ end
220
+
221
+ class SubscriptionDetails < Stripe::StripeObject
222
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) defined as subscription metadata when an invoice is created. Becomes an immutable snapshot of the subscription metadata at the time of invoice finalization.
223
+ # *Note: This attribute is populated only for invoices created on or after June 29, 2023.*
224
+ attr_reader :metadata
225
+ # The subscription that generated this invoice
226
+ attr_reader :subscription
227
+ # Only set for upcoming invoices that preview prorations. The time used to calculate prorations.
228
+ attr_reader :subscription_proration_date
229
+ end
230
+ # Details about the quote that generated this invoice
231
+ attr_reader :quote_details
232
+ # Details about the subscription that generated this invoice
233
+ attr_reader :subscription_details
234
+ # The type of parent that generated this invoice
235
+ attr_reader :type
236
+ end
237
+
238
+ class PaymentSettings < Stripe::StripeObject
239
+ class PaymentMethodOptions < Stripe::StripeObject
240
+ class AcssDebit < Stripe::StripeObject
241
+ class MandateOptions < Stripe::StripeObject
242
+ # Transaction type of the mandate.
243
+ attr_reader :transaction_type
244
+ end
245
+ # Attribute for field mandate_options
246
+ attr_reader :mandate_options
247
+ # Bank account verification method.
248
+ attr_reader :verification_method
249
+ end
250
+
251
+ class Bancontact < Stripe::StripeObject
252
+ # Preferred language of the Bancontact authorization page that the customer is redirected to.
253
+ attr_reader :preferred_language
254
+ end
255
+
256
+ class Card < Stripe::StripeObject
257
+ class Installments < Stripe::StripeObject
258
+ # Whether Installments are enabled for this Invoice.
259
+ attr_reader :enabled
260
+ end
261
+ # Attribute for field installments
262
+ attr_reader :installments
263
+ # We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
264
+ attr_reader :request_three_d_secure
265
+ end
266
+
267
+ class CustomerBalance < Stripe::StripeObject
268
+ class BankTransfer < Stripe::StripeObject
269
+ class EuBankTransfer < Stripe::StripeObject
270
+ # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
271
+ attr_reader :country
272
+ end
273
+ # Attribute for field eu_bank_transfer
274
+ attr_reader :eu_bank_transfer
275
+ # The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
276
+ attr_reader :type
277
+ end
278
+ # Attribute for field bank_transfer
279
+ attr_reader :bank_transfer
280
+ # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.
281
+ attr_reader :funding_type
282
+ end
283
+
284
+ class Konbini < Stripe::StripeObject; end
285
+ class SepaDebit < Stripe::StripeObject; end
286
+
287
+ class UsBankAccount < Stripe::StripeObject
288
+ class FinancialConnections < Stripe::StripeObject
289
+ class Filters < Stripe::StripeObject
290
+ # The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`.
291
+ attr_reader :account_subcategories
292
+ end
293
+ # Attribute for field filters
294
+ attr_reader :filters
295
+ # The list of permissions to request. The `payment_method` permission must be included.
296
+ attr_reader :permissions
297
+ # Data features requested to be retrieved upon account creation.
298
+ attr_reader :prefetch
299
+ end
300
+ # Attribute for field financial_connections
301
+ attr_reader :financial_connections
302
+ # Bank account verification method.
303
+ attr_reader :verification_method
304
+ end
305
+ # If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
306
+ attr_reader :acss_debit
307
+ # If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent.
308
+ attr_reader :bancontact
309
+ # If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent.
310
+ attr_reader :card
311
+ # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
312
+ attr_reader :customer_balance
313
+ # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
314
+ attr_reader :konbini
315
+ # If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
316
+ attr_reader :sepa_debit
317
+ # If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent.
318
+ attr_reader :us_bank_account
319
+ end
320
+ # ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set.
321
+ attr_reader :default_mandate
322
+ # Payment-method-specific configuration to provide to the invoice’s PaymentIntent.
323
+ attr_reader :payment_method_options
324
+ # The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice).
325
+ attr_reader :payment_method_types
326
+ end
327
+
328
+ class Rendering < Stripe::StripeObject
329
+ class Pdf < Stripe::StripeObject
330
+ # Page size of invoice pdf. Options include a4, letter, and auto. If set to auto, page size will be switched to a4 or letter based on customer locale.
331
+ attr_reader :page_size
332
+ end
333
+ # How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
334
+ attr_reader :amount_tax_display
335
+ # Invoice pdf rendering options
336
+ attr_reader :pdf
337
+ # ID of the rendering template that the invoice is formatted by.
338
+ attr_reader :template
339
+ # Version of the rendering template that the invoice is using.
340
+ attr_reader :template_version
341
+ end
342
+
343
+ class ShippingCost < Stripe::StripeObject
344
+ class Tax < Stripe::StripeObject
345
+ # Amount of tax applied for this rate.
346
+ attr_reader :amount
347
+ # Tax rates can be applied to [invoices](/invoicing/taxes/tax-rates), [subscriptions](/billing/taxes/tax-rates) and [Checkout Sessions](/payments/checkout/use-manual-tax-rates) to collect tax.
348
+ #
349
+ # Related guide: [Tax rates](/billing/taxes/tax-rates)
350
+ attr_reader :rate
351
+ # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported.
352
+ attr_reader :taxability_reason
353
+ # The amount on which tax is calculated, in cents (or local equivalent).
354
+ attr_reader :taxable_amount
355
+ end
356
+ # Total shipping cost before any taxes are applied.
357
+ attr_reader :amount_subtotal
358
+ # Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0.
359
+ attr_reader :amount_tax
360
+ # Total shipping cost after taxes are applied.
361
+ attr_reader :amount_total
362
+ # The ID of the ShippingRate for this invoice.
363
+ attr_reader :shipping_rate
364
+ # The taxes applied to the shipping rate.
365
+ attr_reader :taxes
366
+ end
367
+
368
+ class ShippingDetails < Stripe::StripeObject
369
+ class Address < Stripe::StripeObject
370
+ # City, district, suburb, town, or village.
371
+ attr_reader :city
372
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
373
+ attr_reader :country
374
+ # Address line 1 (e.g., street, PO Box, or company name).
375
+ attr_reader :line1
376
+ # Address line 2 (e.g., apartment, suite, unit, or building).
377
+ attr_reader :line2
378
+ # ZIP or postal code.
379
+ attr_reader :postal_code
380
+ # State, county, province, or region.
381
+ attr_reader :state
382
+ end
383
+ # Attribute for field address
384
+ attr_reader :address
385
+ # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
386
+ attr_reader :carrier
387
+ # Recipient name.
388
+ attr_reader :name
389
+ # Recipient phone (including extension).
390
+ attr_reader :phone
391
+ # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.
392
+ attr_reader :tracking_number
393
+ end
394
+
395
+ class StatusTransitions < Stripe::StripeObject
396
+ # The time that the invoice draft was finalized.
397
+ attr_reader :finalized_at
398
+ # The time that the invoice was marked uncollectible.
399
+ attr_reader :marked_uncollectible_at
400
+ # The time that the invoice was paid.
401
+ attr_reader :paid_at
402
+ # The time that the invoice was voided.
403
+ attr_reader :voided_at
404
+ end
405
+
406
+ class ThresholdReason < Stripe::StripeObject
407
+ class ItemReason < Stripe::StripeObject
408
+ # The IDs of the line items that triggered the threshold invoice.
409
+ attr_reader :line_item_ids
410
+ # The quantity threshold boundary that applied to the given line item.
411
+ attr_reader :usage_gte
412
+ end
413
+ # The total invoice amount threshold boundary if it triggered the threshold invoice.
414
+ attr_reader :amount_gte
415
+ # Indicates which line items triggered a threshold invoice.
416
+ attr_reader :item_reasons
417
+ end
418
+
419
+ class TotalDiscountAmount < Stripe::StripeObject
420
+ # The amount, in cents (or local equivalent), of the discount.
421
+ attr_reader :amount
422
+ # The discount that was applied to get this discount amount.
423
+ attr_reader :discount
424
+ end
425
+
426
+ class TotalPretaxCreditAmount < Stripe::StripeObject
427
+ # The amount, in cents (or local equivalent), of the pretax credit amount.
428
+ attr_reader :amount
429
+ # The credit balance transaction that was applied to get this pretax credit amount.
430
+ attr_reader :credit_balance_transaction
431
+ # The discount that was applied to get this pretax credit amount.
432
+ attr_reader :discount
433
+ # Type of the pretax credit amount referenced.
434
+ attr_reader :type
435
+ end
436
+
437
+ class TotalTax < Stripe::StripeObject
438
+ class TaxRateDetails < Stripe::StripeObject
439
+ # Attribute for field tax_rate
440
+ attr_reader :tax_rate
441
+ end
442
+ # The amount of the tax, in cents (or local equivalent).
443
+ attr_reader :amount
444
+ # Whether this tax is inclusive or exclusive.
445
+ attr_reader :tax_behavior
446
+ # Additional details about the tax rate. Only present when `type` is `tax_rate_details`.
447
+ attr_reader :tax_rate_details
448
+ # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported.
449
+ attr_reader :taxability_reason
450
+ # The amount on which tax is calculated, in cents (or local equivalent).
451
+ attr_reader :taxable_amount
452
+ # The type of tax information.
453
+ attr_reader :type
454
+ end
455
+
456
+ class DeleteParams < Stripe::RequestParams
457
+ end
458
+
459
+ class UpdateParams < Stripe::RequestParams
460
+ class AutomaticTax < Stripe::RequestParams
461
+ class Liability < Stripe::RequestParams
462
+ # The connected account being referenced when `type` is `account`.
463
+ attr_accessor :account
464
+ # Type of the account referenced in the request.
465
+ attr_accessor :type
466
+
467
+ def initialize(account: nil, type: nil)
468
+ @account = account
469
+ @type = type
470
+ end
471
+ end
472
+ # Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.
473
+ attr_accessor :enabled
474
+ # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
475
+ attr_accessor :liability
476
+
477
+ def initialize(enabled: nil, liability: nil)
478
+ @enabled = enabled
479
+ @liability = liability
480
+ end
481
+ end
482
+
483
+ class CustomField < Stripe::RequestParams
484
+ # The name of the custom field. This may be up to 40 characters.
485
+ attr_accessor :name
486
+ # The value of the custom field. This may be up to 140 characters.
487
+ attr_accessor :value
488
+
489
+ def initialize(name: nil, value: nil)
490
+ @name = name
491
+ @value = value
492
+ end
493
+ end
494
+
495
+ class Discount < Stripe::RequestParams
496
+ # ID of the coupon to create a new discount for.
497
+ attr_accessor :coupon
498
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
499
+ attr_accessor :discount
500
+ # ID of the promotion code to create a new discount for.
501
+ attr_accessor :promotion_code
502
+
503
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
504
+ @coupon = coupon
505
+ @discount = discount
506
+ @promotion_code = promotion_code
507
+ end
508
+ end
509
+
510
+ class Issuer < Stripe::RequestParams
511
+ # The connected account being referenced when `type` is `account`.
512
+ attr_accessor :account
513
+ # Type of the account referenced in the request.
514
+ attr_accessor :type
515
+
516
+ def initialize(account: nil, type: nil)
517
+ @account = account
518
+ @type = type
519
+ end
520
+ end
521
+
522
+ class PaymentSettings < Stripe::RequestParams
523
+ class PaymentMethodOptions < Stripe::RequestParams
524
+ class AcssDebit < Stripe::RequestParams
525
+ class MandateOptions < Stripe::RequestParams
526
+ # Transaction type of the mandate.
527
+ attr_accessor :transaction_type
528
+
529
+ def initialize(transaction_type: nil)
530
+ @transaction_type = transaction_type
531
+ end
532
+ end
533
+ # Additional fields for Mandate creation
534
+ attr_accessor :mandate_options
535
+ # Verification method for the intent
536
+ attr_accessor :verification_method
537
+
538
+ def initialize(mandate_options: nil, verification_method: nil)
539
+ @mandate_options = mandate_options
540
+ @verification_method = verification_method
541
+ end
542
+ end
543
+
544
+ class Bancontact < Stripe::RequestParams
545
+ # Preferred language of the Bancontact authorization page that the customer is redirected to.
546
+ attr_accessor :preferred_language
547
+
548
+ def initialize(preferred_language: nil)
549
+ @preferred_language = preferred_language
550
+ end
551
+ end
552
+
553
+ class Card < Stripe::RequestParams
554
+ class Installments < Stripe::RequestParams
555
+ class Plan < Stripe::RequestParams
556
+ # For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card.
557
+ attr_accessor :count
558
+ # For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card.
559
+ # One of `month`.
560
+ attr_accessor :interval
561
+ # Type of installment plan, one of `fixed_count`.
562
+ attr_accessor :type
563
+
564
+ def initialize(count: nil, interval: nil, type: nil)
565
+ @count = count
566
+ @interval = interval
567
+ @type = type
568
+ end
569
+ end
570
+ # Setting to true enables installments for this invoice.
571
+ # Setting to false will prevent any selected plan from applying to a payment.
572
+ attr_accessor :enabled
573
+ # The selected installment plan to use for this invoice.
574
+ attr_accessor :plan
575
+
576
+ def initialize(enabled: nil, plan: nil)
577
+ @enabled = enabled
578
+ @plan = plan
579
+ end
580
+ end
581
+ # Installment configuration for payments attempted on this invoice (Mexico Only).
582
+ #
583
+ # For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
584
+ attr_accessor :installments
585
+ # We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
586
+ attr_accessor :request_three_d_secure
587
+
588
+ def initialize(installments: nil, request_three_d_secure: nil)
589
+ @installments = installments
590
+ @request_three_d_secure = request_three_d_secure
591
+ end
592
+ end
593
+
594
+ class CustomerBalance < Stripe::RequestParams
595
+ class BankTransfer < Stripe::RequestParams
596
+ class EuBankTransfer < Stripe::RequestParams
597
+ # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
598
+ attr_accessor :country
599
+
600
+ def initialize(country: nil)
601
+ @country = country
602
+ end
603
+ end
604
+ # Configuration for eu_bank_transfer funding type.
605
+ attr_accessor :eu_bank_transfer
606
+ # The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
607
+ attr_accessor :type
608
+
609
+ def initialize(eu_bank_transfer: nil, type: nil)
610
+ @eu_bank_transfer = eu_bank_transfer
611
+ @type = type
612
+ end
613
+ end
614
+ # Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
615
+ attr_accessor :bank_transfer
616
+ # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.
617
+ attr_accessor :funding_type
618
+
619
+ def initialize(bank_transfer: nil, funding_type: nil)
620
+ @bank_transfer = bank_transfer
621
+ @funding_type = funding_type
622
+ end
623
+ end
624
+
625
+ class Konbini < Stripe::RequestParams
626
+ end
627
+
628
+ class SepaDebit < Stripe::RequestParams
629
+ end
630
+
631
+ class UsBankAccount < Stripe::RequestParams
632
+ class FinancialConnections < Stripe::RequestParams
633
+ class Filters < Stripe::RequestParams
634
+ # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
635
+ attr_accessor :account_subcategories
636
+
637
+ def initialize(account_subcategories: nil)
638
+ @account_subcategories = account_subcategories
639
+ end
640
+ end
641
+ # Provide filters for the linked accounts that the customer can select for the payment method.
642
+ attr_accessor :filters
643
+ # The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
644
+ attr_accessor :permissions
645
+ # List of data features that you would like to retrieve upon account creation.
646
+ attr_accessor :prefetch
647
+
648
+ def initialize(filters: nil, permissions: nil, prefetch: nil)
649
+ @filters = filters
650
+ @permissions = permissions
651
+ @prefetch = prefetch
652
+ end
653
+ end
654
+ # Additional fields for Financial Connections Session creation
655
+ attr_accessor :financial_connections
656
+ # Verification method for the intent
657
+ attr_accessor :verification_method
658
+
659
+ def initialize(financial_connections: nil, verification_method: nil)
660
+ @financial_connections = financial_connections
661
+ @verification_method = verification_method
662
+ end
663
+ end
664
+ # If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
665
+ attr_accessor :acss_debit
666
+ # If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent.
667
+ attr_accessor :bancontact
668
+ # If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent.
669
+ attr_accessor :card
670
+ # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
671
+ attr_accessor :customer_balance
672
+ # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
673
+ attr_accessor :konbini
674
+ # If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
675
+ attr_accessor :sepa_debit
676
+ # If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent.
677
+ attr_accessor :us_bank_account
678
+
679
+ def initialize(
680
+ acss_debit: nil,
681
+ bancontact: nil,
682
+ card: nil,
683
+ customer_balance: nil,
684
+ konbini: nil,
685
+ sepa_debit: nil,
686
+ us_bank_account: nil
687
+ )
688
+ @acss_debit = acss_debit
689
+ @bancontact = bancontact
690
+ @card = card
691
+ @customer_balance = customer_balance
692
+ @konbini = konbini
693
+ @sepa_debit = sepa_debit
694
+ @us_bank_account = us_bank_account
695
+ end
696
+ end
697
+ # ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set.
698
+ attr_accessor :default_mandate
699
+ # Payment-method-specific configuration to provide to the invoice’s PaymentIntent.
700
+ attr_accessor :payment_method_options
701
+ # The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration
702
+ attr_accessor :payment_method_types
703
+
704
+ def initialize(default_mandate: nil, payment_method_options: nil, payment_method_types: nil)
705
+ @default_mandate = default_mandate
706
+ @payment_method_options = payment_method_options
707
+ @payment_method_types = payment_method_types
708
+ end
709
+ end
710
+
711
+ class Rendering < Stripe::RequestParams
712
+ class Pdf < Stripe::RequestParams
713
+ # Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`.
714
+ # If set to `auto`, invoice PDF page size defaults to `a4` for customers with
715
+ # Japanese locale and `letter` for customers with other locales.
716
+ attr_accessor :page_size
717
+
718
+ def initialize(page_size: nil)
719
+ @page_size = page_size
720
+ end
721
+ end
722
+ # How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
723
+ attr_accessor :amount_tax_display
724
+ # Invoice pdf rendering options
725
+ attr_accessor :pdf
726
+ # ID of the invoice rendering template to use for this invoice.
727
+ attr_accessor :template
728
+ # The specific version of invoice rendering template to use for this invoice.
729
+ attr_accessor :template_version
730
+
731
+ def initialize(amount_tax_display: nil, pdf: nil, template: nil, template_version: nil)
732
+ @amount_tax_display = amount_tax_display
733
+ @pdf = pdf
734
+ @template = template
735
+ @template_version = template_version
736
+ end
737
+ end
738
+
739
+ class ShippingCost < Stripe::RequestParams
740
+ class ShippingRateData < Stripe::RequestParams
741
+ class DeliveryEstimate < Stripe::RequestParams
742
+ class Maximum < Stripe::RequestParams
743
+ # A unit of time.
744
+ attr_accessor :unit
745
+ # Must be greater than 0.
746
+ attr_accessor :value
747
+
748
+ def initialize(unit: nil, value: nil)
749
+ @unit = unit
750
+ @value = value
751
+ end
752
+ end
753
+
754
+ class Minimum < Stripe::RequestParams
755
+ # A unit of time.
756
+ attr_accessor :unit
757
+ # Must be greater than 0.
758
+ attr_accessor :value
759
+
760
+ def initialize(unit: nil, value: nil)
761
+ @unit = unit
762
+ @value = value
763
+ end
764
+ end
765
+ # The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.
766
+ attr_accessor :maximum
767
+ # The lower bound of the estimated range. If empty, represents no lower bound.
768
+ attr_accessor :minimum
769
+
770
+ def initialize(maximum: nil, minimum: nil)
771
+ @maximum = maximum
772
+ @minimum = minimum
773
+ end
774
+ end
775
+
776
+ class FixedAmount < Stripe::RequestParams
777
+ class CurrencyOptions < Stripe::RequestParams
778
+ # A non-negative integer in cents representing how much to charge.
779
+ attr_accessor :amount
780
+ # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
781
+ attr_accessor :tax_behavior
782
+
783
+ def initialize(amount: nil, tax_behavior: nil)
784
+ @amount = amount
785
+ @tax_behavior = tax_behavior
786
+ end
787
+ end
788
+ # A non-negative integer in cents representing how much to charge.
789
+ attr_accessor :amount
790
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
791
+ attr_accessor :currency
792
+ # Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
793
+ attr_accessor :currency_options
794
+
795
+ def initialize(amount: nil, currency: nil, currency_options: nil)
796
+ @amount = amount
797
+ @currency = currency
798
+ @currency_options = currency_options
799
+ end
800
+ end
801
+ # The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
802
+ attr_accessor :delivery_estimate
803
+ # The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.
804
+ attr_accessor :display_name
805
+ # Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.
806
+ attr_accessor :fixed_amount
807
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
808
+ attr_accessor :metadata
809
+ # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
810
+ attr_accessor :tax_behavior
811
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`.
812
+ attr_accessor :tax_code
813
+ # The type of calculation to use on the shipping rate.
814
+ attr_accessor :type
815
+
816
+ def initialize(
817
+ delivery_estimate: nil,
818
+ display_name: nil,
819
+ fixed_amount: nil,
820
+ metadata: nil,
821
+ tax_behavior: nil,
822
+ tax_code: nil,
823
+ type: nil
824
+ )
825
+ @delivery_estimate = delivery_estimate
826
+ @display_name = display_name
827
+ @fixed_amount = fixed_amount
828
+ @metadata = metadata
829
+ @tax_behavior = tax_behavior
830
+ @tax_code = tax_code
831
+ @type = type
832
+ end
833
+ end
834
+ # The ID of the shipping rate to use for this order.
835
+ attr_accessor :shipping_rate
836
+ # Parameters to create a new ad-hoc shipping rate for this order.
837
+ attr_accessor :shipping_rate_data
838
+
839
+ def initialize(shipping_rate: nil, shipping_rate_data: nil)
840
+ @shipping_rate = shipping_rate
841
+ @shipping_rate_data = shipping_rate_data
842
+ end
843
+ end
844
+
845
+ class ShippingDetails < Stripe::RequestParams
846
+ class Address < Stripe::RequestParams
847
+ # City, district, suburb, town, or village.
848
+ attr_accessor :city
849
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
850
+ attr_accessor :country
851
+ # Address line 1 (e.g., street, PO Box, or company name).
852
+ attr_accessor :line1
853
+ # Address line 2 (e.g., apartment, suite, unit, or building).
854
+ attr_accessor :line2
855
+ # ZIP or postal code.
856
+ attr_accessor :postal_code
857
+ # State, county, province, or region.
858
+ attr_accessor :state
859
+
860
+ def initialize(
861
+ city: nil,
862
+ country: nil,
863
+ line1: nil,
864
+ line2: nil,
865
+ postal_code: nil,
866
+ state: nil
867
+ )
868
+ @city = city
869
+ @country = country
870
+ @line1 = line1
871
+ @line2 = line2
872
+ @postal_code = postal_code
873
+ @state = state
874
+ end
875
+ end
876
+ # Shipping address
877
+ attr_accessor :address
878
+ # Recipient name.
879
+ attr_accessor :name
880
+ # Recipient phone (including extension)
881
+ attr_accessor :phone
882
+
883
+ def initialize(address: nil, name: nil, phone: nil)
884
+ @address = address
885
+ @name = name
886
+ @phone = phone
887
+ end
888
+ end
889
+
890
+ class TransferData < Stripe::RequestParams
891
+ # The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred.
892
+ attr_accessor :amount
893
+ # ID of an existing, connected Stripe account.
894
+ attr_accessor :destination
895
+
896
+ def initialize(amount: nil, destination: nil)
897
+ @amount = amount
898
+ @destination = destination
899
+ end
900
+ end
901
+ # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
902
+ attr_accessor :account_tax_ids
903
+ # A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees).
904
+ attr_accessor :application_fee_amount
905
+ # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice.
906
+ attr_accessor :auto_advance
907
+ # Settings for automatic tax lookup for this invoice.
908
+ attr_accessor :automatic_tax
909
+ # The time when this invoice should be scheduled to finalize. The invoice will be finalized at this time if it is still in draft state. To turn off automatic finalization, set `auto_advance` to false.
910
+ attr_accessor :automatically_finalizes_at
911
+ # Either `charge_automatically` or `send_invoice`. This field can be updated only on `draft` invoices.
912
+ attr_accessor :collection_method
913
+ # A list of up to 4 custom fields to be displayed on the invoice. If a value for `custom_fields` is specified, the list specified will replace the existing custom field list on this invoice. Pass an empty string to remove previously-defined fields.
914
+ attr_accessor :custom_fields
915
+ # The number of days from which the invoice is created until it is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices.
916
+ attr_accessor :days_until_due
917
+ # ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
918
+ attr_accessor :default_payment_method
919
+ # ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
920
+ attr_accessor :default_source
921
+ # The tax rates that will apply to any line item that does not have `tax_rates` set. Pass an empty string to remove previously-defined tax rates.
922
+ attr_accessor :default_tax_rates
923
+ # An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
924
+ attr_accessor :description
925
+ # The discounts that will apply to the invoice. Pass an empty string to remove previously-defined discounts.
926
+ attr_accessor :discounts
927
+ # The date on which payment for this invoice is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices.
928
+ attr_accessor :due_date
929
+ # The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt.
930
+ attr_accessor :effective_at
931
+ # Specifies which fields in the response should be expanded.
932
+ attr_accessor :expand
933
+ # Footer to be displayed on the invoice.
934
+ attr_accessor :footer
935
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
936
+ attr_accessor :issuer
937
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
938
+ attr_accessor :metadata
939
+ # Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically.
940
+ attr_accessor :number
941
+ # The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details.
942
+ attr_accessor :on_behalf_of
943
+ # Configuration settings for the PaymentIntent that is generated when the invoice is finalized.
944
+ attr_accessor :payment_settings
945
+ # The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.
946
+ attr_accessor :rendering
947
+ # Settings for the cost of shipping for this invoice.
948
+ attr_accessor :shipping_cost
949
+ # Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer.
950
+ attr_accessor :shipping_details
951
+ # Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`.
952
+ attr_accessor :statement_descriptor
953
+ # If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. This will be unset if you POST an empty value.
954
+ attr_accessor :transfer_data
955
+
956
+ def initialize(
957
+ account_tax_ids: nil,
958
+ application_fee_amount: nil,
959
+ auto_advance: nil,
960
+ automatic_tax: nil,
961
+ automatically_finalizes_at: nil,
962
+ collection_method: nil,
963
+ custom_fields: nil,
964
+ days_until_due: nil,
965
+ default_payment_method: nil,
966
+ default_source: nil,
967
+ default_tax_rates: nil,
968
+ description: nil,
969
+ discounts: nil,
970
+ due_date: nil,
971
+ effective_at: nil,
972
+ expand: nil,
973
+ footer: nil,
974
+ issuer: nil,
975
+ metadata: nil,
976
+ number: nil,
977
+ on_behalf_of: nil,
978
+ payment_settings: nil,
979
+ rendering: nil,
980
+ shipping_cost: nil,
981
+ shipping_details: nil,
982
+ statement_descriptor: nil,
983
+ transfer_data: nil
984
+ )
985
+ @account_tax_ids = account_tax_ids
986
+ @application_fee_amount = application_fee_amount
987
+ @auto_advance = auto_advance
988
+ @automatic_tax = automatic_tax
989
+ @automatically_finalizes_at = automatically_finalizes_at
990
+ @collection_method = collection_method
991
+ @custom_fields = custom_fields
992
+ @days_until_due = days_until_due
993
+ @default_payment_method = default_payment_method
994
+ @default_source = default_source
995
+ @default_tax_rates = default_tax_rates
996
+ @description = description
997
+ @discounts = discounts
998
+ @due_date = due_date
999
+ @effective_at = effective_at
1000
+ @expand = expand
1001
+ @footer = footer
1002
+ @issuer = issuer
1003
+ @metadata = metadata
1004
+ @number = number
1005
+ @on_behalf_of = on_behalf_of
1006
+ @payment_settings = payment_settings
1007
+ @rendering = rendering
1008
+ @shipping_cost = shipping_cost
1009
+ @shipping_details = shipping_details
1010
+ @statement_descriptor = statement_descriptor
1011
+ @transfer_data = transfer_data
1012
+ end
1013
+ end
1014
+
1015
+ class ListParams < Stripe::RequestParams
1016
+ class Created < Stripe::RequestParams
1017
+ # Minimum value to filter by (exclusive)
1018
+ attr_accessor :gt
1019
+ # Minimum value to filter by (inclusive)
1020
+ attr_accessor :gte
1021
+ # Maximum value to filter by (exclusive)
1022
+ attr_accessor :lt
1023
+ # Maximum value to filter by (inclusive)
1024
+ attr_accessor :lte
1025
+
1026
+ def initialize(gt: nil, gte: nil, lt: nil, lte: nil)
1027
+ @gt = gt
1028
+ @gte = gte
1029
+ @lt = lt
1030
+ @lte = lte
1031
+ end
1032
+ end
1033
+
1034
+ class DueDate < Stripe::RequestParams
1035
+ # Minimum value to filter by (exclusive)
1036
+ attr_accessor :gt
1037
+ # Minimum value to filter by (inclusive)
1038
+ attr_accessor :gte
1039
+ # Maximum value to filter by (exclusive)
1040
+ attr_accessor :lt
1041
+ # Maximum value to filter by (inclusive)
1042
+ attr_accessor :lte
1043
+
1044
+ def initialize(gt: nil, gte: nil, lt: nil, lte: nil)
1045
+ @gt = gt
1046
+ @gte = gte
1047
+ @lt = lt
1048
+ @lte = lte
1049
+ end
1050
+ end
1051
+ # The collection method of the invoice to retrieve. Either `charge_automatically` or `send_invoice`.
1052
+ attr_accessor :collection_method
1053
+ # Only return invoices that were created during the given date interval.
1054
+ attr_accessor :created
1055
+ # Only return invoices for the customer specified by this customer ID.
1056
+ attr_accessor :customer
1057
+ # Attribute for param field due_date
1058
+ attr_accessor :due_date
1059
+ # A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
1060
+ attr_accessor :ending_before
1061
+ # Specifies which fields in the response should be expanded.
1062
+ attr_accessor :expand
1063
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
1064
+ attr_accessor :limit
1065
+ # A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
1066
+ attr_accessor :starting_after
1067
+ # The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview)
1068
+ attr_accessor :status
1069
+ # Only return invoices for the subscription specified by this subscription ID.
1070
+ attr_accessor :subscription
1071
+
1072
+ def initialize(
1073
+ collection_method: nil,
1074
+ created: nil,
1075
+ customer: nil,
1076
+ due_date: nil,
1077
+ ending_before: nil,
1078
+ expand: nil,
1079
+ limit: nil,
1080
+ starting_after: nil,
1081
+ status: nil,
1082
+ subscription: nil
1083
+ )
1084
+ @collection_method = collection_method
1085
+ @created = created
1086
+ @customer = customer
1087
+ @due_date = due_date
1088
+ @ending_before = ending_before
1089
+ @expand = expand
1090
+ @limit = limit
1091
+ @starting_after = starting_after
1092
+ @status = status
1093
+ @subscription = subscription
1094
+ end
1095
+ end
1096
+
1097
+ class CreateParams < Stripe::RequestParams
1098
+ class AutomaticTax < Stripe::RequestParams
1099
+ class Liability < Stripe::RequestParams
1100
+ # The connected account being referenced when `type` is `account`.
1101
+ attr_accessor :account
1102
+ # Type of the account referenced in the request.
1103
+ attr_accessor :type
1104
+
1105
+ def initialize(account: nil, type: nil)
1106
+ @account = account
1107
+ @type = type
1108
+ end
1109
+ end
1110
+ # Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.
1111
+ attr_accessor :enabled
1112
+ # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
1113
+ attr_accessor :liability
1114
+
1115
+ def initialize(enabled: nil, liability: nil)
1116
+ @enabled = enabled
1117
+ @liability = liability
1118
+ end
1119
+ end
1120
+
1121
+ class CustomField < Stripe::RequestParams
1122
+ # The name of the custom field. This may be up to 40 characters.
1123
+ attr_accessor :name
1124
+ # The value of the custom field. This may be up to 140 characters.
1125
+ attr_accessor :value
1126
+
1127
+ def initialize(name: nil, value: nil)
1128
+ @name = name
1129
+ @value = value
1130
+ end
1131
+ end
1132
+
1133
+ class Discount < Stripe::RequestParams
1134
+ # ID of the coupon to create a new discount for.
1135
+ attr_accessor :coupon
1136
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1137
+ attr_accessor :discount
1138
+ # ID of the promotion code to create a new discount for.
1139
+ attr_accessor :promotion_code
1140
+
1141
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
1142
+ @coupon = coupon
1143
+ @discount = discount
1144
+ @promotion_code = promotion_code
1145
+ end
1146
+ end
1147
+
1148
+ class FromInvoice < Stripe::RequestParams
1149
+ # The relation between the new invoice and the original invoice. Currently, only 'revision' is permitted
1150
+ attr_accessor :action
1151
+ # The `id` of the invoice that will be cloned.
1152
+ attr_accessor :invoice
1153
+
1154
+ def initialize(action: nil, invoice: nil)
1155
+ @action = action
1156
+ @invoice = invoice
1157
+ end
1158
+ end
1159
+
1160
+ class Issuer < Stripe::RequestParams
1161
+ # The connected account being referenced when `type` is `account`.
1162
+ attr_accessor :account
1163
+ # Type of the account referenced in the request.
1164
+ attr_accessor :type
1165
+
1166
+ def initialize(account: nil, type: nil)
1167
+ @account = account
1168
+ @type = type
1169
+ end
1170
+ end
1171
+
1172
+ class PaymentSettings < Stripe::RequestParams
1173
+ class PaymentMethodOptions < Stripe::RequestParams
1174
+ class AcssDebit < Stripe::RequestParams
1175
+ class MandateOptions < Stripe::RequestParams
1176
+ # Transaction type of the mandate.
1177
+ attr_accessor :transaction_type
1178
+
1179
+ def initialize(transaction_type: nil)
1180
+ @transaction_type = transaction_type
1181
+ end
1182
+ end
1183
+ # Additional fields for Mandate creation
1184
+ attr_accessor :mandate_options
1185
+ # Verification method for the intent
1186
+ attr_accessor :verification_method
1187
+
1188
+ def initialize(mandate_options: nil, verification_method: nil)
1189
+ @mandate_options = mandate_options
1190
+ @verification_method = verification_method
1191
+ end
1192
+ end
1193
+
1194
+ class Bancontact < Stripe::RequestParams
1195
+ # Preferred language of the Bancontact authorization page that the customer is redirected to.
1196
+ attr_accessor :preferred_language
1197
+
1198
+ def initialize(preferred_language: nil)
1199
+ @preferred_language = preferred_language
1200
+ end
1201
+ end
1202
+
1203
+ class Card < Stripe::RequestParams
1204
+ class Installments < Stripe::RequestParams
1205
+ class Plan < Stripe::RequestParams
1206
+ # For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card.
1207
+ attr_accessor :count
1208
+ # For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card.
1209
+ # One of `month`.
1210
+ attr_accessor :interval
1211
+ # Type of installment plan, one of `fixed_count`.
1212
+ attr_accessor :type
1213
+
1214
+ def initialize(count: nil, interval: nil, type: nil)
1215
+ @count = count
1216
+ @interval = interval
1217
+ @type = type
1218
+ end
1219
+ end
1220
+ # Setting to true enables installments for this invoice.
1221
+ # Setting to false will prevent any selected plan from applying to a payment.
1222
+ attr_accessor :enabled
1223
+ # The selected installment plan to use for this invoice.
1224
+ attr_accessor :plan
1225
+
1226
+ def initialize(enabled: nil, plan: nil)
1227
+ @enabled = enabled
1228
+ @plan = plan
1229
+ end
1230
+ end
1231
+ # Installment configuration for payments attempted on this invoice (Mexico Only).
1232
+ #
1233
+ # For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
1234
+ attr_accessor :installments
1235
+ # We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
1236
+ attr_accessor :request_three_d_secure
1237
+
1238
+ def initialize(installments: nil, request_three_d_secure: nil)
1239
+ @installments = installments
1240
+ @request_three_d_secure = request_three_d_secure
1241
+ end
1242
+ end
1243
+
1244
+ class CustomerBalance < Stripe::RequestParams
1245
+ class BankTransfer < Stripe::RequestParams
1246
+ class EuBankTransfer < Stripe::RequestParams
1247
+ # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
1248
+ attr_accessor :country
1249
+
1250
+ def initialize(country: nil)
1251
+ @country = country
1252
+ end
1253
+ end
1254
+ # Configuration for eu_bank_transfer funding type.
1255
+ attr_accessor :eu_bank_transfer
1256
+ # The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
1257
+ attr_accessor :type
1258
+
1259
+ def initialize(eu_bank_transfer: nil, type: nil)
1260
+ @eu_bank_transfer = eu_bank_transfer
1261
+ @type = type
1262
+ end
1263
+ end
1264
+ # Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
1265
+ attr_accessor :bank_transfer
1266
+ # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.
1267
+ attr_accessor :funding_type
1268
+
1269
+ def initialize(bank_transfer: nil, funding_type: nil)
1270
+ @bank_transfer = bank_transfer
1271
+ @funding_type = funding_type
1272
+ end
1273
+ end
1274
+
1275
+ class Konbini < Stripe::RequestParams
1276
+ end
1277
+
1278
+ class SepaDebit < Stripe::RequestParams
1279
+ end
1280
+
1281
+ class UsBankAccount < Stripe::RequestParams
1282
+ class FinancialConnections < Stripe::RequestParams
1283
+ class Filters < Stripe::RequestParams
1284
+ # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
1285
+ attr_accessor :account_subcategories
1286
+
1287
+ def initialize(account_subcategories: nil)
1288
+ @account_subcategories = account_subcategories
1289
+ end
1290
+ end
1291
+ # Provide filters for the linked accounts that the customer can select for the payment method.
1292
+ attr_accessor :filters
1293
+ # The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
1294
+ attr_accessor :permissions
1295
+ # List of data features that you would like to retrieve upon account creation.
1296
+ attr_accessor :prefetch
1297
+
1298
+ def initialize(filters: nil, permissions: nil, prefetch: nil)
1299
+ @filters = filters
1300
+ @permissions = permissions
1301
+ @prefetch = prefetch
1302
+ end
1303
+ end
1304
+ # Additional fields for Financial Connections Session creation
1305
+ attr_accessor :financial_connections
1306
+ # Verification method for the intent
1307
+ attr_accessor :verification_method
1308
+
1309
+ def initialize(financial_connections: nil, verification_method: nil)
1310
+ @financial_connections = financial_connections
1311
+ @verification_method = verification_method
1312
+ end
1313
+ end
1314
+ # If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
1315
+ attr_accessor :acss_debit
1316
+ # If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent.
1317
+ attr_accessor :bancontact
1318
+ # If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent.
1319
+ attr_accessor :card
1320
+ # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
1321
+ attr_accessor :customer_balance
1322
+ # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
1323
+ attr_accessor :konbini
1324
+ # If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
1325
+ attr_accessor :sepa_debit
1326
+ # If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent.
1327
+ attr_accessor :us_bank_account
1328
+
1329
+ def initialize(
1330
+ acss_debit: nil,
1331
+ bancontact: nil,
1332
+ card: nil,
1333
+ customer_balance: nil,
1334
+ konbini: nil,
1335
+ sepa_debit: nil,
1336
+ us_bank_account: nil
1337
+ )
1338
+ @acss_debit = acss_debit
1339
+ @bancontact = bancontact
1340
+ @card = card
1341
+ @customer_balance = customer_balance
1342
+ @konbini = konbini
1343
+ @sepa_debit = sepa_debit
1344
+ @us_bank_account = us_bank_account
1345
+ end
1346
+ end
1347
+ # ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set.
1348
+ attr_accessor :default_mandate
1349
+ # Payment-method-specific configuration to provide to the invoice’s PaymentIntent.
1350
+ attr_accessor :payment_method_options
1351
+ # The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration
1352
+ attr_accessor :payment_method_types
1353
+
1354
+ def initialize(default_mandate: nil, payment_method_options: nil, payment_method_types: nil)
1355
+ @default_mandate = default_mandate
1356
+ @payment_method_options = payment_method_options
1357
+ @payment_method_types = payment_method_types
1358
+ end
1359
+ end
1360
+
1361
+ class Rendering < Stripe::RequestParams
1362
+ class Pdf < Stripe::RequestParams
1363
+ # Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`.
1364
+ # If set to `auto`, invoice PDF page size defaults to `a4` for customers with
1365
+ # Japanese locale and `letter` for customers with other locales.
1366
+ attr_accessor :page_size
1367
+
1368
+ def initialize(page_size: nil)
1369
+ @page_size = page_size
1370
+ end
1371
+ end
1372
+ # How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
1373
+ attr_accessor :amount_tax_display
1374
+ # Invoice pdf rendering options
1375
+ attr_accessor :pdf
1376
+ # ID of the invoice rendering template to use for this invoice.
1377
+ attr_accessor :template
1378
+ # The specific version of invoice rendering template to use for this invoice.
1379
+ attr_accessor :template_version
1380
+
1381
+ def initialize(amount_tax_display: nil, pdf: nil, template: nil, template_version: nil)
1382
+ @amount_tax_display = amount_tax_display
1383
+ @pdf = pdf
1384
+ @template = template
1385
+ @template_version = template_version
1386
+ end
1387
+ end
1388
+
1389
+ class ShippingCost < Stripe::RequestParams
1390
+ class ShippingRateData < Stripe::RequestParams
1391
+ class DeliveryEstimate < Stripe::RequestParams
1392
+ class Maximum < Stripe::RequestParams
1393
+ # A unit of time.
1394
+ attr_accessor :unit
1395
+ # Must be greater than 0.
1396
+ attr_accessor :value
1397
+
1398
+ def initialize(unit: nil, value: nil)
1399
+ @unit = unit
1400
+ @value = value
1401
+ end
1402
+ end
1403
+
1404
+ class Minimum < Stripe::RequestParams
1405
+ # A unit of time.
1406
+ attr_accessor :unit
1407
+ # Must be greater than 0.
1408
+ attr_accessor :value
1409
+
1410
+ def initialize(unit: nil, value: nil)
1411
+ @unit = unit
1412
+ @value = value
1413
+ end
1414
+ end
1415
+ # The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.
1416
+ attr_accessor :maximum
1417
+ # The lower bound of the estimated range. If empty, represents no lower bound.
1418
+ attr_accessor :minimum
1419
+
1420
+ def initialize(maximum: nil, minimum: nil)
1421
+ @maximum = maximum
1422
+ @minimum = minimum
1423
+ end
1424
+ end
1425
+
1426
+ class FixedAmount < Stripe::RequestParams
1427
+ class CurrencyOptions < Stripe::RequestParams
1428
+ # A non-negative integer in cents representing how much to charge.
1429
+ attr_accessor :amount
1430
+ # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
1431
+ attr_accessor :tax_behavior
1432
+
1433
+ def initialize(amount: nil, tax_behavior: nil)
1434
+ @amount = amount
1435
+ @tax_behavior = tax_behavior
1436
+ end
1437
+ end
1438
+ # A non-negative integer in cents representing how much to charge.
1439
+ attr_accessor :amount
1440
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
1441
+ attr_accessor :currency
1442
+ # Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
1443
+ attr_accessor :currency_options
1444
+
1445
+ def initialize(amount: nil, currency: nil, currency_options: nil)
1446
+ @amount = amount
1447
+ @currency = currency
1448
+ @currency_options = currency_options
1449
+ end
1450
+ end
1451
+ # The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
1452
+ attr_accessor :delivery_estimate
1453
+ # The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.
1454
+ attr_accessor :display_name
1455
+ # Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.
1456
+ attr_accessor :fixed_amount
1457
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
1458
+ attr_accessor :metadata
1459
+ # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
1460
+ attr_accessor :tax_behavior
1461
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`.
1462
+ attr_accessor :tax_code
1463
+ # The type of calculation to use on the shipping rate.
1464
+ attr_accessor :type
1465
+
1466
+ def initialize(
1467
+ delivery_estimate: nil,
1468
+ display_name: nil,
1469
+ fixed_amount: nil,
1470
+ metadata: nil,
1471
+ tax_behavior: nil,
1472
+ tax_code: nil,
1473
+ type: nil
1474
+ )
1475
+ @delivery_estimate = delivery_estimate
1476
+ @display_name = display_name
1477
+ @fixed_amount = fixed_amount
1478
+ @metadata = metadata
1479
+ @tax_behavior = tax_behavior
1480
+ @tax_code = tax_code
1481
+ @type = type
1482
+ end
1483
+ end
1484
+ # The ID of the shipping rate to use for this order.
1485
+ attr_accessor :shipping_rate
1486
+ # Parameters to create a new ad-hoc shipping rate for this order.
1487
+ attr_accessor :shipping_rate_data
1488
+
1489
+ def initialize(shipping_rate: nil, shipping_rate_data: nil)
1490
+ @shipping_rate = shipping_rate
1491
+ @shipping_rate_data = shipping_rate_data
1492
+ end
1493
+ end
1494
+
1495
+ class ShippingDetails < Stripe::RequestParams
1496
+ class Address < Stripe::RequestParams
1497
+ # City, district, suburb, town, or village.
1498
+ attr_accessor :city
1499
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
1500
+ attr_accessor :country
1501
+ # Address line 1 (e.g., street, PO Box, or company name).
1502
+ attr_accessor :line1
1503
+ # Address line 2 (e.g., apartment, suite, unit, or building).
1504
+ attr_accessor :line2
1505
+ # ZIP or postal code.
1506
+ attr_accessor :postal_code
1507
+ # State, county, province, or region.
1508
+ attr_accessor :state
1509
+
1510
+ def initialize(
1511
+ city: nil,
1512
+ country: nil,
1513
+ line1: nil,
1514
+ line2: nil,
1515
+ postal_code: nil,
1516
+ state: nil
1517
+ )
1518
+ @city = city
1519
+ @country = country
1520
+ @line1 = line1
1521
+ @line2 = line2
1522
+ @postal_code = postal_code
1523
+ @state = state
1524
+ end
1525
+ end
1526
+ # Shipping address
1527
+ attr_accessor :address
1528
+ # Recipient name.
1529
+ attr_accessor :name
1530
+ # Recipient phone (including extension)
1531
+ attr_accessor :phone
1532
+
1533
+ def initialize(address: nil, name: nil, phone: nil)
1534
+ @address = address
1535
+ @name = name
1536
+ @phone = phone
1537
+ end
1538
+ end
1539
+
1540
+ class TransferData < Stripe::RequestParams
1541
+ # The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred.
1542
+ attr_accessor :amount
1543
+ # ID of an existing, connected Stripe account.
1544
+ attr_accessor :destination
1545
+
1546
+ def initialize(amount: nil, destination: nil)
1547
+ @amount = amount
1548
+ @destination = destination
1549
+ end
1550
+ end
1551
+ # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
1552
+ attr_accessor :account_tax_ids
1553
+ # A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees).
1554
+ attr_accessor :application_fee_amount
1555
+ # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action.
1556
+ attr_accessor :auto_advance
1557
+ # Settings for automatic tax lookup for this invoice.
1558
+ attr_accessor :automatic_tax
1559
+ # The time when this invoice should be scheduled to finalize. The invoice will be finalized at this time if it is still in draft state.
1560
+ attr_accessor :automatically_finalizes_at
1561
+ # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. Defaults to `charge_automatically`.
1562
+ attr_accessor :collection_method
1563
+ # The currency to create this invoice in. Defaults to that of `customer` if not specified.
1564
+ attr_accessor :currency
1565
+ # A list of up to 4 custom fields to be displayed on the invoice.
1566
+ attr_accessor :custom_fields
1567
+ # The ID of the customer who will be billed.
1568
+ attr_accessor :customer
1569
+ # The number of days from when the invoice is created until it is due. Valid only for invoices where `collection_method=send_invoice`.
1570
+ attr_accessor :days_until_due
1571
+ # ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
1572
+ attr_accessor :default_payment_method
1573
+ # ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
1574
+ attr_accessor :default_source
1575
+ # The tax rates that will apply to any line item that does not have `tax_rates` set.
1576
+ attr_accessor :default_tax_rates
1577
+ # An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
1578
+ attr_accessor :description
1579
+ # The coupons and promotion codes to redeem into discounts for the invoice. If not specified, inherits the discount from the invoice's customer. Pass an empty string to avoid inheriting any discounts.
1580
+ attr_accessor :discounts
1581
+ # The date on which payment for this invoice is due. Valid only for invoices where `collection_method=send_invoice`.
1582
+ attr_accessor :due_date
1583
+ # The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt.
1584
+ attr_accessor :effective_at
1585
+ # Specifies which fields in the response should be expanded.
1586
+ attr_accessor :expand
1587
+ # Footer to be displayed on the invoice.
1588
+ attr_accessor :footer
1589
+ # Revise an existing invoice. The new invoice will be created in `status=draft`. See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details.
1590
+ attr_accessor :from_invoice
1591
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
1592
+ attr_accessor :issuer
1593
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
1594
+ attr_accessor :metadata
1595
+ # Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically.
1596
+ attr_accessor :number
1597
+ # The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details.
1598
+ attr_accessor :on_behalf_of
1599
+ # Configuration settings for the PaymentIntent that is generated when the invoice is finalized.
1600
+ attr_accessor :payment_settings
1601
+ # How to handle pending invoice items on invoice creation. Defaults to `exclude` if the parameter is omitted.
1602
+ attr_accessor :pending_invoice_items_behavior
1603
+ # The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.
1604
+ attr_accessor :rendering
1605
+ # Settings for the cost of shipping for this invoice.
1606
+ attr_accessor :shipping_cost
1607
+ # Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer.
1608
+ attr_accessor :shipping_details
1609
+ # Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`.
1610
+ attr_accessor :statement_descriptor
1611
+ # The ID of the subscription to invoice, if any. If set, the created invoice will only include pending invoice items for that subscription. The subscription's billing cycle and regular subscription events won't be affected.
1612
+ attr_accessor :subscription
1613
+ # If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge.
1614
+ attr_accessor :transfer_data
1615
+
1616
+ def initialize(
1617
+ account_tax_ids: nil,
1618
+ application_fee_amount: nil,
1619
+ auto_advance: nil,
1620
+ automatic_tax: nil,
1621
+ automatically_finalizes_at: nil,
1622
+ collection_method: nil,
1623
+ currency: nil,
1624
+ custom_fields: nil,
1625
+ customer: nil,
1626
+ days_until_due: nil,
1627
+ default_payment_method: nil,
1628
+ default_source: nil,
1629
+ default_tax_rates: nil,
1630
+ description: nil,
1631
+ discounts: nil,
1632
+ due_date: nil,
1633
+ effective_at: nil,
1634
+ expand: nil,
1635
+ footer: nil,
1636
+ from_invoice: nil,
1637
+ issuer: nil,
1638
+ metadata: nil,
1639
+ number: nil,
1640
+ on_behalf_of: nil,
1641
+ payment_settings: nil,
1642
+ pending_invoice_items_behavior: nil,
1643
+ rendering: nil,
1644
+ shipping_cost: nil,
1645
+ shipping_details: nil,
1646
+ statement_descriptor: nil,
1647
+ subscription: nil,
1648
+ transfer_data: nil
1649
+ )
1650
+ @account_tax_ids = account_tax_ids
1651
+ @application_fee_amount = application_fee_amount
1652
+ @auto_advance = auto_advance
1653
+ @automatic_tax = automatic_tax
1654
+ @automatically_finalizes_at = automatically_finalizes_at
1655
+ @collection_method = collection_method
1656
+ @currency = currency
1657
+ @custom_fields = custom_fields
1658
+ @customer = customer
1659
+ @days_until_due = days_until_due
1660
+ @default_payment_method = default_payment_method
1661
+ @default_source = default_source
1662
+ @default_tax_rates = default_tax_rates
1663
+ @description = description
1664
+ @discounts = discounts
1665
+ @due_date = due_date
1666
+ @effective_at = effective_at
1667
+ @expand = expand
1668
+ @footer = footer
1669
+ @from_invoice = from_invoice
1670
+ @issuer = issuer
1671
+ @metadata = metadata
1672
+ @number = number
1673
+ @on_behalf_of = on_behalf_of
1674
+ @payment_settings = payment_settings
1675
+ @pending_invoice_items_behavior = pending_invoice_items_behavior
1676
+ @rendering = rendering
1677
+ @shipping_cost = shipping_cost
1678
+ @shipping_details = shipping_details
1679
+ @statement_descriptor = statement_descriptor
1680
+ @subscription = subscription
1681
+ @transfer_data = transfer_data
1682
+ end
1683
+ end
1684
+
1685
+ class SearchParams < Stripe::RequestParams
1686
+ # Specifies which fields in the response should be expanded.
1687
+ attr_accessor :expand
1688
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
1689
+ attr_accessor :limit
1690
+ # A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.
1691
+ attr_accessor :page
1692
+ # The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for invoices](https://stripe.com/docs/search#query-fields-for-invoices).
1693
+ attr_accessor :query
1694
+
1695
+ def initialize(expand: nil, limit: nil, page: nil, query: nil)
1696
+ @expand = expand
1697
+ @limit = limit
1698
+ @page = page
1699
+ @query = query
1700
+ end
1701
+ end
1702
+
1703
+ class AddLinesParams < Stripe::RequestParams
1704
+ class Line < Stripe::RequestParams
1705
+ class Discount < Stripe::RequestParams
1706
+ # ID of the coupon to create a new discount for.
1707
+ attr_accessor :coupon
1708
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1709
+ attr_accessor :discount
1710
+ # ID of the promotion code to create a new discount for.
1711
+ attr_accessor :promotion_code
1712
+
1713
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
1714
+ @coupon = coupon
1715
+ @discount = discount
1716
+ @promotion_code = promotion_code
1717
+ end
1718
+ end
1719
+
1720
+ class Period < Stripe::RequestParams
1721
+ # The end of the period, which must be greater than or equal to the start. This value is inclusive.
1722
+ attr_accessor :end
1723
+ # The start of the period. This value is inclusive.
1724
+ attr_accessor :start
1725
+
1726
+ def initialize(end_: nil, start: nil)
1727
+ @end = end_
1728
+ @start = start
1729
+ end
1730
+ end
1731
+
1732
+ class PriceData < Stripe::RequestParams
1733
+ class ProductData < Stripe::RequestParams
1734
+ # The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.
1735
+ attr_accessor :description
1736
+ # A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
1737
+ attr_accessor :images
1738
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
1739
+ attr_accessor :metadata
1740
+ # The product's name, meant to be displayable to the customer.
1741
+ attr_accessor :name
1742
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
1743
+ attr_accessor :tax_code
1744
+
1745
+ def initialize(description: nil, images: nil, metadata: nil, name: nil, tax_code: nil)
1746
+ @description = description
1747
+ @images = images
1748
+ @metadata = metadata
1749
+ @name = name
1750
+ @tax_code = tax_code
1751
+ end
1752
+ end
1753
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
1754
+ attr_accessor :currency
1755
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. One of `product` or `product_data` is required.
1756
+ attr_accessor :product
1757
+ # Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required.
1758
+ attr_accessor :product_data
1759
+ # Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
1760
+ attr_accessor :tax_behavior
1761
+ # A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
1762
+ attr_accessor :unit_amount
1763
+ # Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
1764
+ attr_accessor :unit_amount_decimal
1765
+
1766
+ def initialize(
1767
+ currency: nil,
1768
+ product: nil,
1769
+ product_data: nil,
1770
+ tax_behavior: nil,
1771
+ unit_amount: nil,
1772
+ unit_amount_decimal: nil
1773
+ )
1774
+ @currency = currency
1775
+ @product = product
1776
+ @product_data = product_data
1777
+ @tax_behavior = tax_behavior
1778
+ @unit_amount = unit_amount
1779
+ @unit_amount_decimal = unit_amount_decimal
1780
+ end
1781
+ end
1782
+
1783
+ class Pricing < Stripe::RequestParams
1784
+ # The ID of the price object.
1785
+ attr_accessor :price
1786
+
1787
+ def initialize(price: nil)
1788
+ @price = price
1789
+ end
1790
+ end
1791
+
1792
+ class TaxAmount < Stripe::RequestParams
1793
+ class TaxRateData < Stripe::RequestParams
1794
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
1795
+ attr_accessor :country
1796
+ # An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
1797
+ attr_accessor :description
1798
+ # The display name of the tax rate, which will be shown to users.
1799
+ attr_accessor :display_name
1800
+ # This specifies if the tax rate is inclusive or exclusive.
1801
+ attr_accessor :inclusive
1802
+ # The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice.
1803
+ attr_accessor :jurisdiction
1804
+ # The level of the jurisdiction that imposes this tax rate.
1805
+ attr_accessor :jurisdiction_level
1806
+ # The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero.
1807
+ attr_accessor :percentage
1808
+ # [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States.
1809
+ attr_accessor :state
1810
+ # The high-level tax type, such as `vat` or `sales_tax`.
1811
+ attr_accessor :tax_type
1812
+
1813
+ def initialize(
1814
+ country: nil,
1815
+ description: nil,
1816
+ display_name: nil,
1817
+ inclusive: nil,
1818
+ jurisdiction: nil,
1819
+ jurisdiction_level: nil,
1820
+ percentage: nil,
1821
+ state: nil,
1822
+ tax_type: nil
1823
+ )
1824
+ @country = country
1825
+ @description = description
1826
+ @display_name = display_name
1827
+ @inclusive = inclusive
1828
+ @jurisdiction = jurisdiction
1829
+ @jurisdiction_level = jurisdiction_level
1830
+ @percentage = percentage
1831
+ @state = state
1832
+ @tax_type = tax_type
1833
+ end
1834
+ end
1835
+ # The amount, in cents (or local equivalent), of the tax.
1836
+ attr_accessor :amount
1837
+ # Data to find or create a TaxRate object.
1838
+ #
1839
+ # Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item’s `tax_rates`, and cannot be directly added to invoices, payments, or line items.
1840
+ attr_accessor :tax_rate_data
1841
+ # The reasoning behind this tax, for example, if the product is tax exempt.
1842
+ attr_accessor :taxability_reason
1843
+ # The amount on which tax is calculated, in cents (or local equivalent).
1844
+ attr_accessor :taxable_amount
1845
+
1846
+ def initialize(
1847
+ amount: nil,
1848
+ tax_rate_data: nil,
1849
+ taxability_reason: nil,
1850
+ taxable_amount: nil
1851
+ )
1852
+ @amount = amount
1853
+ @tax_rate_data = tax_rate_data
1854
+ @taxability_reason = taxability_reason
1855
+ @taxable_amount = taxable_amount
1856
+ end
1857
+ end
1858
+ # The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount.
1859
+ attr_accessor :amount
1860
+ # An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
1861
+ attr_accessor :description
1862
+ # Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations.
1863
+ attr_accessor :discountable
1864
+ # The coupons, promotion codes & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts.
1865
+ attr_accessor :discounts
1866
+ # ID of an unassigned invoice item to assign to this invoice. If not provided, a new item will be created.
1867
+ attr_accessor :invoice_item
1868
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
1869
+ attr_accessor :metadata
1870
+ # The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
1871
+ attr_accessor :period
1872
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
1873
+ attr_accessor :price_data
1874
+ # The pricing information for the invoice item.
1875
+ attr_accessor :pricing
1876
+ # Non-negative integer. The quantity of units for the line item.
1877
+ attr_accessor :quantity
1878
+ # A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts.
1879
+ attr_accessor :tax_amounts
1880
+ # The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates.
1881
+ attr_accessor :tax_rates
1882
+
1883
+ def initialize(
1884
+ amount: nil,
1885
+ description: nil,
1886
+ discountable: nil,
1887
+ discounts: nil,
1888
+ invoice_item: nil,
1889
+ metadata: nil,
1890
+ period: nil,
1891
+ price_data: nil,
1892
+ pricing: nil,
1893
+ quantity: nil,
1894
+ tax_amounts: nil,
1895
+ tax_rates: nil
1896
+ )
1897
+ @amount = amount
1898
+ @description = description
1899
+ @discountable = discountable
1900
+ @discounts = discounts
1901
+ @invoice_item = invoice_item
1902
+ @metadata = metadata
1903
+ @period = period
1904
+ @price_data = price_data
1905
+ @pricing = pricing
1906
+ @quantity = quantity
1907
+ @tax_amounts = tax_amounts
1908
+ @tax_rates = tax_rates
1909
+ end
1910
+ end
1911
+ # Specifies which fields in the response should be expanded.
1912
+ attr_accessor :expand
1913
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
1914
+ attr_accessor :invoice_metadata
1915
+ # The line items to add.
1916
+ attr_accessor :lines
1917
+
1918
+ def initialize(expand: nil, invoice_metadata: nil, lines: nil)
1919
+ @expand = expand
1920
+ @invoice_metadata = invoice_metadata
1921
+ @lines = lines
1922
+ end
1923
+ end
1924
+
1925
+ class FinalizeInvoiceParams < Stripe::RequestParams
1926
+ # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action.
1927
+ attr_accessor :auto_advance
1928
+ # Specifies which fields in the response should be expanded.
1929
+ attr_accessor :expand
1930
+
1931
+ def initialize(auto_advance: nil, expand: nil)
1932
+ @auto_advance = auto_advance
1933
+ @expand = expand
1934
+ end
1935
+ end
1936
+
1937
+ class MarkUncollectibleParams < Stripe::RequestParams
1938
+ # Specifies which fields in the response should be expanded.
1939
+ attr_accessor :expand
1940
+
1941
+ def initialize(expand: nil)
1942
+ @expand = expand
1943
+ end
1944
+ end
1945
+
1946
+ class PayParams < Stripe::RequestParams
1947
+ # Specifies which fields in the response should be expanded.
1948
+ attr_accessor :expand
1949
+ # In cases where the source used to pay the invoice has insufficient funds, passing `forgive=true` controls whether a charge should be attempted for the full amount available on the source, up to the amount to fully pay the invoice. This effectively forgives the difference between the amount available on the source and the amount due.
1950
+ #
1951
+ # Passing `forgive=false` will fail the charge if the source hasn't been pre-funded with the right amount. An example for this case is with ACH Credit Transfers and wires: if the amount wired is less than the amount due by a small amount, you might want to forgive the difference. Defaults to `false`.
1952
+ attr_accessor :forgive
1953
+ # ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the payment_method param or the invoice's default_payment_method or default_source, if set.
1954
+ attr_accessor :mandate
1955
+ # Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `true` (off-session).
1956
+ attr_accessor :off_session
1957
+ # Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made. Defaults to `false`.
1958
+ attr_accessor :paid_out_of_band
1959
+ # A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid.
1960
+ attr_accessor :payment_method
1961
+ # A payment source to be charged. The source must be the ID of a source belonging to the customer associated with the invoice being paid.
1962
+ attr_accessor :source
1963
+
1964
+ def initialize(
1965
+ expand: nil,
1966
+ forgive: nil,
1967
+ mandate: nil,
1968
+ off_session: nil,
1969
+ paid_out_of_band: nil,
1970
+ payment_method: nil,
1971
+ source: nil
1972
+ )
1973
+ @expand = expand
1974
+ @forgive = forgive
1975
+ @mandate = mandate
1976
+ @off_session = off_session
1977
+ @paid_out_of_band = paid_out_of_band
1978
+ @payment_method = payment_method
1979
+ @source = source
1980
+ end
1981
+ end
1982
+
1983
+ class RemoveLinesParams < Stripe::RequestParams
1984
+ class Line < Stripe::RequestParams
1985
+ # Either `delete` or `unassign`. Deleted line items are permanently deleted. Unassigned line items can be reassigned to an invoice.
1986
+ attr_accessor :behavior
1987
+ # ID of an existing line item to remove from this invoice.
1988
+ attr_accessor :id
1989
+
1990
+ def initialize(behavior: nil, id: nil)
1991
+ @behavior = behavior
1992
+ @id = id
1993
+ end
1994
+ end
1995
+ # Specifies which fields in the response should be expanded.
1996
+ attr_accessor :expand
1997
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
1998
+ attr_accessor :invoice_metadata
1999
+ # The line items to remove.
2000
+ attr_accessor :lines
2001
+
2002
+ def initialize(expand: nil, invoice_metadata: nil, lines: nil)
2003
+ @expand = expand
2004
+ @invoice_metadata = invoice_metadata
2005
+ @lines = lines
2006
+ end
2007
+ end
2008
+
2009
+ class SendInvoiceParams < Stripe::RequestParams
2010
+ # Specifies which fields in the response should be expanded.
2011
+ attr_accessor :expand
2012
+
2013
+ def initialize(expand: nil)
2014
+ @expand = expand
2015
+ end
2016
+ end
2017
+
2018
+ class UpdateLinesParams < Stripe::RequestParams
2019
+ class Line < Stripe::RequestParams
2020
+ class Discount < Stripe::RequestParams
2021
+ # ID of the coupon to create a new discount for.
2022
+ attr_accessor :coupon
2023
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2024
+ attr_accessor :discount
2025
+ # ID of the promotion code to create a new discount for.
2026
+ attr_accessor :promotion_code
2027
+
2028
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
2029
+ @coupon = coupon
2030
+ @discount = discount
2031
+ @promotion_code = promotion_code
2032
+ end
2033
+ end
2034
+
2035
+ class Period < Stripe::RequestParams
2036
+ # The end of the period, which must be greater than or equal to the start. This value is inclusive.
2037
+ attr_accessor :end
2038
+ # The start of the period. This value is inclusive.
2039
+ attr_accessor :start
2040
+
2041
+ def initialize(end_: nil, start: nil)
2042
+ @end = end_
2043
+ @start = start
2044
+ end
2045
+ end
2046
+
2047
+ class PriceData < Stripe::RequestParams
2048
+ class ProductData < Stripe::RequestParams
2049
+ # The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.
2050
+ attr_accessor :description
2051
+ # A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
2052
+ attr_accessor :images
2053
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
2054
+ attr_accessor :metadata
2055
+ # The product's name, meant to be displayable to the customer.
2056
+ attr_accessor :name
2057
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
2058
+ attr_accessor :tax_code
2059
+
2060
+ def initialize(description: nil, images: nil, metadata: nil, name: nil, tax_code: nil)
2061
+ @description = description
2062
+ @images = images
2063
+ @metadata = metadata
2064
+ @name = name
2065
+ @tax_code = tax_code
2066
+ end
2067
+ end
2068
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
2069
+ attr_accessor :currency
2070
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. One of `product` or `product_data` is required.
2071
+ attr_accessor :product
2072
+ # Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required.
2073
+ attr_accessor :product_data
2074
+ # Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
2075
+ attr_accessor :tax_behavior
2076
+ # A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
2077
+ attr_accessor :unit_amount
2078
+ # Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
2079
+ attr_accessor :unit_amount_decimal
2080
+
2081
+ def initialize(
2082
+ currency: nil,
2083
+ product: nil,
2084
+ product_data: nil,
2085
+ tax_behavior: nil,
2086
+ unit_amount: nil,
2087
+ unit_amount_decimal: nil
2088
+ )
2089
+ @currency = currency
2090
+ @product = product
2091
+ @product_data = product_data
2092
+ @tax_behavior = tax_behavior
2093
+ @unit_amount = unit_amount
2094
+ @unit_amount_decimal = unit_amount_decimal
2095
+ end
2096
+ end
2097
+
2098
+ class Pricing < Stripe::RequestParams
2099
+ # The ID of the price object.
2100
+ attr_accessor :price
2101
+
2102
+ def initialize(price: nil)
2103
+ @price = price
2104
+ end
2105
+ end
2106
+
2107
+ class TaxAmount < Stripe::RequestParams
2108
+ class TaxRateData < Stripe::RequestParams
2109
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
2110
+ attr_accessor :country
2111
+ # An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
2112
+ attr_accessor :description
2113
+ # The display name of the tax rate, which will be shown to users.
2114
+ attr_accessor :display_name
2115
+ # This specifies if the tax rate is inclusive or exclusive.
2116
+ attr_accessor :inclusive
2117
+ # The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice.
2118
+ attr_accessor :jurisdiction
2119
+ # The level of the jurisdiction that imposes this tax rate.
2120
+ attr_accessor :jurisdiction_level
2121
+ # The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero.
2122
+ attr_accessor :percentage
2123
+ # [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States.
2124
+ attr_accessor :state
2125
+ # The high-level tax type, such as `vat` or `sales_tax`.
2126
+ attr_accessor :tax_type
2127
+
2128
+ def initialize(
2129
+ country: nil,
2130
+ description: nil,
2131
+ display_name: nil,
2132
+ inclusive: nil,
2133
+ jurisdiction: nil,
2134
+ jurisdiction_level: nil,
2135
+ percentage: nil,
2136
+ state: nil,
2137
+ tax_type: nil
2138
+ )
2139
+ @country = country
2140
+ @description = description
2141
+ @display_name = display_name
2142
+ @inclusive = inclusive
2143
+ @jurisdiction = jurisdiction
2144
+ @jurisdiction_level = jurisdiction_level
2145
+ @percentage = percentage
2146
+ @state = state
2147
+ @tax_type = tax_type
2148
+ end
2149
+ end
2150
+ # The amount, in cents (or local equivalent), of the tax.
2151
+ attr_accessor :amount
2152
+ # Data to find or create a TaxRate object.
2153
+ #
2154
+ # Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item’s `tax_rates`, and cannot be directly added to invoices, payments, or line items.
2155
+ attr_accessor :tax_rate_data
2156
+ # The reasoning behind this tax, for example, if the product is tax exempt.
2157
+ attr_accessor :taxability_reason
2158
+ # The amount on which tax is calculated, in cents (or local equivalent).
2159
+ attr_accessor :taxable_amount
2160
+
2161
+ def initialize(
2162
+ amount: nil,
2163
+ tax_rate_data: nil,
2164
+ taxability_reason: nil,
2165
+ taxable_amount: nil
2166
+ )
2167
+ @amount = amount
2168
+ @tax_rate_data = tax_rate_data
2169
+ @taxability_reason = taxability_reason
2170
+ @taxable_amount = taxable_amount
2171
+ end
2172
+ end
2173
+ # The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount.
2174
+ attr_accessor :amount
2175
+ # An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
2176
+ attr_accessor :description
2177
+ # Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations.
2178
+ attr_accessor :discountable
2179
+ # The coupons, promotion codes & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts.
2180
+ attr_accessor :discounts
2181
+ # ID of an existing line item on the invoice.
2182
+ attr_accessor :id
2183
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. For [type=subscription](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](api/invoices/line_item#invoice_line_item_object-type) line items, where any existing metadata on the invoice line is merged with the incoming data.
2184
+ attr_accessor :metadata
2185
+ # The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
2186
+ attr_accessor :period
2187
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
2188
+ attr_accessor :price_data
2189
+ # The pricing information for the invoice item.
2190
+ attr_accessor :pricing
2191
+ # Non-negative integer. The quantity of units for the line item.
2192
+ attr_accessor :quantity
2193
+ # A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts.
2194
+ attr_accessor :tax_amounts
2195
+ # The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates.
2196
+ attr_accessor :tax_rates
2197
+
2198
+ def initialize(
2199
+ amount: nil,
2200
+ description: nil,
2201
+ discountable: nil,
2202
+ discounts: nil,
2203
+ id: nil,
2204
+ metadata: nil,
2205
+ period: nil,
2206
+ price_data: nil,
2207
+ pricing: nil,
2208
+ quantity: nil,
2209
+ tax_amounts: nil,
2210
+ tax_rates: nil
2211
+ )
2212
+ @amount = amount
2213
+ @description = description
2214
+ @discountable = discountable
2215
+ @discounts = discounts
2216
+ @id = id
2217
+ @metadata = metadata
2218
+ @period = period
2219
+ @price_data = price_data
2220
+ @pricing = pricing
2221
+ @quantity = quantity
2222
+ @tax_amounts = tax_amounts
2223
+ @tax_rates = tax_rates
2224
+ end
2225
+ end
2226
+ # Specifies which fields in the response should be expanded.
2227
+ attr_accessor :expand
2228
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. For [type=subscription](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](api/invoices/line_item#invoice_line_item_object-type) line items, where any existing metadata on the invoice line is merged with the incoming data.
2229
+ attr_accessor :invoice_metadata
2230
+ # The line items to update.
2231
+ attr_accessor :lines
2232
+
2233
+ def initialize(expand: nil, invoice_metadata: nil, lines: nil)
2234
+ @expand = expand
2235
+ @invoice_metadata = invoice_metadata
2236
+ @lines = lines
2237
+ end
2238
+ end
2239
+
2240
+ class VoidInvoiceParams < Stripe::RequestParams
2241
+ # Specifies which fields in the response should be expanded.
2242
+ attr_accessor :expand
2243
+
2244
+ def initialize(expand: nil)
2245
+ @expand = expand
2246
+ end
2247
+ end
2248
+
2249
+ class CreatePreviewParams < Stripe::RequestParams
2250
+ class AutomaticTax < Stripe::RequestParams
2251
+ class Liability < Stripe::RequestParams
2252
+ # The connected account being referenced when `type` is `account`.
2253
+ attr_accessor :account
2254
+ # Type of the account referenced in the request.
2255
+ attr_accessor :type
2256
+
2257
+ def initialize(account: nil, type: nil)
2258
+ @account = account
2259
+ @type = type
2260
+ end
2261
+ end
2262
+ # Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.
2263
+ attr_accessor :enabled
2264
+ # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
2265
+ attr_accessor :liability
2266
+
2267
+ def initialize(enabled: nil, liability: nil)
2268
+ @enabled = enabled
2269
+ @liability = liability
2270
+ end
2271
+ end
2272
+
2273
+ class CustomerDetails < Stripe::RequestParams
2274
+ class Address < Stripe::RequestParams
2275
+ # City, district, suburb, town, or village.
2276
+ attr_accessor :city
2277
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
2278
+ attr_accessor :country
2279
+ # Address line 1 (e.g., street, PO Box, or company name).
2280
+ attr_accessor :line1
2281
+ # Address line 2 (e.g., apartment, suite, unit, or building).
2282
+ attr_accessor :line2
2283
+ # ZIP or postal code.
2284
+ attr_accessor :postal_code
2285
+ # State, county, province, or region.
2286
+ attr_accessor :state
2287
+
2288
+ def initialize(
2289
+ city: nil,
2290
+ country: nil,
2291
+ line1: nil,
2292
+ line2: nil,
2293
+ postal_code: nil,
2294
+ state: nil
2295
+ )
2296
+ @city = city
2297
+ @country = country
2298
+ @line1 = line1
2299
+ @line2 = line2
2300
+ @postal_code = postal_code
2301
+ @state = state
2302
+ end
2303
+ end
2304
+
2305
+ class Shipping < Stripe::RequestParams
2306
+ class Address < Stripe::RequestParams
2307
+ # City, district, suburb, town, or village.
2308
+ attr_accessor :city
2309
+ # A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
2310
+ attr_accessor :country
2311
+ # Address line 1 (e.g., street, PO Box, or company name).
2312
+ attr_accessor :line1
2313
+ # Address line 2 (e.g., apartment, suite, unit, or building).
2314
+ attr_accessor :line2
2315
+ # ZIP or postal code.
2316
+ attr_accessor :postal_code
2317
+ # State, county, province, or region.
2318
+ attr_accessor :state
2319
+
2320
+ def initialize(
2321
+ city: nil,
2322
+ country: nil,
2323
+ line1: nil,
2324
+ line2: nil,
2325
+ postal_code: nil,
2326
+ state: nil
2327
+ )
2328
+ @city = city
2329
+ @country = country
2330
+ @line1 = line1
2331
+ @line2 = line2
2332
+ @postal_code = postal_code
2333
+ @state = state
2334
+ end
2335
+ end
2336
+ # Customer shipping address.
2337
+ attr_accessor :address
2338
+ # Customer name.
2339
+ attr_accessor :name
2340
+ # Customer phone (including extension).
2341
+ attr_accessor :phone
2342
+
2343
+ def initialize(address: nil, name: nil, phone: nil)
2344
+ @address = address
2345
+ @name = name
2346
+ @phone = phone
2347
+ end
2348
+ end
2349
+
2350
+ class Tax < Stripe::RequestParams
2351
+ # A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes.
2352
+ attr_accessor :ip_address
2353
+
2354
+ def initialize(ip_address: nil)
2355
+ @ip_address = ip_address
2356
+ end
2357
+ end
2358
+
2359
+ class TaxId < Stripe::RequestParams
2360
+ # Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin`
2361
+ attr_accessor :type
2362
+ # Value of the tax ID.
2363
+ attr_accessor :value
2364
+
2365
+ def initialize(type: nil, value: nil)
2366
+ @type = type
2367
+ @value = value
2368
+ end
2369
+ end
2370
+ # The customer's address.
2371
+ attr_accessor :address
2372
+ # The customer's shipping information. Appears on invoices emailed to this customer.
2373
+ attr_accessor :shipping
2374
+ # Tax details about the customer.
2375
+ attr_accessor :tax
2376
+ # The customer's tax exemption. One of `none`, `exempt`, or `reverse`.
2377
+ attr_accessor :tax_exempt
2378
+ # The customer's tax IDs.
2379
+ attr_accessor :tax_ids
2380
+
2381
+ def initialize(address: nil, shipping: nil, tax: nil, tax_exempt: nil, tax_ids: nil)
2382
+ @address = address
2383
+ @shipping = shipping
2384
+ @tax = tax
2385
+ @tax_exempt = tax_exempt
2386
+ @tax_ids = tax_ids
2387
+ end
2388
+ end
2389
+
2390
+ class Discount < Stripe::RequestParams
2391
+ # ID of the coupon to create a new discount for.
2392
+ attr_accessor :coupon
2393
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2394
+ attr_accessor :discount
2395
+ # ID of the promotion code to create a new discount for.
2396
+ attr_accessor :promotion_code
2397
+
2398
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
2399
+ @coupon = coupon
2400
+ @discount = discount
2401
+ @promotion_code = promotion_code
2402
+ end
2403
+ end
2404
+
2405
+ class InvoiceItem < Stripe::RequestParams
2406
+ class Discount < Stripe::RequestParams
2407
+ # ID of the coupon to create a new discount for.
2408
+ attr_accessor :coupon
2409
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2410
+ attr_accessor :discount
2411
+ # ID of the promotion code to create a new discount for.
2412
+ attr_accessor :promotion_code
2413
+
2414
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
2415
+ @coupon = coupon
2416
+ @discount = discount
2417
+ @promotion_code = promotion_code
2418
+ end
2419
+ end
2420
+
2421
+ class Period < Stripe::RequestParams
2422
+ # The end of the period, which must be greater than or equal to the start. This value is inclusive.
2423
+ attr_accessor :end
2424
+ # The start of the period. This value is inclusive.
2425
+ attr_accessor :start
2426
+
2427
+ def initialize(end_: nil, start: nil)
2428
+ @end = end_
2429
+ @start = start
2430
+ end
2431
+ end
2432
+
2433
+ class PriceData < Stripe::RequestParams
2434
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
2435
+ attr_accessor :currency
2436
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
2437
+ attr_accessor :product
2438
+ # Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
2439
+ attr_accessor :tax_behavior
2440
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
2441
+ attr_accessor :unit_amount
2442
+ # Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
2443
+ attr_accessor :unit_amount_decimal
2444
+
2445
+ def initialize(
2446
+ currency: nil,
2447
+ product: nil,
2448
+ tax_behavior: nil,
2449
+ unit_amount: nil,
2450
+ unit_amount_decimal: nil
2451
+ )
2452
+ @currency = currency
2453
+ @product = product
2454
+ @tax_behavior = tax_behavior
2455
+ @unit_amount = unit_amount
2456
+ @unit_amount_decimal = unit_amount_decimal
2457
+ end
2458
+ end
2459
+ # The integer amount in cents (or local equivalent) of previewed invoice item.
2460
+ attr_accessor :amount
2461
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Only applicable to new invoice items.
2462
+ attr_accessor :currency
2463
+ # An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
2464
+ attr_accessor :description
2465
+ # Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items.
2466
+ attr_accessor :discountable
2467
+ # The coupons to redeem into discounts for the invoice item in the preview.
2468
+ attr_accessor :discounts
2469
+ # The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice.
2470
+ attr_accessor :invoiceitem
2471
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
2472
+ attr_accessor :metadata
2473
+ # The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
2474
+ attr_accessor :period
2475
+ # The ID of the price object. One of `price` or `price_data` is required.
2476
+ attr_accessor :price
2477
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
2478
+ attr_accessor :price_data
2479
+ # Non-negative integer. The quantity of units for the invoice item.
2480
+ attr_accessor :quantity
2481
+ # Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
2482
+ attr_accessor :tax_behavior
2483
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
2484
+ attr_accessor :tax_code
2485
+ # The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item.
2486
+ attr_accessor :tax_rates
2487
+ # The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount.
2488
+ attr_accessor :unit_amount
2489
+ # Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
2490
+ attr_accessor :unit_amount_decimal
2491
+
2492
+ def initialize(
2493
+ amount: nil,
2494
+ currency: nil,
2495
+ description: nil,
2496
+ discountable: nil,
2497
+ discounts: nil,
2498
+ invoiceitem: nil,
2499
+ metadata: nil,
2500
+ period: nil,
2501
+ price: nil,
2502
+ price_data: nil,
2503
+ quantity: nil,
2504
+ tax_behavior: nil,
2505
+ tax_code: nil,
2506
+ tax_rates: nil,
2507
+ unit_amount: nil,
2508
+ unit_amount_decimal: nil
2509
+ )
2510
+ @amount = amount
2511
+ @currency = currency
2512
+ @description = description
2513
+ @discountable = discountable
2514
+ @discounts = discounts
2515
+ @invoiceitem = invoiceitem
2516
+ @metadata = metadata
2517
+ @period = period
2518
+ @price = price
2519
+ @price_data = price_data
2520
+ @quantity = quantity
2521
+ @tax_behavior = tax_behavior
2522
+ @tax_code = tax_code
2523
+ @tax_rates = tax_rates
2524
+ @unit_amount = unit_amount
2525
+ @unit_amount_decimal = unit_amount_decimal
2526
+ end
2527
+ end
2528
+
2529
+ class Issuer < Stripe::RequestParams
2530
+ # The connected account being referenced when `type` is `account`.
2531
+ attr_accessor :account
2532
+ # Type of the account referenced in the request.
2533
+ attr_accessor :type
2534
+
2535
+ def initialize(account: nil, type: nil)
2536
+ @account = account
2537
+ @type = type
2538
+ end
2539
+ end
2540
+
2541
+ class ScheduleDetails < Stripe::RequestParams
2542
+ class Phase < Stripe::RequestParams
2543
+ class AddInvoiceItem < Stripe::RequestParams
2544
+ class Discount < Stripe::RequestParams
2545
+ # ID of the coupon to create a new discount for.
2546
+ attr_accessor :coupon
2547
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2548
+ attr_accessor :discount
2549
+ # ID of the promotion code to create a new discount for.
2550
+ attr_accessor :promotion_code
2551
+
2552
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
2553
+ @coupon = coupon
2554
+ @discount = discount
2555
+ @promotion_code = promotion_code
2556
+ end
2557
+ end
2558
+
2559
+ class PriceData < Stripe::RequestParams
2560
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
2561
+ attr_accessor :currency
2562
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
2563
+ attr_accessor :product
2564
+ # Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
2565
+ attr_accessor :tax_behavior
2566
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer.
2567
+ attr_accessor :unit_amount
2568
+ # Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
2569
+ attr_accessor :unit_amount_decimal
2570
+
2571
+ def initialize(
2572
+ currency: nil,
2573
+ product: nil,
2574
+ tax_behavior: nil,
2575
+ unit_amount: nil,
2576
+ unit_amount_decimal: nil
2577
+ )
2578
+ @currency = currency
2579
+ @product = product
2580
+ @tax_behavior = tax_behavior
2581
+ @unit_amount = unit_amount
2582
+ @unit_amount_decimal = unit_amount_decimal
2583
+ end
2584
+ end
2585
+ # The coupons to redeem into discounts for the item.
2586
+ attr_accessor :discounts
2587
+ # The ID of the price object. One of `price` or `price_data` is required.
2588
+ attr_accessor :price
2589
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
2590
+ attr_accessor :price_data
2591
+ # Quantity for this item. Defaults to 1.
2592
+ attr_accessor :quantity
2593
+ # The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
2594
+ attr_accessor :tax_rates
2595
+
2596
+ def initialize(
2597
+ discounts: nil,
2598
+ price: nil,
2599
+ price_data: nil,
2600
+ quantity: nil,
2601
+ tax_rates: nil
2602
+ )
2603
+ @discounts = discounts
2604
+ @price = price
2605
+ @price_data = price_data
2606
+ @quantity = quantity
2607
+ @tax_rates = tax_rates
2608
+ end
2609
+ end
2610
+
2611
+ class AutomaticTax < Stripe::RequestParams
2612
+ class Liability < Stripe::RequestParams
2613
+ # The connected account being referenced when `type` is `account`.
2614
+ attr_accessor :account
2615
+ # Type of the account referenced in the request.
2616
+ attr_accessor :type
2617
+
2618
+ def initialize(account: nil, type: nil)
2619
+ @account = account
2620
+ @type = type
2621
+ end
2622
+ end
2623
+ # Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
2624
+ attr_accessor :enabled
2625
+ # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
2626
+ attr_accessor :liability
2627
+
2628
+ def initialize(enabled: nil, liability: nil)
2629
+ @enabled = enabled
2630
+ @liability = liability
2631
+ end
2632
+ end
2633
+
2634
+ class Discount < Stripe::RequestParams
2635
+ # ID of the coupon to create a new discount for.
2636
+ attr_accessor :coupon
2637
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2638
+ attr_accessor :discount
2639
+ # ID of the promotion code to create a new discount for.
2640
+ attr_accessor :promotion_code
2641
+
2642
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
2643
+ @coupon = coupon
2644
+ @discount = discount
2645
+ @promotion_code = promotion_code
2646
+ end
2647
+ end
2648
+
2649
+ class InvoiceSettings < Stripe::RequestParams
2650
+ class Issuer < Stripe::RequestParams
2651
+ # The connected account being referenced when `type` is `account`.
2652
+ attr_accessor :account
2653
+ # Type of the account referenced in the request.
2654
+ attr_accessor :type
2655
+
2656
+ def initialize(account: nil, type: nil)
2657
+ @account = account
2658
+ @type = type
2659
+ end
2660
+ end
2661
+ # The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule.
2662
+ attr_accessor :account_tax_ids
2663
+ # Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`.
2664
+ attr_accessor :days_until_due
2665
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
2666
+ attr_accessor :issuer
2667
+
2668
+ def initialize(account_tax_ids: nil, days_until_due: nil, issuer: nil)
2669
+ @account_tax_ids = account_tax_ids
2670
+ @days_until_due = days_until_due
2671
+ @issuer = issuer
2672
+ end
2673
+ end
2674
+
2675
+ class Item < Stripe::RequestParams
2676
+ class Discount < Stripe::RequestParams
2677
+ # ID of the coupon to create a new discount for.
2678
+ attr_accessor :coupon
2679
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2680
+ attr_accessor :discount
2681
+ # ID of the promotion code to create a new discount for.
2682
+ attr_accessor :promotion_code
2683
+
2684
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
2685
+ @coupon = coupon
2686
+ @discount = discount
2687
+ @promotion_code = promotion_code
2688
+ end
2689
+ end
2690
+
2691
+ class PriceData < Stripe::RequestParams
2692
+ class Recurring < Stripe::RequestParams
2693
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
2694
+ attr_accessor :interval
2695
+ # The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
2696
+ attr_accessor :interval_count
2697
+
2698
+ def initialize(interval: nil, interval_count: nil)
2699
+ @interval = interval
2700
+ @interval_count = interval_count
2701
+ end
2702
+ end
2703
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
2704
+ attr_accessor :currency
2705
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
2706
+ attr_accessor :product
2707
+ # The recurring components of a price such as `interval` and `interval_count`.
2708
+ attr_accessor :recurring
2709
+ # Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
2710
+ attr_accessor :tax_behavior
2711
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
2712
+ attr_accessor :unit_amount
2713
+ # Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
2714
+ attr_accessor :unit_amount_decimal
2715
+
2716
+ def initialize(
2717
+ currency: nil,
2718
+ product: nil,
2719
+ recurring: nil,
2720
+ tax_behavior: nil,
2721
+ unit_amount: nil,
2722
+ unit_amount_decimal: nil
2723
+ )
2724
+ @currency = currency
2725
+ @product = product
2726
+ @recurring = recurring
2727
+ @tax_behavior = tax_behavior
2728
+ @unit_amount = unit_amount
2729
+ @unit_amount_decimal = unit_amount_decimal
2730
+ end
2731
+ end
2732
+ # The coupons to redeem into discounts for the subscription item.
2733
+ attr_accessor :discounts
2734
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`.
2735
+ attr_accessor :metadata
2736
+ # The plan ID to subscribe to. You may specify the same ID in `plan` and `price`.
2737
+ attr_accessor :plan
2738
+ # The ID of the price object.
2739
+ attr_accessor :price
2740
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
2741
+ attr_accessor :price_data
2742
+ # Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`.
2743
+ attr_accessor :quantity
2744
+ # A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
2745
+ attr_accessor :tax_rates
2746
+
2747
+ def initialize(
2748
+ discounts: nil,
2749
+ metadata: nil,
2750
+ plan: nil,
2751
+ price: nil,
2752
+ price_data: nil,
2753
+ quantity: nil,
2754
+ tax_rates: nil
2755
+ )
2756
+ @discounts = discounts
2757
+ @metadata = metadata
2758
+ @plan = plan
2759
+ @price = price
2760
+ @price_data = price_data
2761
+ @quantity = quantity
2762
+ @tax_rates = tax_rates
2763
+ end
2764
+ end
2765
+
2766
+ class TransferData < Stripe::RequestParams
2767
+ # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination.
2768
+ attr_accessor :amount_percent
2769
+ # ID of an existing, connected Stripe account.
2770
+ attr_accessor :destination
2771
+
2772
+ def initialize(amount_percent: nil, destination: nil)
2773
+ @amount_percent = amount_percent
2774
+ @destination = destination
2775
+ end
2776
+ end
2777
+ # A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items.
2778
+ attr_accessor :add_invoice_items
2779
+ # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).
2780
+ attr_accessor :application_fee_percent
2781
+ # Automatic tax settings for this phase.
2782
+ attr_accessor :automatic_tax
2783
+ # Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
2784
+ attr_accessor :billing_cycle_anchor
2785
+ # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation.
2786
+ attr_accessor :collection_method
2787
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
2788
+ attr_accessor :currency
2789
+ # ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings.
2790
+ attr_accessor :default_payment_method
2791
+ # A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase.
2792
+ attr_accessor :default_tax_rates
2793
+ # Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
2794
+ attr_accessor :description
2795
+ # The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts.
2796
+ attr_accessor :discounts
2797
+ # The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set.
2798
+ attr_accessor :end_date
2799
+ # All invoices will be billed using the specified settings.
2800
+ attr_accessor :invoice_settings
2801
+ # List of configuration items, each with an attached price, to apply during this phase of the subscription schedule.
2802
+ attr_accessor :items
2803
+ # Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set.
2804
+ attr_accessor :iterations
2805
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`.
2806
+ attr_accessor :metadata
2807
+ # The account on behalf of which to charge, for each of the associated subscription's invoices.
2808
+ attr_accessor :on_behalf_of
2809
+ # Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase.
2810
+ attr_accessor :proration_behavior
2811
+ # The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
2812
+ attr_accessor :start_date
2813
+ # The data with which to automatically create a Transfer for each of the associated subscription's invoices.
2814
+ attr_accessor :transfer_data
2815
+ # If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
2816
+ attr_accessor :trial
2817
+ # Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial`
2818
+ attr_accessor :trial_end
2819
+
2820
+ def initialize(
2821
+ add_invoice_items: nil,
2822
+ application_fee_percent: nil,
2823
+ automatic_tax: nil,
2824
+ billing_cycle_anchor: nil,
2825
+ collection_method: nil,
2826
+ currency: nil,
2827
+ default_payment_method: nil,
2828
+ default_tax_rates: nil,
2829
+ description: nil,
2830
+ discounts: nil,
2831
+ end_date: nil,
2832
+ invoice_settings: nil,
2833
+ items: nil,
2834
+ iterations: nil,
2835
+ metadata: nil,
2836
+ on_behalf_of: nil,
2837
+ proration_behavior: nil,
2838
+ start_date: nil,
2839
+ transfer_data: nil,
2840
+ trial: nil,
2841
+ trial_end: nil
2842
+ )
2843
+ @add_invoice_items = add_invoice_items
2844
+ @application_fee_percent = application_fee_percent
2845
+ @automatic_tax = automatic_tax
2846
+ @billing_cycle_anchor = billing_cycle_anchor
2847
+ @collection_method = collection_method
2848
+ @currency = currency
2849
+ @default_payment_method = default_payment_method
2850
+ @default_tax_rates = default_tax_rates
2851
+ @description = description
2852
+ @discounts = discounts
2853
+ @end_date = end_date
2854
+ @invoice_settings = invoice_settings
2855
+ @items = items
2856
+ @iterations = iterations
2857
+ @metadata = metadata
2858
+ @on_behalf_of = on_behalf_of
2859
+ @proration_behavior = proration_behavior
2860
+ @start_date = start_date
2861
+ @transfer_data = transfer_data
2862
+ @trial = trial
2863
+ @trial_end = trial_end
2864
+ end
2865
+ end
2866
+ # Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.
2867
+ attr_accessor :end_behavior
2868
+ # List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase.
2869
+ attr_accessor :phases
2870
+ # In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request.
2871
+ attr_accessor :proration_behavior
2872
+
2873
+ def initialize(end_behavior: nil, phases: nil, proration_behavior: nil)
2874
+ @end_behavior = end_behavior
2875
+ @phases = phases
2876
+ @proration_behavior = proration_behavior
2877
+ end
2878
+ end
2879
+
2880
+ class SubscriptionDetails < Stripe::RequestParams
2881
+ class Item < Stripe::RequestParams
2882
+ class Discount < Stripe::RequestParams
2883
+ # ID of the coupon to create a new discount for.
2884
+ attr_accessor :coupon
2885
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2886
+ attr_accessor :discount
2887
+ # ID of the promotion code to create a new discount for.
2888
+ attr_accessor :promotion_code
2889
+
2890
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
2891
+ @coupon = coupon
2892
+ @discount = discount
2893
+ @promotion_code = promotion_code
2894
+ end
2895
+ end
2896
+
2897
+ class PriceData < Stripe::RequestParams
2898
+ class Recurring < Stripe::RequestParams
2899
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
2900
+ attr_accessor :interval
2901
+ # The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
2902
+ attr_accessor :interval_count
2903
+
2904
+ def initialize(interval: nil, interval_count: nil)
2905
+ @interval = interval
2906
+ @interval_count = interval_count
2907
+ end
2908
+ end
2909
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
2910
+ attr_accessor :currency
2911
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
2912
+ attr_accessor :product
2913
+ # The recurring components of a price such as `interval` and `interval_count`.
2914
+ attr_accessor :recurring
2915
+ # Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
2916
+ attr_accessor :tax_behavior
2917
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
2918
+ attr_accessor :unit_amount
2919
+ # Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
2920
+ attr_accessor :unit_amount_decimal
2921
+
2922
+ def initialize(
2923
+ currency: nil,
2924
+ product: nil,
2925
+ recurring: nil,
2926
+ tax_behavior: nil,
2927
+ unit_amount: nil,
2928
+ unit_amount_decimal: nil
2929
+ )
2930
+ @currency = currency
2931
+ @product = product
2932
+ @recurring = recurring
2933
+ @tax_behavior = tax_behavior
2934
+ @unit_amount = unit_amount
2935
+ @unit_amount_decimal = unit_amount_decimal
2936
+ end
2937
+ end
2938
+ # Delete all usage for a given subscription item. You must pass this when deleting a usage records subscription item. `clear_usage` has no effect if the plan has a billing meter attached.
2939
+ attr_accessor :clear_usage
2940
+ # A flag that, if set to `true`, will delete the specified item.
2941
+ attr_accessor :deleted
2942
+ # The coupons to redeem into discounts for the subscription item.
2943
+ attr_accessor :discounts
2944
+ # Subscription item to update.
2945
+ attr_accessor :id
2946
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
2947
+ attr_accessor :metadata
2948
+ # Plan ID for this item, as a string.
2949
+ attr_accessor :plan
2950
+ # The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided.
2951
+ attr_accessor :price
2952
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
2953
+ attr_accessor :price_data
2954
+ # Quantity for this item.
2955
+ attr_accessor :quantity
2956
+ # A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
2957
+ attr_accessor :tax_rates
2958
+
2959
+ def initialize(
2960
+ clear_usage: nil,
2961
+ deleted: nil,
2962
+ discounts: nil,
2963
+ id: nil,
2964
+ metadata: nil,
2965
+ plan: nil,
2966
+ price: nil,
2967
+ price_data: nil,
2968
+ quantity: nil,
2969
+ tax_rates: nil
2970
+ )
2971
+ @clear_usage = clear_usage
2972
+ @deleted = deleted
2973
+ @discounts = discounts
2974
+ @id = id
2975
+ @metadata = metadata
2976
+ @plan = plan
2977
+ @price = price
2978
+ @price_data = price_data
2979
+ @quantity = quantity
2980
+ @tax_rates = tax_rates
2981
+ end
2982
+ end
2983
+ # For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`.
2984
+ attr_accessor :billing_cycle_anchor
2985
+ # A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period.
2986
+ attr_accessor :cancel_at
2987
+ # Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
2988
+ attr_accessor :cancel_at_period_end
2989
+ # This simulates the subscription being canceled or expired immediately.
2990
+ attr_accessor :cancel_now
2991
+ # If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set.
2992
+ attr_accessor :default_tax_rates
2993
+ # A list of up to 20 subscription items, each with an attached price.
2994
+ attr_accessor :items
2995
+ # Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`.
2996
+ attr_accessor :proration_behavior
2997
+ # If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'.
2998
+ attr_accessor :proration_date
2999
+ # For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed.
3000
+ attr_accessor :resume_at
3001
+ # Date a subscription is intended to start (can be future or past).
3002
+ attr_accessor :start_date
3003
+ # If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required.
3004
+ attr_accessor :trial_end
3005
+
3006
+ def initialize(
3007
+ billing_cycle_anchor: nil,
3008
+ cancel_at: nil,
3009
+ cancel_at_period_end: nil,
3010
+ cancel_now: nil,
3011
+ default_tax_rates: nil,
3012
+ items: nil,
3013
+ proration_behavior: nil,
3014
+ proration_date: nil,
3015
+ resume_at: nil,
3016
+ start_date: nil,
3017
+ trial_end: nil
3018
+ )
3019
+ @billing_cycle_anchor = billing_cycle_anchor
3020
+ @cancel_at = cancel_at
3021
+ @cancel_at_period_end = cancel_at_period_end
3022
+ @cancel_now = cancel_now
3023
+ @default_tax_rates = default_tax_rates
3024
+ @items = items
3025
+ @proration_behavior = proration_behavior
3026
+ @proration_date = proration_date
3027
+ @resume_at = resume_at
3028
+ @start_date = start_date
3029
+ @trial_end = trial_end
3030
+ end
3031
+ end
3032
+ # Settings for automatic tax lookup for this invoice preview.
3033
+ attr_accessor :automatic_tax
3034
+ # The currency to preview this invoice in. Defaults to that of `customer` if not specified.
3035
+ attr_accessor :currency
3036
+ # The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.
3037
+ attr_accessor :customer
3038
+ # Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.
3039
+ attr_accessor :customer_details
3040
+ # The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts.
3041
+ attr_accessor :discounts
3042
+ # Specifies which fields in the response should be expanded.
3043
+ attr_accessor :expand
3044
+ # List of invoice items to add or update in the upcoming invoice preview (up to 250).
3045
+ attr_accessor :invoice_items
3046
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
3047
+ attr_accessor :issuer
3048
+ # The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details.
3049
+ attr_accessor :on_behalf_of
3050
+ # Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified.
3051
+ attr_accessor :preview_mode
3052
+ # The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields.
3053
+ attr_accessor :schedule
3054
+ # The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields.
3055
+ attr_accessor :schedule_details
3056
+ # The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions.
3057
+ attr_accessor :subscription
3058
+ # The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields.
3059
+ attr_accessor :subscription_details
3060
+
3061
+ def initialize(
3062
+ automatic_tax: nil,
3063
+ currency: nil,
3064
+ customer: nil,
3065
+ customer_details: nil,
3066
+ discounts: nil,
3067
+ expand: nil,
3068
+ invoice_items: nil,
3069
+ issuer: nil,
3070
+ on_behalf_of: nil,
3071
+ preview_mode: nil,
3072
+ schedule: nil,
3073
+ schedule_details: nil,
3074
+ subscription: nil,
3075
+ subscription_details: nil
3076
+ )
3077
+ @automatic_tax = automatic_tax
3078
+ @currency = currency
3079
+ @customer = customer
3080
+ @customer_details = customer_details
3081
+ @discounts = discounts
3082
+ @expand = expand
3083
+ @invoice_items = invoice_items
3084
+ @issuer = issuer
3085
+ @on_behalf_of = on_behalf_of
3086
+ @preview_mode = preview_mode
3087
+ @schedule = schedule
3088
+ @schedule_details = schedule_details
3089
+ @subscription = subscription
3090
+ @subscription_details = subscription_details
3091
+ end
3092
+ end
3093
+ # The country of the business associated with this invoice, most often the business creating the invoice.
3094
+ attr_reader :account_country
3095
+ # The public name of the business associated with this invoice, most often the business creating the invoice.
3096
+ attr_reader :account_name
3097
+ # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
3098
+ attr_reader :account_tax_ids
3099
+ # Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. The charge that gets generated for the invoice will be for the amount specified in `amount_due`.
3100
+ attr_reader :amount_due
3101
+ # Amount that was overpaid on the invoice. The amount overpaid is credited to the customer's credit balance.
3102
+ attr_reader :amount_overpaid
3103
+ # The amount, in cents (or local equivalent), that was paid.
3104
+ attr_reader :amount_paid
3105
+ # The difference between amount_due and amount_paid, in cents (or local equivalent).
3106
+ attr_reader :amount_remaining
3107
+ # This is the sum of all the shipping amounts.
3108
+ attr_reader :amount_shipping
3109
+ # ID of the Connect Application that created the invoice.
3110
+ attr_reader :application
3111
+ # Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. If a failure is returned with a non-retryable return code, the invoice can no longer be retried unless a new payment method is obtained. Retries will continue to be scheduled, and attempt_count will continue to increment, but retries will only be executed if a new payment method is obtained.
3112
+ attr_reader :attempt_count
3113
+ # Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the `invoice.created` webhook, for example, so you might not want to display that invoice as unpaid to your users.
3114
+ attr_reader :attempted
3115
+ # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action.
3116
+ attr_reader :auto_advance
3117
+ # Attribute for field automatic_tax
3118
+ attr_reader :automatic_tax
3119
+ # The time when this invoice is currently scheduled to be automatically finalized. The field will be `null` if the invoice is not scheduled to finalize in the future. If the invoice is not in the draft state, this field will always be `null` - see `finalized_at` for the time when an already-finalized invoice was finalized.
3120
+ attr_reader :automatically_finalizes_at
3121
+ # Indicates the reason why the invoice was created.
3122
+ #
3123
+ # * `manual`: Unrelated to a subscription, for example, created via the invoice editor.
3124
+ # * `subscription`: No longer in use. Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds.
3125
+ # * `subscription_create`: A new subscription was created.
3126
+ # * `subscription_cycle`: A subscription advanced into a new period.
3127
+ # * `subscription_threshold`: A subscription reached a billing threshold.
3128
+ # * `subscription_update`: A subscription was updated.
3129
+ # * `upcoming`: Reserved for simulated invoices, per the upcoming invoice endpoint.
3130
+ attr_reader :billing_reason
3131
+ # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions.
3132
+ attr_reader :collection_method
3133
+ # The confirmation secret associated with this invoice. Currently, this contains the client_secret of the PaymentIntent that Stripe creates during invoice finalization.
3134
+ attr_reader :confirmation_secret
3135
+ # Time at which the object was created. Measured in seconds since the Unix epoch.
3136
+ attr_reader :created
3137
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
3138
+ attr_reader :currency
3139
+ # Custom fields displayed on the invoice.
3140
+ attr_reader :custom_fields
3141
+ # The ID of the customer who will be billed.
3142
+ attr_reader :customer
3143
+ # The customer's address. Until the invoice is finalized, this field will equal `customer.address`. Once the invoice is finalized, this field will no longer be updated.
3144
+ attr_reader :customer_address
3145
+ # The customer's email. Until the invoice is finalized, this field will equal `customer.email`. Once the invoice is finalized, this field will no longer be updated.
3146
+ attr_reader :customer_email
3147
+ # The customer's name. Until the invoice is finalized, this field will equal `customer.name`. Once the invoice is finalized, this field will no longer be updated.
3148
+ attr_reader :customer_name
3149
+ # The customer's phone number. Until the invoice is finalized, this field will equal `customer.phone`. Once the invoice is finalized, this field will no longer be updated.
3150
+ attr_reader :customer_phone
3151
+ # The customer's shipping information. Until the invoice is finalized, this field will equal `customer.shipping`. Once the invoice is finalized, this field will no longer be updated.
3152
+ attr_reader :customer_shipping
3153
+ # The customer's tax exempt status. Until the invoice is finalized, this field will equal `customer.tax_exempt`. Once the invoice is finalized, this field will no longer be updated.
3154
+ attr_reader :customer_tax_exempt
3155
+ # The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as `customer.tax_ids`. Once the invoice is finalized, this field will no longer be updated.
3156
+ attr_reader :customer_tax_ids
3157
+ # ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
3158
+ attr_reader :default_payment_method
3159
+ # ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
3160
+ attr_reader :default_source
3161
+ # The tax rates applied to this invoice, if any.
3162
+ attr_reader :default_tax_rates
3163
+ # An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
3164
+ attr_reader :description
3165
+ # The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount.
3166
+ attr_reader :discounts
3167
+ # The date on which payment for this invoice is due. This value will be `null` for invoices where `collection_method=charge_automatically`.
3168
+ attr_reader :due_date
3169
+ # The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt.
3170
+ attr_reader :effective_at
3171
+ # Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null.
3172
+ attr_reader :ending_balance
3173
+ # Footer displayed on the invoice.
3174
+ attr_reader :footer
3175
+ # Details of the invoice that was cloned. See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details.
3176
+ attr_reader :from_invoice
3177
+ # The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null.
3178
+ attr_reader :hosted_invoice_url
3179
+ # Unique identifier for the object. This property is always present unless the invoice is an upcoming invoice. See [Retrieve an upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) for more details.
3180
+ attr_reader :id
3181
+ # The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null.
3182
+ attr_reader :invoice_pdf
3183
+ # Attribute for field issuer
3184
+ attr_reader :issuer
3185
+ # The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized.
3186
+ attr_reader :last_finalization_error
3187
+ # The ID of the most recent non-draft revision of this invoice
3188
+ attr_reader :latest_revision
3189
+ # The individual line items that make up the invoice. `lines` is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order.
3190
+ attr_reader :lines
3191
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
3192
+ attr_reader :livemode
3193
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
3194
+ attr_reader :metadata
3195
+ # The time at which payment will next be attempted. This value will be `null` for invoices where `collection_method=send_invoice`.
3196
+ attr_reader :next_payment_attempt
3197
+ # A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified.
3198
+ attr_reader :number
3199
+ # String representing the object's type. Objects of the same type share the same value.
3200
+ attr_reader :object
3201
+ # The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details.
3202
+ attr_reader :on_behalf_of
3203
+ # The parent that generated this invoice
3204
+ attr_reader :parent
3205
+ # Attribute for field payment_settings
3206
+ attr_reader :payment_settings
3207
+ # Payments for this invoice
3208
+ attr_reader :payments
3209
+ # End of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price.
3210
+ attr_reader :period_end
3211
+ # Start of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price.
3212
+ attr_reader :period_start
3213
+ # Total amount of all post-payment credit notes issued for this invoice.
3214
+ attr_reader :post_payment_credit_notes_amount
3215
+ # Total amount of all pre-payment credit notes issued for this invoice.
3216
+ attr_reader :pre_payment_credit_notes_amount
3217
+ # This is the transaction number that appears on email receipts sent for this invoice.
3218
+ attr_reader :receipt_number
3219
+ # The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.
3220
+ attr_reader :rendering
3221
+ # The details of the cost of shipping, including the ShippingRate applied on the invoice.
3222
+ attr_reader :shipping_cost
3223
+ # Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer.
3224
+ attr_reader :shipping_details
3225
+ # Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. For revision invoices, this also includes any customer balance that was applied to the original invoice.
3226
+ attr_reader :starting_balance
3227
+ # Extra information about an invoice for the customer's credit card statement.
3228
+ attr_reader :statement_descriptor
3229
+ # The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview)
3230
+ attr_reader :status
3231
+ # Attribute for field status_transitions
3232
+ attr_reader :status_transitions
3233
+ # Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated
3234
+ attr_reader :subtotal
3235
+ # The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated
3236
+ attr_reader :subtotal_excluding_tax
3237
+ # ID of the test clock this invoice belongs to.
3238
+ attr_reader :test_clock
3239
+ # Attribute for field threshold_reason
3240
+ attr_reader :threshold_reason
3241
+ # Total after discounts and taxes.
3242
+ attr_reader :total
3243
+ # The aggregate amounts calculated per discount across all line items.
3244
+ attr_reader :total_discount_amounts
3245
+ # The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax.
3246
+ attr_reader :total_excluding_tax
3247
+ # Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice. This is a combined list of total_pretax_credit_amounts across all invoice line items.
3248
+ attr_reader :total_pretax_credit_amounts
3249
+ # The aggregate tax information of all line items.
3250
+ attr_reader :total_taxes
3251
+ # Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have [been exhausted](https://stripe.com/docs/billing/webhooks#understand). This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created.
3252
+ attr_reader :webhooks_delivered_at
3253
+ # Always true for a deleted object
3254
+ attr_reader :deleted
3255
+
52
3256
  # Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.
53
3257
  def add_lines(params = {}, opts = {})
54
3258
  request_stripe_object(
@@ -91,10 +3295,10 @@ module Stripe
91
3295
  end
92
3296
 
93
3297
  # Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice).
94
- def self.delete(id, params = {}, opts = {})
3298
+ def self.delete(invoice, params = {}, opts = {})
95
3299
  request_stripe_object(
96
3300
  method: :delete,
97
- path: format("/v1/invoices/%<id>s", { id: CGI.escape(id) }),
3301
+ path: format("/v1/invoices/%<invoice>s", { invoice: CGI.escape(invoice) }),
98
3302
  params: params,
99
3303
  opts: opts
100
3304
  )
@@ -131,18 +3335,8 @@ module Stripe
131
3335
  end
132
3336
 
133
3337
  # You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first.
134
- def self.list(filters = {}, opts = {})
135
- request_stripe_object(method: :get, path: "/v1/invoices", params: filters, opts: opts)
136
- end
137
-
138
- # When retrieving an upcoming invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
139
- def self.list_upcoming_line_items(params = {}, opts = {})
140
- request_stripe_object(
141
- method: :get,
142
- path: "/v1/invoices/upcoming/lines",
143
- params: params,
144
- opts: opts
145
- )
3338
+ def self.list(params = {}, opts = {})
3339
+ request_stripe_object(method: :get, path: "/v1/invoices", params: params, opts: opts)
146
3340
  end
147
3341
 
148
3342
  # Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.
@@ -237,27 +3431,16 @@ module Stripe
237
3431
  )
238
3432
  end
239
3433
 
240
- # At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.
241
- #
242
- # Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount.
243
- #
244
- # You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.
245
- #
246
- # Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions)
247
- def self.upcoming(params = {}, opts = {})
248
- request_stripe_object(method: :get, path: "/v1/invoices/upcoming", params: params, opts: opts)
249
- end
250
-
251
3434
  # Draft invoices are fully editable. Once an invoice is [finalized](https://stripe.com/docs/billing/invoices/workflow#finalized),
252
3435
  # monetary values, as well as collection_method, become uneditable.
253
3436
  #
254
3437
  # If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on,
255
3438
  # sending reminders for, or [automatically reconciling](https://stripe.com/docs/billing/invoices/reconciliation) invoices, pass
256
3439
  # auto_advance=false.
257
- def self.update(id, params = {}, opts = {})
3440
+ def self.update(invoice, params = {}, opts = {})
258
3441
  request_stripe_object(
259
3442
  method: :post,
260
- path: format("/v1/invoices/%<id>s", { id: CGI.escape(id) }),
3443
+ path: format("/v1/invoices/%<invoice>s", { invoice: CGI.escape(invoice) }),
261
3444
  params: params,
262
3445
  opts: opts
263
3446
  )