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
@@ -0,0 +1,1333 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ class PaymentLinkService < StripeService
6
+ attr_reader :line_items
7
+
8
+ def initialize(requestor)
9
+ super(requestor)
10
+ @line_items = Stripe::PaymentLinkLineItemService.new(@requestor)
11
+ end
12
+
13
+ class ListParams < Stripe::RequestParams
14
+ # Only return payment links that are active or inactive (e.g., pass `false` to list all inactive payment links).
15
+ attr_accessor :active
16
+ # 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.
17
+ attr_accessor :ending_before
18
+ # Specifies which fields in the response should be expanded.
19
+ attr_accessor :expand
20
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
21
+ attr_accessor :limit
22
+ # 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.
23
+ attr_accessor :starting_after
24
+
25
+ def initialize(active: nil, ending_before: nil, expand: nil, limit: nil, starting_after: nil)
26
+ @active = active
27
+ @ending_before = ending_before
28
+ @expand = expand
29
+ @limit = limit
30
+ @starting_after = starting_after
31
+ end
32
+ end
33
+
34
+ class CreateParams < Stripe::RequestParams
35
+ class AfterCompletion < Stripe::RequestParams
36
+ class HostedConfirmation < Stripe::RequestParams
37
+ # A custom message to display to the customer after the purchase is complete.
38
+ attr_accessor :custom_message
39
+
40
+ def initialize(custom_message: nil)
41
+ @custom_message = custom_message
42
+ end
43
+ end
44
+
45
+ class Redirect < Stripe::RequestParams
46
+ # The URL the customer will be redirected to after the purchase is complete. You can embed `{CHECKOUT_SESSION_ID}` into the URL to have the `id` of the completed [checkout session](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-id) included.
47
+ attr_accessor :url
48
+
49
+ def initialize(url: nil)
50
+ @url = url
51
+ end
52
+ end
53
+ # Configuration when `type=hosted_confirmation`.
54
+ attr_accessor :hosted_confirmation
55
+ # Configuration when `type=redirect`.
56
+ attr_accessor :redirect
57
+ # The specified behavior after the purchase is complete. Either `redirect` or `hosted_confirmation`.
58
+ attr_accessor :type
59
+
60
+ def initialize(hosted_confirmation: nil, redirect: nil, type: nil)
61
+ @hosted_confirmation = hosted_confirmation
62
+ @redirect = redirect
63
+ @type = type
64
+ end
65
+ end
66
+
67
+ class AutomaticTax < Stripe::RequestParams
68
+ class Liability < Stripe::RequestParams
69
+ # The connected account being referenced when `type` is `account`.
70
+ attr_accessor :account
71
+ # Type of the account referenced in the request.
72
+ attr_accessor :type
73
+
74
+ def initialize(account: nil, type: nil)
75
+ @account = account
76
+ @type = type
77
+ end
78
+ end
79
+ # Set to `true` to [calculate tax automatically](https://docs.stripe.com/tax) using the customer's location.
80
+ #
81
+ # Enabling this parameter causes the payment link to collect any billing address information necessary for tax calculation.
82
+ attr_accessor :enabled
83
+ # 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.
84
+ attr_accessor :liability
85
+
86
+ def initialize(enabled: nil, liability: nil)
87
+ @enabled = enabled
88
+ @liability = liability
89
+ end
90
+ end
91
+
92
+ class ConsentCollection < Stripe::RequestParams
93
+ class PaymentMethodReuseAgreement < Stripe::RequestParams
94
+ # Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's
95
+ # defaults will be used. When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI.
96
+ attr_accessor :position
97
+
98
+ def initialize(position: nil)
99
+ @position = position
100
+ end
101
+ end
102
+ # Determines the display of payment method reuse agreement text in the UI. If set to `hidden`, it will hide legal text related to the reuse of a payment method.
103
+ attr_accessor :payment_method_reuse_agreement
104
+ # If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout
105
+ # Session will determine whether to display an option to opt into promotional communication
106
+ # from the merchant depending on the customer's locale. Only available to US merchants.
107
+ attr_accessor :promotions
108
+ # If set to `required`, it requires customers to check a terms of service checkbox before being able to pay.
109
+ # There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public).
110
+ attr_accessor :terms_of_service
111
+
112
+ def initialize(payment_method_reuse_agreement: nil, promotions: nil, terms_of_service: nil)
113
+ @payment_method_reuse_agreement = payment_method_reuse_agreement
114
+ @promotions = promotions
115
+ @terms_of_service = terms_of_service
116
+ end
117
+ end
118
+
119
+ class CustomField < Stripe::RequestParams
120
+ class Dropdown < Stripe::RequestParams
121
+ class Option < Stripe::RequestParams
122
+ # The label for the option, displayed to the customer. Up to 100 characters.
123
+ attr_accessor :label
124
+ # The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. Must be unique to this option, alphanumeric, and up to 100 characters.
125
+ attr_accessor :value
126
+
127
+ def initialize(label: nil, value: nil)
128
+ @label = label
129
+ @value = value
130
+ end
131
+ end
132
+ # The value that will pre-fill the field on the payment page.Must match a `value` in the `options` array.
133
+ attr_accessor :default_value
134
+ # The options available for the customer to select. Up to 200 options allowed.
135
+ attr_accessor :options
136
+
137
+ def initialize(default_value: nil, options: nil)
138
+ @default_value = default_value
139
+ @options = options
140
+ end
141
+ end
142
+
143
+ class Label < Stripe::RequestParams
144
+ # Custom text for the label, displayed to the customer. Up to 50 characters.
145
+ attr_accessor :custom
146
+ # The type of the label.
147
+ attr_accessor :type
148
+
149
+ def initialize(custom: nil, type: nil)
150
+ @custom = custom
151
+ @type = type
152
+ end
153
+ end
154
+
155
+ class Numeric < Stripe::RequestParams
156
+ # The value that will pre-fill the field on the payment page.
157
+ attr_accessor :default_value
158
+ # The maximum character length constraint for the customer's input.
159
+ attr_accessor :maximum_length
160
+ # The minimum character length requirement for the customer's input.
161
+ attr_accessor :minimum_length
162
+
163
+ def initialize(default_value: nil, maximum_length: nil, minimum_length: nil)
164
+ @default_value = default_value
165
+ @maximum_length = maximum_length
166
+ @minimum_length = minimum_length
167
+ end
168
+ end
169
+
170
+ class Text < Stripe::RequestParams
171
+ # The value that will pre-fill the field on the payment page.
172
+ attr_accessor :default_value
173
+ # The maximum character length constraint for the customer's input.
174
+ attr_accessor :maximum_length
175
+ # The minimum character length requirement for the customer's input.
176
+ attr_accessor :minimum_length
177
+
178
+ def initialize(default_value: nil, maximum_length: nil, minimum_length: nil)
179
+ @default_value = default_value
180
+ @maximum_length = maximum_length
181
+ @minimum_length = minimum_length
182
+ end
183
+ end
184
+ # Configuration for `type=dropdown` fields.
185
+ attr_accessor :dropdown
186
+ # String of your choice that your integration can use to reconcile this field. Must be unique to this field, alphanumeric, and up to 200 characters.
187
+ attr_accessor :key
188
+ # The label for the field, displayed to the customer.
189
+ attr_accessor :label
190
+ # Configuration for `type=numeric` fields.
191
+ attr_accessor :numeric
192
+ # Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`.
193
+ attr_accessor :optional
194
+ # Configuration for `type=text` fields.
195
+ attr_accessor :text
196
+ # The type of the field.
197
+ attr_accessor :type
198
+
199
+ def initialize(
200
+ dropdown: nil,
201
+ key: nil,
202
+ label: nil,
203
+ numeric: nil,
204
+ optional: nil,
205
+ text: nil,
206
+ type: nil
207
+ )
208
+ @dropdown = dropdown
209
+ @key = key
210
+ @label = label
211
+ @numeric = numeric
212
+ @optional = optional
213
+ @text = text
214
+ @type = type
215
+ end
216
+ end
217
+
218
+ class CustomText < Stripe::RequestParams
219
+ class AfterSubmit < Stripe::RequestParams
220
+ # Text may be up to 1200 characters in length.
221
+ attr_accessor :message
222
+
223
+ def initialize(message: nil)
224
+ @message = message
225
+ end
226
+ end
227
+
228
+ class ShippingAddress < Stripe::RequestParams
229
+ # Text may be up to 1200 characters in length.
230
+ attr_accessor :message
231
+
232
+ def initialize(message: nil)
233
+ @message = message
234
+ end
235
+ end
236
+
237
+ class Submit < Stripe::RequestParams
238
+ # Text may be up to 1200 characters in length.
239
+ attr_accessor :message
240
+
241
+ def initialize(message: nil)
242
+ @message = message
243
+ end
244
+ end
245
+
246
+ class TermsOfServiceAcceptance < Stripe::RequestParams
247
+ # Text may be up to 1200 characters in length.
248
+ attr_accessor :message
249
+
250
+ def initialize(message: nil)
251
+ @message = message
252
+ end
253
+ end
254
+ # Custom text that should be displayed after the payment confirmation button.
255
+ attr_accessor :after_submit
256
+ # Custom text that should be displayed alongside shipping address collection.
257
+ attr_accessor :shipping_address
258
+ # Custom text that should be displayed alongside the payment confirmation button.
259
+ attr_accessor :submit
260
+ # Custom text that should be displayed in place of the default terms of service agreement text.
261
+ attr_accessor :terms_of_service_acceptance
262
+
263
+ def initialize(
264
+ after_submit: nil,
265
+ shipping_address: nil,
266
+ submit: nil,
267
+ terms_of_service_acceptance: nil
268
+ )
269
+ @after_submit = after_submit
270
+ @shipping_address = shipping_address
271
+ @submit = submit
272
+ @terms_of_service_acceptance = terms_of_service_acceptance
273
+ end
274
+ end
275
+
276
+ class InvoiceCreation < Stripe::RequestParams
277
+ class InvoiceData < Stripe::RequestParams
278
+ class CustomField < Stripe::RequestParams
279
+ # The name of the custom field. This may be up to 40 characters.
280
+ attr_accessor :name
281
+ # The value of the custom field. This may be up to 140 characters.
282
+ attr_accessor :value
283
+
284
+ def initialize(name: nil, value: nil)
285
+ @name = name
286
+ @value = value
287
+ end
288
+ end
289
+
290
+ class Issuer < Stripe::RequestParams
291
+ # The connected account being referenced when `type` is `account`.
292
+ attr_accessor :account
293
+ # Type of the account referenced in the request.
294
+ attr_accessor :type
295
+
296
+ def initialize(account: nil, type: nil)
297
+ @account = account
298
+ @type = type
299
+ end
300
+ end
301
+
302
+ class RenderingOptions < Stripe::RequestParams
303
+ # 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.
304
+ attr_accessor :amount_tax_display
305
+
306
+ def initialize(amount_tax_display: nil)
307
+ @amount_tax_display = amount_tax_display
308
+ end
309
+ end
310
+ # The account tax IDs associated with the invoice.
311
+ attr_accessor :account_tax_ids
312
+ # Default custom fields to be displayed on invoices for this customer.
313
+ attr_accessor :custom_fields
314
+ # An arbitrary string attached to the object. Often useful for displaying to users.
315
+ attr_accessor :description
316
+ # Default footer to be displayed on invoices for this customer.
317
+ attr_accessor :footer
318
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
319
+ attr_accessor :issuer
320
+ # 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`.
321
+ attr_accessor :metadata
322
+ # Default options for invoice PDF rendering for this customer.
323
+ attr_accessor :rendering_options
324
+
325
+ def initialize(
326
+ account_tax_ids: nil,
327
+ custom_fields: nil,
328
+ description: nil,
329
+ footer: nil,
330
+ issuer: nil,
331
+ metadata: nil,
332
+ rendering_options: nil
333
+ )
334
+ @account_tax_ids = account_tax_ids
335
+ @custom_fields = custom_fields
336
+ @description = description
337
+ @footer = footer
338
+ @issuer = issuer
339
+ @metadata = metadata
340
+ @rendering_options = rendering_options
341
+ end
342
+ end
343
+ # Whether the feature is enabled
344
+ attr_accessor :enabled
345
+ # Invoice PDF configuration.
346
+ attr_accessor :invoice_data
347
+
348
+ def initialize(enabled: nil, invoice_data: nil)
349
+ @enabled = enabled
350
+ @invoice_data = invoice_data
351
+ end
352
+ end
353
+
354
+ class LineItem < Stripe::RequestParams
355
+ class AdjustableQuantity < Stripe::RequestParams
356
+ # Set to true if the quantity can be adjusted to any non-negative Integer.
357
+ attr_accessor :enabled
358
+ # The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999.
359
+ attr_accessor :maximum
360
+ # The minimum quantity the customer can purchase. By default this value is 0. If there is only one item in the cart then that item's quantity cannot go down to 0.
361
+ attr_accessor :minimum
362
+
363
+ def initialize(enabled: nil, maximum: nil, minimum: nil)
364
+ @enabled = enabled
365
+ @maximum = maximum
366
+ @minimum = minimum
367
+ end
368
+ end
369
+ # When set, provides configuration for this item’s quantity to be adjusted by the customer during checkout.
370
+ attr_accessor :adjustable_quantity
371
+ # The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object.
372
+ attr_accessor :price
373
+ # The quantity of the line item being purchased.
374
+ attr_accessor :quantity
375
+
376
+ def initialize(adjustable_quantity: nil, price: nil, quantity: nil)
377
+ @adjustable_quantity = adjustable_quantity
378
+ @price = price
379
+ @quantity = quantity
380
+ end
381
+ end
382
+
383
+ class OptionalItem < Stripe::RequestParams
384
+ class AdjustableQuantity < Stripe::RequestParams
385
+ # Set to true if the quantity can be adjusted to any non-negative integer.
386
+ attr_accessor :enabled
387
+ # The maximum quantity of this item the customer can purchase. By default this value is 99.
388
+ attr_accessor :maximum
389
+ # The minimum quantity of this item the customer must purchase, if they choose to purchase it. Because this item is optional, the customer will always be able to remove it from their order, even if the `minimum` configured here is greater than 0. By default this value is 0.
390
+ attr_accessor :minimum
391
+
392
+ def initialize(enabled: nil, maximum: nil, minimum: nil)
393
+ @enabled = enabled
394
+ @maximum = maximum
395
+ @minimum = minimum
396
+ end
397
+ end
398
+ # When set, provides configuration for the customer to adjust the quantity of the line item created when a customer chooses to add this optional item to their order.
399
+ attr_accessor :adjustable_quantity
400
+ # The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object.
401
+ attr_accessor :price
402
+ # The initial quantity of the line item created when a customer chooses to add this optional item to their order.
403
+ attr_accessor :quantity
404
+
405
+ def initialize(adjustable_quantity: nil, price: nil, quantity: nil)
406
+ @adjustable_quantity = adjustable_quantity
407
+ @price = price
408
+ @quantity = quantity
409
+ end
410
+ end
411
+
412
+ class PaymentIntentData < Stripe::RequestParams
413
+ # Controls when the funds will be captured from the customer's account.
414
+ attr_accessor :capture_method
415
+ # An arbitrary string attached to the object. Often useful for displaying to users.
416
+ attr_accessor :description
417
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Payment Intents](https://stripe.com/docs/api/payment_intents) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
418
+ attr_accessor :metadata
419
+ # Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session.
420
+ #
421
+ # When setting this to `on_session`, Checkout will show a notice to the customer that their payment details will be saved.
422
+ #
423
+ # When setting this to `off_session`, Checkout will show a notice to the customer that their payment details will be saved and used for future payments.
424
+ #
425
+ # If a Customer has been provided or Checkout creates a new Customer,Checkout will attach the payment method to the Customer.
426
+ #
427
+ # If Checkout does not create a Customer, the payment method is not attached to a Customer. To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent.
428
+ #
429
+ # When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA.
430
+ attr_accessor :setup_future_usage
431
+ # Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).
432
+ #
433
+ # Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead.
434
+ attr_accessor :statement_descriptor
435
+ # Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement.
436
+ attr_accessor :statement_descriptor_suffix
437
+ # A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details.
438
+ attr_accessor :transfer_group
439
+
440
+ def initialize(
441
+ capture_method: nil,
442
+ description: nil,
443
+ metadata: nil,
444
+ setup_future_usage: nil,
445
+ statement_descriptor: nil,
446
+ statement_descriptor_suffix: nil,
447
+ transfer_group: nil
448
+ )
449
+ @capture_method = capture_method
450
+ @description = description
451
+ @metadata = metadata
452
+ @setup_future_usage = setup_future_usage
453
+ @statement_descriptor = statement_descriptor
454
+ @statement_descriptor_suffix = statement_descriptor_suffix
455
+ @transfer_group = transfer_group
456
+ end
457
+ end
458
+
459
+ class PhoneNumberCollection < Stripe::RequestParams
460
+ # Set to `true` to enable phone number collection.
461
+ attr_accessor :enabled
462
+
463
+ def initialize(enabled: nil)
464
+ @enabled = enabled
465
+ end
466
+ end
467
+
468
+ class Restrictions < Stripe::RequestParams
469
+ class CompletedSessions < Stripe::RequestParams
470
+ # The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met.
471
+ attr_accessor :limit
472
+
473
+ def initialize(limit: nil)
474
+ @limit = limit
475
+ end
476
+ end
477
+ # Configuration for the `completed_sessions` restriction type.
478
+ attr_accessor :completed_sessions
479
+
480
+ def initialize(completed_sessions: nil)
481
+ @completed_sessions = completed_sessions
482
+ end
483
+ end
484
+
485
+ class ShippingAddressCollection < Stripe::RequestParams
486
+ # An array of two-letter ISO country codes representing which countries Checkout should provide as options for
487
+ # shipping locations.
488
+ attr_accessor :allowed_countries
489
+
490
+ def initialize(allowed_countries: nil)
491
+ @allowed_countries = allowed_countries
492
+ end
493
+ end
494
+
495
+ class ShippingOption < Stripe::RequestParams
496
+ # The ID of the Shipping Rate to use for this shipping option.
497
+ attr_accessor :shipping_rate
498
+
499
+ def initialize(shipping_rate: nil)
500
+ @shipping_rate = shipping_rate
501
+ end
502
+ end
503
+
504
+ class SubscriptionData < Stripe::RequestParams
505
+ class InvoiceSettings < Stripe::RequestParams
506
+ class Issuer < Stripe::RequestParams
507
+ # The connected account being referenced when `type` is `account`.
508
+ attr_accessor :account
509
+ # Type of the account referenced in the request.
510
+ attr_accessor :type
511
+
512
+ def initialize(account: nil, type: nil)
513
+ @account = account
514
+ @type = type
515
+ end
516
+ end
517
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
518
+ attr_accessor :issuer
519
+
520
+ def initialize(issuer: nil)
521
+ @issuer = issuer
522
+ end
523
+ end
524
+
525
+ class TrialSettings < Stripe::RequestParams
526
+ class EndBehavior < Stripe::RequestParams
527
+ # Indicates how the subscription should change when the trial ends if the user did not provide a payment method.
528
+ attr_accessor :missing_payment_method
529
+
530
+ def initialize(missing_payment_method: nil)
531
+ @missing_payment_method = missing_payment_method
532
+ end
533
+ end
534
+ # Defines how the subscription should behave when the user's free trial ends.
535
+ attr_accessor :end_behavior
536
+
537
+ def initialize(end_behavior: nil)
538
+ @end_behavior = end_behavior
539
+ end
540
+ end
541
+ # The subscription's 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.
542
+ attr_accessor :description
543
+ # All invoices will be billed using the specified settings.
544
+ attr_accessor :invoice_settings
545
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
546
+ attr_accessor :metadata
547
+ # Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1.
548
+ attr_accessor :trial_period_days
549
+ # Settings related to subscription trials.
550
+ attr_accessor :trial_settings
551
+
552
+ def initialize(
553
+ description: nil,
554
+ invoice_settings: nil,
555
+ metadata: nil,
556
+ trial_period_days: nil,
557
+ trial_settings: nil
558
+ )
559
+ @description = description
560
+ @invoice_settings = invoice_settings
561
+ @metadata = metadata
562
+ @trial_period_days = trial_period_days
563
+ @trial_settings = trial_settings
564
+ end
565
+ end
566
+
567
+ class TaxIdCollection < Stripe::RequestParams
568
+ # Enable tax ID collection during checkout. Defaults to `false`.
569
+ attr_accessor :enabled
570
+ # Describes whether a tax ID is required during checkout. Defaults to `never`.
571
+ attr_accessor :required
572
+
573
+ def initialize(enabled: nil, required: nil)
574
+ @enabled = enabled
575
+ @required = required
576
+ end
577
+ end
578
+
579
+ class TransferData < Stripe::RequestParams
580
+ # The amount that will be transferred automatically when a charge succeeds.
581
+ attr_accessor :amount
582
+ # If specified, successful charges will be attributed to the destination
583
+ # account for tax reporting, and the funds from charges will be transferred
584
+ # to the destination account. The ID of the resulting transfer will be
585
+ # returned on the successful charge's `transfer` field.
586
+ attr_accessor :destination
587
+
588
+ def initialize(amount: nil, destination: nil)
589
+ @amount = amount
590
+ @destination = destination
591
+ end
592
+ end
593
+ # Behavior after the purchase is complete.
594
+ attr_accessor :after_completion
595
+ # Enables user redeemable promotion codes.
596
+ attr_accessor :allow_promotion_codes
597
+ # The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. Can only be applied when there are no line items with recurring prices.
598
+ attr_accessor :application_fee_amount
599
+ # 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. There must be at least 1 line item with a recurring price to use this field.
600
+ attr_accessor :application_fee_percent
601
+ # Configuration for automatic tax collection.
602
+ attr_accessor :automatic_tax
603
+ # Configuration for collecting the customer's billing address. Defaults to `auto`.
604
+ attr_accessor :billing_address_collection
605
+ # Configure fields to gather active consent from customers.
606
+ attr_accessor :consent_collection
607
+ # 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) and supported by each line item's price.
608
+ attr_accessor :currency
609
+ # Collect additional information from your customer using custom fields. Up to 3 fields are supported.
610
+ attr_accessor :custom_fields
611
+ # Display additional text for your customers using custom text.
612
+ attr_accessor :custom_text
613
+ # Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers).
614
+ attr_accessor :customer_creation
615
+ # Specifies which fields in the response should be expanded.
616
+ attr_accessor :expand
617
+ # The custom message to be displayed to a customer when a payment link is no longer active.
618
+ attr_accessor :inactive_message
619
+ # Generate a post-purchase Invoice for one-time payments.
620
+ attr_accessor :invoice_creation
621
+ # The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported.
622
+ attr_accessor :line_items
623
+ # 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`. Metadata associated with this Payment Link will automatically be copied to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link.
624
+ attr_accessor :metadata
625
+ # The account on behalf of which to charge.
626
+ attr_accessor :on_behalf_of
627
+ # A list of optional items the customer can add to their order at checkout. Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices).
628
+ # There is a maximum of 10 optional items allowed on a payment link, and the existing limits on the number of line items allowed on a payment link apply to the combined number of line items and optional items.
629
+ # There is a maximum of 20 combined line items and optional items.
630
+ attr_accessor :optional_items
631
+ # A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode.
632
+ attr_accessor :payment_intent_data
633
+ # Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount.
634
+ #
635
+ # Can only be set in `subscription` mode. Defaults to `always`.
636
+ #
637
+ # If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials).
638
+ attr_accessor :payment_method_collection
639
+ # The list of payment method types that customers can use. If no value is passed, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods) (20+ payment methods [supported](https://stripe.com/docs/payments/payment-methods/integration-options#payment-method-product-support)).
640
+ attr_accessor :payment_method_types
641
+ # Controls phone number collection settings during checkout.
642
+ #
643
+ # We recommend that you review your privacy policy and check with your legal contacts.
644
+ attr_accessor :phone_number_collection
645
+ # Settings that restrict the usage of a payment link.
646
+ attr_accessor :restrictions
647
+ # Configuration for collecting the customer's shipping address.
648
+ attr_accessor :shipping_address_collection
649
+ # The shipping rate options to apply to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link.
650
+ attr_accessor :shipping_options
651
+ # Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](https://stripe.com/docs/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`).
652
+ attr_accessor :submit_type
653
+ # When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`.
654
+ attr_accessor :subscription_data
655
+ # Controls tax ID collection during checkout.
656
+ attr_accessor :tax_id_collection
657
+ # The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to.
658
+ attr_accessor :transfer_data
659
+
660
+ def initialize(
661
+ after_completion: nil,
662
+ allow_promotion_codes: nil,
663
+ application_fee_amount: nil,
664
+ application_fee_percent: nil,
665
+ automatic_tax: nil,
666
+ billing_address_collection: nil,
667
+ consent_collection: nil,
668
+ currency: nil,
669
+ custom_fields: nil,
670
+ custom_text: nil,
671
+ customer_creation: nil,
672
+ expand: nil,
673
+ inactive_message: nil,
674
+ invoice_creation: nil,
675
+ line_items: nil,
676
+ metadata: nil,
677
+ on_behalf_of: nil,
678
+ optional_items: nil,
679
+ payment_intent_data: nil,
680
+ payment_method_collection: nil,
681
+ payment_method_types: nil,
682
+ phone_number_collection: nil,
683
+ restrictions: nil,
684
+ shipping_address_collection: nil,
685
+ shipping_options: nil,
686
+ submit_type: nil,
687
+ subscription_data: nil,
688
+ tax_id_collection: nil,
689
+ transfer_data: nil
690
+ )
691
+ @after_completion = after_completion
692
+ @allow_promotion_codes = allow_promotion_codes
693
+ @application_fee_amount = application_fee_amount
694
+ @application_fee_percent = application_fee_percent
695
+ @automatic_tax = automatic_tax
696
+ @billing_address_collection = billing_address_collection
697
+ @consent_collection = consent_collection
698
+ @currency = currency
699
+ @custom_fields = custom_fields
700
+ @custom_text = custom_text
701
+ @customer_creation = customer_creation
702
+ @expand = expand
703
+ @inactive_message = inactive_message
704
+ @invoice_creation = invoice_creation
705
+ @line_items = line_items
706
+ @metadata = metadata
707
+ @on_behalf_of = on_behalf_of
708
+ @optional_items = optional_items
709
+ @payment_intent_data = payment_intent_data
710
+ @payment_method_collection = payment_method_collection
711
+ @payment_method_types = payment_method_types
712
+ @phone_number_collection = phone_number_collection
713
+ @restrictions = restrictions
714
+ @shipping_address_collection = shipping_address_collection
715
+ @shipping_options = shipping_options
716
+ @submit_type = submit_type
717
+ @subscription_data = subscription_data
718
+ @tax_id_collection = tax_id_collection
719
+ @transfer_data = transfer_data
720
+ end
721
+ end
722
+
723
+ class RetrieveParams < Stripe::RequestParams
724
+ # Specifies which fields in the response should be expanded.
725
+ attr_accessor :expand
726
+
727
+ def initialize(expand: nil)
728
+ @expand = expand
729
+ end
730
+ end
731
+
732
+ class UpdateParams < Stripe::RequestParams
733
+ class AfterCompletion < Stripe::RequestParams
734
+ class HostedConfirmation < Stripe::RequestParams
735
+ # A custom message to display to the customer after the purchase is complete.
736
+ attr_accessor :custom_message
737
+
738
+ def initialize(custom_message: nil)
739
+ @custom_message = custom_message
740
+ end
741
+ end
742
+
743
+ class Redirect < Stripe::RequestParams
744
+ # The URL the customer will be redirected to after the purchase is complete. You can embed `{CHECKOUT_SESSION_ID}` into the URL to have the `id` of the completed [checkout session](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-id) included.
745
+ attr_accessor :url
746
+
747
+ def initialize(url: nil)
748
+ @url = url
749
+ end
750
+ end
751
+ # Configuration when `type=hosted_confirmation`.
752
+ attr_accessor :hosted_confirmation
753
+ # Configuration when `type=redirect`.
754
+ attr_accessor :redirect
755
+ # The specified behavior after the purchase is complete. Either `redirect` or `hosted_confirmation`.
756
+ attr_accessor :type
757
+
758
+ def initialize(hosted_confirmation: nil, redirect: nil, type: nil)
759
+ @hosted_confirmation = hosted_confirmation
760
+ @redirect = redirect
761
+ @type = type
762
+ end
763
+ end
764
+
765
+ class AutomaticTax < Stripe::RequestParams
766
+ class Liability < Stripe::RequestParams
767
+ # The connected account being referenced when `type` is `account`.
768
+ attr_accessor :account
769
+ # Type of the account referenced in the request.
770
+ attr_accessor :type
771
+
772
+ def initialize(account: nil, type: nil)
773
+ @account = account
774
+ @type = type
775
+ end
776
+ end
777
+ # Set to `true` to [calculate tax automatically](https://docs.stripe.com/tax) using the customer's location.
778
+ #
779
+ # Enabling this parameter causes the payment link to collect any billing address information necessary for tax calculation.
780
+ attr_accessor :enabled
781
+ # 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.
782
+ attr_accessor :liability
783
+
784
+ def initialize(enabled: nil, liability: nil)
785
+ @enabled = enabled
786
+ @liability = liability
787
+ end
788
+ end
789
+
790
+ class CustomField < Stripe::RequestParams
791
+ class Dropdown < Stripe::RequestParams
792
+ class Option < Stripe::RequestParams
793
+ # The label for the option, displayed to the customer. Up to 100 characters.
794
+ attr_accessor :label
795
+ # The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. Must be unique to this option, alphanumeric, and up to 100 characters.
796
+ attr_accessor :value
797
+
798
+ def initialize(label: nil, value: nil)
799
+ @label = label
800
+ @value = value
801
+ end
802
+ end
803
+ # The value that will pre-fill the field on the payment page.Must match a `value` in the `options` array.
804
+ attr_accessor :default_value
805
+ # The options available for the customer to select. Up to 200 options allowed.
806
+ attr_accessor :options
807
+
808
+ def initialize(default_value: nil, options: nil)
809
+ @default_value = default_value
810
+ @options = options
811
+ end
812
+ end
813
+
814
+ class Label < Stripe::RequestParams
815
+ # Custom text for the label, displayed to the customer. Up to 50 characters.
816
+ attr_accessor :custom
817
+ # The type of the label.
818
+ attr_accessor :type
819
+
820
+ def initialize(custom: nil, type: nil)
821
+ @custom = custom
822
+ @type = type
823
+ end
824
+ end
825
+
826
+ class Numeric < Stripe::RequestParams
827
+ # The value that will pre-fill the field on the payment page.
828
+ attr_accessor :default_value
829
+ # The maximum character length constraint for the customer's input.
830
+ attr_accessor :maximum_length
831
+ # The minimum character length requirement for the customer's input.
832
+ attr_accessor :minimum_length
833
+
834
+ def initialize(default_value: nil, maximum_length: nil, minimum_length: nil)
835
+ @default_value = default_value
836
+ @maximum_length = maximum_length
837
+ @minimum_length = minimum_length
838
+ end
839
+ end
840
+
841
+ class Text < Stripe::RequestParams
842
+ # The value that will pre-fill the field on the payment page.
843
+ attr_accessor :default_value
844
+ # The maximum character length constraint for the customer's input.
845
+ attr_accessor :maximum_length
846
+ # The minimum character length requirement for the customer's input.
847
+ attr_accessor :minimum_length
848
+
849
+ def initialize(default_value: nil, maximum_length: nil, minimum_length: nil)
850
+ @default_value = default_value
851
+ @maximum_length = maximum_length
852
+ @minimum_length = minimum_length
853
+ end
854
+ end
855
+ # Configuration for `type=dropdown` fields.
856
+ attr_accessor :dropdown
857
+ # String of your choice that your integration can use to reconcile this field. Must be unique to this field, alphanumeric, and up to 200 characters.
858
+ attr_accessor :key
859
+ # The label for the field, displayed to the customer.
860
+ attr_accessor :label
861
+ # Configuration for `type=numeric` fields.
862
+ attr_accessor :numeric
863
+ # Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`.
864
+ attr_accessor :optional
865
+ # Configuration for `type=text` fields.
866
+ attr_accessor :text
867
+ # The type of the field.
868
+ attr_accessor :type
869
+
870
+ def initialize(
871
+ dropdown: nil,
872
+ key: nil,
873
+ label: nil,
874
+ numeric: nil,
875
+ optional: nil,
876
+ text: nil,
877
+ type: nil
878
+ )
879
+ @dropdown = dropdown
880
+ @key = key
881
+ @label = label
882
+ @numeric = numeric
883
+ @optional = optional
884
+ @text = text
885
+ @type = type
886
+ end
887
+ end
888
+
889
+ class CustomText < Stripe::RequestParams
890
+ class AfterSubmit < Stripe::RequestParams
891
+ # Text may be up to 1200 characters in length.
892
+ attr_accessor :message
893
+
894
+ def initialize(message: nil)
895
+ @message = message
896
+ end
897
+ end
898
+
899
+ class ShippingAddress < Stripe::RequestParams
900
+ # Text may be up to 1200 characters in length.
901
+ attr_accessor :message
902
+
903
+ def initialize(message: nil)
904
+ @message = message
905
+ end
906
+ end
907
+
908
+ class Submit < Stripe::RequestParams
909
+ # Text may be up to 1200 characters in length.
910
+ attr_accessor :message
911
+
912
+ def initialize(message: nil)
913
+ @message = message
914
+ end
915
+ end
916
+
917
+ class TermsOfServiceAcceptance < Stripe::RequestParams
918
+ # Text may be up to 1200 characters in length.
919
+ attr_accessor :message
920
+
921
+ def initialize(message: nil)
922
+ @message = message
923
+ end
924
+ end
925
+ # Custom text that should be displayed after the payment confirmation button.
926
+ attr_accessor :after_submit
927
+ # Custom text that should be displayed alongside shipping address collection.
928
+ attr_accessor :shipping_address
929
+ # Custom text that should be displayed alongside the payment confirmation button.
930
+ attr_accessor :submit
931
+ # Custom text that should be displayed in place of the default terms of service agreement text.
932
+ attr_accessor :terms_of_service_acceptance
933
+
934
+ def initialize(
935
+ after_submit: nil,
936
+ shipping_address: nil,
937
+ submit: nil,
938
+ terms_of_service_acceptance: nil
939
+ )
940
+ @after_submit = after_submit
941
+ @shipping_address = shipping_address
942
+ @submit = submit
943
+ @terms_of_service_acceptance = terms_of_service_acceptance
944
+ end
945
+ end
946
+
947
+ class InvoiceCreation < Stripe::RequestParams
948
+ class InvoiceData < Stripe::RequestParams
949
+ class CustomField < Stripe::RequestParams
950
+ # The name of the custom field. This may be up to 40 characters.
951
+ attr_accessor :name
952
+ # The value of the custom field. This may be up to 140 characters.
953
+ attr_accessor :value
954
+
955
+ def initialize(name: nil, value: nil)
956
+ @name = name
957
+ @value = value
958
+ end
959
+ end
960
+
961
+ class Issuer < Stripe::RequestParams
962
+ # The connected account being referenced when `type` is `account`.
963
+ attr_accessor :account
964
+ # Type of the account referenced in the request.
965
+ attr_accessor :type
966
+
967
+ def initialize(account: nil, type: nil)
968
+ @account = account
969
+ @type = type
970
+ end
971
+ end
972
+
973
+ class RenderingOptions < Stripe::RequestParams
974
+ # 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.
975
+ attr_accessor :amount_tax_display
976
+
977
+ def initialize(amount_tax_display: nil)
978
+ @amount_tax_display = amount_tax_display
979
+ end
980
+ end
981
+ # The account tax IDs associated with the invoice.
982
+ attr_accessor :account_tax_ids
983
+ # Default custom fields to be displayed on invoices for this customer.
984
+ attr_accessor :custom_fields
985
+ # An arbitrary string attached to the object. Often useful for displaying to users.
986
+ attr_accessor :description
987
+ # Default footer to be displayed on invoices for this customer.
988
+ attr_accessor :footer
989
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
990
+ attr_accessor :issuer
991
+ # 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`.
992
+ attr_accessor :metadata
993
+ # Default options for invoice PDF rendering for this customer.
994
+ attr_accessor :rendering_options
995
+
996
+ def initialize(
997
+ account_tax_ids: nil,
998
+ custom_fields: nil,
999
+ description: nil,
1000
+ footer: nil,
1001
+ issuer: nil,
1002
+ metadata: nil,
1003
+ rendering_options: nil
1004
+ )
1005
+ @account_tax_ids = account_tax_ids
1006
+ @custom_fields = custom_fields
1007
+ @description = description
1008
+ @footer = footer
1009
+ @issuer = issuer
1010
+ @metadata = metadata
1011
+ @rendering_options = rendering_options
1012
+ end
1013
+ end
1014
+ # Whether the feature is enabled
1015
+ attr_accessor :enabled
1016
+ # Invoice PDF configuration.
1017
+ attr_accessor :invoice_data
1018
+
1019
+ def initialize(enabled: nil, invoice_data: nil)
1020
+ @enabled = enabled
1021
+ @invoice_data = invoice_data
1022
+ end
1023
+ end
1024
+
1025
+ class LineItem < Stripe::RequestParams
1026
+ class AdjustableQuantity < Stripe::RequestParams
1027
+ # Set to true if the quantity can be adjusted to any non-negative Integer.
1028
+ attr_accessor :enabled
1029
+ # The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999.
1030
+ attr_accessor :maximum
1031
+ # The minimum quantity the customer can purchase. By default this value is 0. If there is only one item in the cart then that item's quantity cannot go down to 0.
1032
+ attr_accessor :minimum
1033
+
1034
+ def initialize(enabled: nil, maximum: nil, minimum: nil)
1035
+ @enabled = enabled
1036
+ @maximum = maximum
1037
+ @minimum = minimum
1038
+ end
1039
+ end
1040
+ # When set, provides configuration for this item’s quantity to be adjusted by the customer during checkout.
1041
+ attr_accessor :adjustable_quantity
1042
+ # The ID of an existing line item on the payment link.
1043
+ attr_accessor :id
1044
+ # The quantity of the line item being purchased.
1045
+ attr_accessor :quantity
1046
+
1047
+ def initialize(adjustable_quantity: nil, id: nil, quantity: nil)
1048
+ @adjustable_quantity = adjustable_quantity
1049
+ @id = id
1050
+ @quantity = quantity
1051
+ end
1052
+ end
1053
+
1054
+ class PaymentIntentData < Stripe::RequestParams
1055
+ # An arbitrary string attached to the object. Often useful for displaying to users.
1056
+ attr_accessor :description
1057
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Payment Intents](https://stripe.com/docs/api/payment_intents) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
1058
+ attr_accessor :metadata
1059
+ # Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).
1060
+ #
1061
+ # Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead.
1062
+ attr_accessor :statement_descriptor
1063
+ # Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement.
1064
+ attr_accessor :statement_descriptor_suffix
1065
+ # A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details.
1066
+ attr_accessor :transfer_group
1067
+
1068
+ def initialize(
1069
+ description: nil,
1070
+ metadata: nil,
1071
+ statement_descriptor: nil,
1072
+ statement_descriptor_suffix: nil,
1073
+ transfer_group: nil
1074
+ )
1075
+ @description = description
1076
+ @metadata = metadata
1077
+ @statement_descriptor = statement_descriptor
1078
+ @statement_descriptor_suffix = statement_descriptor_suffix
1079
+ @transfer_group = transfer_group
1080
+ end
1081
+ end
1082
+
1083
+ class PhoneNumberCollection < Stripe::RequestParams
1084
+ # Set to `true` to enable phone number collection.
1085
+ attr_accessor :enabled
1086
+
1087
+ def initialize(enabled: nil)
1088
+ @enabled = enabled
1089
+ end
1090
+ end
1091
+
1092
+ class Restrictions < Stripe::RequestParams
1093
+ class CompletedSessions < Stripe::RequestParams
1094
+ # The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met.
1095
+ attr_accessor :limit
1096
+
1097
+ def initialize(limit: nil)
1098
+ @limit = limit
1099
+ end
1100
+ end
1101
+ # Configuration for the `completed_sessions` restriction type.
1102
+ attr_accessor :completed_sessions
1103
+
1104
+ def initialize(completed_sessions: nil)
1105
+ @completed_sessions = completed_sessions
1106
+ end
1107
+ end
1108
+
1109
+ class ShippingAddressCollection < Stripe::RequestParams
1110
+ # An array of two-letter ISO country codes representing which countries Checkout should provide as options for
1111
+ # shipping locations.
1112
+ attr_accessor :allowed_countries
1113
+
1114
+ def initialize(allowed_countries: nil)
1115
+ @allowed_countries = allowed_countries
1116
+ end
1117
+ end
1118
+
1119
+ class SubscriptionData < Stripe::RequestParams
1120
+ class InvoiceSettings < Stripe::RequestParams
1121
+ class Issuer < Stripe::RequestParams
1122
+ # The connected account being referenced when `type` is `account`.
1123
+ attr_accessor :account
1124
+ # Type of the account referenced in the request.
1125
+ attr_accessor :type
1126
+
1127
+ def initialize(account: nil, type: nil)
1128
+ @account = account
1129
+ @type = type
1130
+ end
1131
+ end
1132
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
1133
+ attr_accessor :issuer
1134
+
1135
+ def initialize(issuer: nil)
1136
+ @issuer = issuer
1137
+ end
1138
+ end
1139
+
1140
+ class TrialSettings < Stripe::RequestParams
1141
+ class EndBehavior < Stripe::RequestParams
1142
+ # Indicates how the subscription should change when the trial ends if the user did not provide a payment method.
1143
+ attr_accessor :missing_payment_method
1144
+
1145
+ def initialize(missing_payment_method: nil)
1146
+ @missing_payment_method = missing_payment_method
1147
+ end
1148
+ end
1149
+ # Defines how the subscription should behave when the user's free trial ends.
1150
+ attr_accessor :end_behavior
1151
+
1152
+ def initialize(end_behavior: nil)
1153
+ @end_behavior = end_behavior
1154
+ end
1155
+ end
1156
+ # All invoices will be billed using the specified settings.
1157
+ attr_accessor :invoice_settings
1158
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
1159
+ attr_accessor :metadata
1160
+ # Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1.
1161
+ attr_accessor :trial_period_days
1162
+ # Settings related to subscription trials.
1163
+ attr_accessor :trial_settings
1164
+
1165
+ def initialize(
1166
+ invoice_settings: nil,
1167
+ metadata: nil,
1168
+ trial_period_days: nil,
1169
+ trial_settings: nil
1170
+ )
1171
+ @invoice_settings = invoice_settings
1172
+ @metadata = metadata
1173
+ @trial_period_days = trial_period_days
1174
+ @trial_settings = trial_settings
1175
+ end
1176
+ end
1177
+
1178
+ class TaxIdCollection < Stripe::RequestParams
1179
+ # Enable tax ID collection during checkout. Defaults to `false`.
1180
+ attr_accessor :enabled
1181
+ # Describes whether a tax ID is required during checkout. Defaults to `never`.
1182
+ attr_accessor :required
1183
+
1184
+ def initialize(enabled: nil, required: nil)
1185
+ @enabled = enabled
1186
+ @required = required
1187
+ end
1188
+ end
1189
+ # Whether the payment link's `url` is active. If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated.
1190
+ attr_accessor :active
1191
+ # Behavior after the purchase is complete.
1192
+ attr_accessor :after_completion
1193
+ # Enables user redeemable promotion codes.
1194
+ attr_accessor :allow_promotion_codes
1195
+ # Configuration for automatic tax collection.
1196
+ attr_accessor :automatic_tax
1197
+ # Configuration for collecting the customer's billing address. Defaults to `auto`.
1198
+ attr_accessor :billing_address_collection
1199
+ # Collect additional information from your customer using custom fields. Up to 3 fields are supported.
1200
+ attr_accessor :custom_fields
1201
+ # Display additional text for your customers using custom text.
1202
+ attr_accessor :custom_text
1203
+ # Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers).
1204
+ attr_accessor :customer_creation
1205
+ # Specifies which fields in the response should be expanded.
1206
+ attr_accessor :expand
1207
+ # The custom message to be displayed to a customer when a payment link is no longer active.
1208
+ attr_accessor :inactive_message
1209
+ # Generate a post-purchase Invoice for one-time payments.
1210
+ attr_accessor :invoice_creation
1211
+ # The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported.
1212
+ attr_accessor :line_items
1213
+ # 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`. Metadata associated with this Payment Link will automatically be copied to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link.
1214
+ attr_accessor :metadata
1215
+ # A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode.
1216
+ attr_accessor :payment_intent_data
1217
+ # Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount.
1218
+ #
1219
+ # Can only be set in `subscription` mode. Defaults to `always`.
1220
+ #
1221
+ # If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials).
1222
+ attr_accessor :payment_method_collection
1223
+ # The list of payment method types that customers can use. Pass an empty string to enable dynamic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods).
1224
+ attr_accessor :payment_method_types
1225
+ # Controls phone number collection settings during checkout.
1226
+ #
1227
+ # We recommend that you review your privacy policy and check with your legal contacts.
1228
+ attr_accessor :phone_number_collection
1229
+ # Settings that restrict the usage of a payment link.
1230
+ attr_accessor :restrictions
1231
+ # Configuration for collecting the customer's shipping address.
1232
+ attr_accessor :shipping_address_collection
1233
+ # Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](https://stripe.com/docs/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`).
1234
+ attr_accessor :submit_type
1235
+ # When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`.
1236
+ attr_accessor :subscription_data
1237
+ # Controls tax ID collection during checkout.
1238
+ attr_accessor :tax_id_collection
1239
+
1240
+ def initialize(
1241
+ active: nil,
1242
+ after_completion: nil,
1243
+ allow_promotion_codes: nil,
1244
+ automatic_tax: nil,
1245
+ billing_address_collection: nil,
1246
+ custom_fields: nil,
1247
+ custom_text: nil,
1248
+ customer_creation: nil,
1249
+ expand: nil,
1250
+ inactive_message: nil,
1251
+ invoice_creation: nil,
1252
+ line_items: nil,
1253
+ metadata: nil,
1254
+ payment_intent_data: nil,
1255
+ payment_method_collection: nil,
1256
+ payment_method_types: nil,
1257
+ phone_number_collection: nil,
1258
+ restrictions: nil,
1259
+ shipping_address_collection: nil,
1260
+ submit_type: nil,
1261
+ subscription_data: nil,
1262
+ tax_id_collection: nil
1263
+ )
1264
+ @active = active
1265
+ @after_completion = after_completion
1266
+ @allow_promotion_codes = allow_promotion_codes
1267
+ @automatic_tax = automatic_tax
1268
+ @billing_address_collection = billing_address_collection
1269
+ @custom_fields = custom_fields
1270
+ @custom_text = custom_text
1271
+ @customer_creation = customer_creation
1272
+ @expand = expand
1273
+ @inactive_message = inactive_message
1274
+ @invoice_creation = invoice_creation
1275
+ @line_items = line_items
1276
+ @metadata = metadata
1277
+ @payment_intent_data = payment_intent_data
1278
+ @payment_method_collection = payment_method_collection
1279
+ @payment_method_types = payment_method_types
1280
+ @phone_number_collection = phone_number_collection
1281
+ @restrictions = restrictions
1282
+ @shipping_address_collection = shipping_address_collection
1283
+ @submit_type = submit_type
1284
+ @subscription_data = subscription_data
1285
+ @tax_id_collection = tax_id_collection
1286
+ end
1287
+ end
1288
+
1289
+ # Creates a payment link.
1290
+ def create(params = {}, opts = {})
1291
+ request(
1292
+ method: :post,
1293
+ path: "/v1/payment_links",
1294
+ params: params,
1295
+ opts: opts,
1296
+ base_address: :api
1297
+ )
1298
+ end
1299
+
1300
+ # Returns a list of your payment links.
1301
+ def list(params = {}, opts = {})
1302
+ request(
1303
+ method: :get,
1304
+ path: "/v1/payment_links",
1305
+ params: params,
1306
+ opts: opts,
1307
+ base_address: :api
1308
+ )
1309
+ end
1310
+
1311
+ # Retrieve a payment link.
1312
+ def retrieve(payment_link, params = {}, opts = {})
1313
+ request(
1314
+ method: :get,
1315
+ path: format("/v1/payment_links/%<payment_link>s", { payment_link: CGI.escape(payment_link) }),
1316
+ params: params,
1317
+ opts: opts,
1318
+ base_address: :api
1319
+ )
1320
+ end
1321
+
1322
+ # Updates a payment link.
1323
+ def update(payment_link, params = {}, opts = {})
1324
+ request(
1325
+ method: :post,
1326
+ path: format("/v1/payment_links/%<payment_link>s", { payment_link: CGI.escape(payment_link) }),
1327
+ params: params,
1328
+ opts: opts,
1329
+ base_address: :api
1330
+ )
1331
+ end
1332
+ end
1333
+ end