stripe 5.38.0 → 15.2.1

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 (708) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +742 -0
  3. data/CONTRIBUTING.md +25 -0
  4. data/Gemfile +12 -4
  5. data/Makefile +22 -0
  6. data/OPENAPI_VERSION +1 -0
  7. data/README.md +137 -27
  8. data/Rakefile +3 -6
  9. data/VERSION +1 -1
  10. data/examples/README.md +16 -0
  11. data/examples/example_template.rb +36 -0
  12. data/examples/meter_event_stream.rb +57 -0
  13. data/examples/thinevent_webhook_handler.rb +39 -0
  14. data/{bin → exe}/stripe-console +1 -1
  15. data/justfile +43 -0
  16. data/lib/data/ca-certificates.crt +1241 -1937
  17. data/lib/stripe/api_operations/create.rb +6 -2
  18. data/lib/stripe/api_operations/delete.rb +12 -7
  19. data/lib/stripe/api_operations/list.rb +6 -9
  20. data/lib/stripe/api_operations/nested_resource.rb +59 -31
  21. data/lib/stripe/api_operations/request.rb +30 -65
  22. data/lib/stripe/api_operations/save.rb +20 -10
  23. data/lib/stripe/api_operations/search.rb +21 -0
  24. data/lib/stripe/api_operations/singleton_save.rb +90 -0
  25. data/lib/stripe/api_requestor.rb +1136 -0
  26. data/lib/stripe/api_resource.rb +49 -34
  27. data/lib/stripe/api_resource_test_helpers.rb +53 -0
  28. data/lib/stripe/{resources/usage_record.rb → api_version.rb} +2 -2
  29. data/lib/stripe/connection_manager.rb +28 -11
  30. data/lib/stripe/errors.rb +11 -20
  31. data/lib/stripe/event_types.rb +15 -0
  32. data/lib/stripe/events/v1_billing_meter_error_report_triggered_event.rb +23 -0
  33. data/lib/stripe/events/v1_billing_meter_no_meter_found_event.rb +13 -0
  34. data/lib/stripe/events/v2_core_event_destination_ping_event.rb +21 -0
  35. data/lib/stripe/instrumentation.rb +37 -15
  36. data/lib/stripe/list_object.rb +5 -3
  37. data/lib/stripe/multipart_encoder.rb +7 -7
  38. data/lib/stripe/oauth.rb +14 -21
  39. data/lib/stripe/object_types.rb +157 -91
  40. data/lib/stripe/request_options.rb +129 -0
  41. data/lib/stripe/request_params.rb +24 -0
  42. data/lib/stripe/resources/account.rb +4854 -30
  43. data/lib/stripe/resources/account_link.rb +66 -0
  44. data/lib/stripe/resources/account_session.rb +868 -0
  45. data/lib/stripe/resources/alipay_account.rb +1 -1
  46. data/lib/stripe/resources/apple_pay_domain.rb +91 -0
  47. data/lib/stripe/resources/application.rb +20 -0
  48. data/lib/stripe/resources/application_fee.rb +96 -2
  49. data/lib/stripe/resources/application_fee_refund.rb +26 -2
  50. data/lib/stripe/resources/apps/secret.rb +196 -0
  51. data/lib/stripe/resources/balance.rb +178 -0
  52. data/lib/stripe/resources/balance_transaction.rb +124 -0
  53. data/lib/stripe/resources/bank_account.rb +137 -6
  54. data/lib/stripe/resources/billing/alert.rb +222 -0
  55. data/lib/stripe/resources/billing/alert_triggered.rb +26 -0
  56. data/lib/stripe/resources/billing/credit_balance_summary.rb +54 -0
  57. data/lib/stripe/resources/billing/credit_balance_transaction.rb +133 -0
  58. data/lib/stripe/resources/billing/credit_grant.rb +307 -0
  59. data/lib/stripe/resources/billing/meter.rb +254 -0
  60. data/lib/stripe/resources/billing/meter_event.rb +61 -0
  61. data/lib/stripe/resources/billing/meter_event_adjustment.rb +69 -0
  62. data/lib/stripe/resources/billing/meter_event_summary.rb +32 -0
  63. data/lib/stripe/resources/billing_portal/configuration.rb +587 -0
  64. data/lib/stripe/resources/billing_portal/session.rb +298 -0
  65. data/lib/stripe/resources/capability.rb +91 -2
  66. data/lib/stripe/resources/card.rb +111 -3
  67. data/lib/stripe/resources/cash_balance.rb +43 -0
  68. data/lib/stripe/resources/charge.rb +1682 -2
  69. data/lib/stripe/resources/checkout/session.rb +3666 -2
  70. data/lib/stripe/resources/climate/order.rb +234 -0
  71. data/lib/stripe/resources/climate/product.rb +74 -0
  72. data/lib/stripe/resources/climate/supplier.rb +71 -0
  73. data/lib/stripe/resources/confirmation_token.rb +1498 -0
  74. data/lib/stripe/resources/connect_collection_transfer.rb +24 -0
  75. data/lib/stripe/resources/country_spec.rb +68 -0
  76. data/lib/stripe/resources/coupon.rb +236 -0
  77. data/lib/stripe/resources/credit_note.rb +709 -9
  78. data/lib/stripe/resources/credit_note_line_item.rb +71 -0
  79. data/lib/stripe/resources/customer.rb +1015 -16
  80. data/lib/stripe/resources/customer_balance_transaction.rb +38 -1
  81. data/lib/stripe/resources/customer_cash_balance_transaction.rb +124 -0
  82. data/lib/stripe/resources/customer_session.rb +188 -0
  83. data/lib/stripe/resources/discount.rb +37 -0
  84. data/lib/stripe/resources/dispute.rb +650 -2
  85. data/lib/stripe/resources/entitlements/active_entitlement.rb +63 -0
  86. data/lib/stripe/resources/entitlements/active_entitlement_summary.rb +23 -0
  87. data/lib/stripe/resources/entitlements/feature.rb +130 -0
  88. data/lib/stripe/resources/ephemeral_key.rb +44 -0
  89. data/lib/stripe/resources/event.rb +130 -0
  90. data/lib/stripe/resources/exchange_rate.rb +58 -0
  91. data/lib/stripe/resources/file.rb +139 -15
  92. data/lib/stripe/resources/file_link.rb +129 -0
  93. data/lib/stripe/resources/financial_connections/account.rb +363 -0
  94. data/lib/stripe/resources/financial_connections/account_owner.rb +31 -0
  95. data/lib/stripe/resources/financial_connections/account_ownership.rb +23 -0
  96. data/lib/stripe/resources/financial_connections/session.rb +121 -0
  97. data/lib/stripe/resources/financial_connections/transaction.rb +118 -0
  98. data/lib/stripe/resources/forwarding/request.rb +208 -0
  99. data/lib/stripe/resources/funding_instructions.rb +332 -0
  100. data/lib/stripe/resources/identity/verification_report.rb +287 -0
  101. data/lib/stripe/resources/identity/verification_session.rb +474 -4
  102. data/lib/stripe/resources/invoice.rb +3525 -17
  103. data/lib/stripe/resources/invoice_item.rb +453 -0
  104. data/lib/stripe/resources/invoice_line_item.rb +372 -1
  105. data/lib/stripe/resources/invoice_payment.rb +112 -0
  106. data/lib/stripe/resources/invoice_rendering_template.rb +120 -0
  107. data/lib/stripe/resources/issuing/authorization.rb +1313 -4
  108. data/lib/stripe/resources/issuing/card.rb +785 -4
  109. data/lib/stripe/resources/issuing/cardholder.rb +684 -0
  110. data/lib/stripe/resources/issuing/dispute.rb +828 -2
  111. data/lib/stripe/resources/issuing/personalization_design.rb +395 -0
  112. data/lib/stripe/resources/issuing/physical_bundle.rb +80 -0
  113. data/lib/stripe/resources/issuing/token.rb +198 -0
  114. data/lib/stripe/resources/issuing/transaction.rb +991 -0
  115. data/lib/stripe/resources/line_item.rb +51 -0
  116. data/lib/stripe/resources/login_link.rb +12 -0
  117. data/lib/stripe/resources/mandate.rb +146 -0
  118. data/lib/stripe/resources/payment_intent.rb +8876 -6
  119. data/lib/stripe/resources/payment_link.rb +1692 -0
  120. data/lib/stripe/resources/payment_method.rb +1570 -4
  121. data/lib/stripe/resources/payment_method_configuration.rb +3189 -0
  122. data/lib/stripe/resources/payment_method_domain.rb +236 -0
  123. data/lib/stripe/resources/payout.rb +271 -4
  124. data/lib/stripe/resources/person.rb +295 -1
  125. data/lib/stripe/resources/plan.rb +352 -0
  126. data/lib/stripe/resources/price.rb +642 -0
  127. data/lib/stripe/resources/product.rb +534 -0
  128. data/lib/stripe/resources/product_feature.rb +25 -0
  129. data/lib/stripe/resources/promotion_code.rb +237 -0
  130. data/lib/stripe/resources/quote.rb +1015 -38
  131. data/lib/stripe/resources/radar/early_fraud_warning.rb +85 -0
  132. data/lib/stripe/resources/radar/value_list.rb +171 -0
  133. data/lib/stripe/resources/radar/value_list_item.rb +131 -0
  134. data/lib/stripe/resources/refund.rb +494 -0
  135. data/lib/stripe/resources/reporting/report_run.rb +172 -0
  136. data/lib/stripe/resources/reporting/report_type.rb +48 -1
  137. data/lib/stripe/resources/reserve_transaction.rb +22 -0
  138. data/lib/stripe/resources/reversal.rb +38 -2
  139. data/lib/stripe/resources/review.rb +122 -2
  140. data/lib/stripe/resources/setup_attempt.rb +380 -0
  141. data/lib/stripe/resources/setup_intent.rb +3432 -4
  142. data/lib/stripe/resources/shipping_rate.rb +287 -0
  143. data/lib/stripe/resources/sigma/scheduled_query_run.rb +62 -0
  144. data/lib/stripe/resources/source.rb +1250 -10
  145. data/lib/stripe/resources/source_mandate_notification.rb +66 -0
  146. data/lib/stripe/resources/source_transaction.rb +93 -0
  147. data/lib/stripe/resources/subscription.rb +1871 -3
  148. data/lib/stripe/resources/subscription_item.rb +399 -10
  149. data/lib/stripe/resources/subscription_schedule.rb +1455 -4
  150. data/lib/stripe/resources/tax/calculation.rb +430 -0
  151. data/lib/stripe/resources/tax/calculation_line_item.rb +71 -0
  152. data/lib/stripe/resources/tax/registration.rb +2667 -0
  153. data/lib/stripe/resources/tax/settings.rb +134 -0
  154. data/lib/stripe/resources/tax/transaction.rb +314 -0
  155. data/lib/stripe/resources/tax/transaction_line_item.rb +44 -0
  156. data/lib/stripe/resources/tax_code.rb +35 -0
  157. data/lib/stripe/resources/tax_deducted_at_source.rb +22 -0
  158. data/lib/stripe/resources/tax_id.rb +144 -11
  159. data/lib/stripe/resources/tax_rate.rb +217 -0
  160. data/lib/stripe/resources/terminal/configuration.rb +1328 -0
  161. data/lib/stripe/resources/terminal/connection_token.rb +34 -0
  162. data/lib/stripe/resources/terminal/location.rb +222 -0
  163. data/lib/stripe/resources/terminal/reader.rb +886 -0
  164. data/lib/stripe/resources/test_helpers/test_clock.rb +156 -0
  165. data/lib/stripe/resources/token.rb +1249 -0
  166. data/lib/stripe/resources/topup.rb +204 -2
  167. data/lib/stripe/resources/transfer.rb +173 -6
  168. data/lib/stripe/resources/treasury/credit_reversal.rb +120 -0
  169. data/lib/stripe/resources/treasury/debit_reversal.rb +131 -0
  170. data/lib/stripe/resources/treasury/financial_account.rb +833 -0
  171. data/lib/stripe/resources/treasury/financial_account_features.rb +204 -0
  172. data/lib/stripe/resources/treasury/inbound_transfer.rb +356 -0
  173. data/lib/stripe/resources/treasury/outbound_payment.rb +638 -0
  174. data/lib/stripe/resources/treasury/outbound_transfer.rb +493 -0
  175. data/lib/stripe/resources/treasury/received_credit.rb +284 -0
  176. data/lib/stripe/resources/treasury/received_debit.rb +243 -0
  177. data/lib/stripe/resources/treasury/transaction.rb +193 -0
  178. data/lib/stripe/resources/treasury/transaction_entry.rb +178 -0
  179. data/lib/stripe/resources/v2/amount.rb +9 -0
  180. data/lib/stripe/resources/v2/billing/meter_event.rb +34 -0
  181. data/lib/stripe/resources/v2/billing/meter_event_adjustment.rb +36 -0
  182. data/lib/stripe/resources/v2/billing/meter_event_session.rb +29 -0
  183. data/lib/stripe/resources/v2/event.rb +41 -0
  184. data/lib/stripe/resources/v2/event_destination.rb +73 -0
  185. data/lib/stripe/resources/webhook_endpoint.rb +167 -0
  186. data/lib/stripe/resources.rb +70 -12
  187. data/lib/stripe/search_result_object.rb +89 -0
  188. data/lib/stripe/services/account_capability_service.rb +71 -0
  189. data/lib/stripe/services/account_external_account_service.rb +317 -0
  190. data/lib/stripe/services/account_link_service.rb +63 -0
  191. data/lib/stripe/services/account_login_link_service.rb +28 -0
  192. data/lib/stripe/services/account_person_service.rb +1019 -0
  193. data/lib/stripe/services/account_service.rb +4171 -0
  194. data/lib/stripe/services/account_session_service.rb +569 -0
  195. data/lib/stripe/services/apple_pay_domain_service.rb +100 -0
  196. data/lib/stripe/services/application_fee_refund_service.rb +114 -0
  197. data/lib/stripe/services/application_fee_service.rb +92 -0
  198. data/lib/stripe/services/apps/secret_service.rb +168 -0
  199. data/lib/stripe/services/apps_service.rb +13 -0
  200. data/lib/stripe/services/balance_service.rb +21 -0
  201. data/lib/stripe/services/balance_transaction_service.rb +101 -0
  202. data/lib/stripe/services/billing/alert_service.rb +187 -0
  203. data/lib/stripe/services/billing/credit_balance_summary_service.rb +67 -0
  204. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +70 -0
  205. data/lib/stripe/services/billing/credit_grant_service.rb +240 -0
  206. data/lib/stripe/services/billing/meter_event_adjustment_service.rb +45 -0
  207. data/lib/stripe/services/billing/meter_event_service.rb +40 -0
  208. data/lib/stripe/services/billing/meter_event_summary_service.rb +58 -0
  209. data/lib/stripe/services/billing/meter_service.rb +211 -0
  210. data/lib/stripe/services/billing_portal/configuration_service.rb +496 -0
  211. data/lib/stripe/services/billing_portal/session_service.rb +192 -0
  212. data/lib/stripe/services/billing_portal_service.rb +14 -0
  213. data/lib/stripe/services/billing_service.rb +20 -0
  214. data/lib/stripe/services/charge_service.rb +471 -0
  215. data/lib/stripe/services/checkout/session_line_item_service.rb +37 -0
  216. data/lib/stripe/services/checkout/session_service.rb +2495 -0
  217. data/lib/stripe/services/checkout_service.rb +13 -0
  218. data/lib/stripe/services/climate/order_service.rb +170 -0
  219. data/lib/stripe/services/climate/product_service.rb +57 -0
  220. data/lib/stripe/services/climate/supplier_service.rb +57 -0
  221. data/lib/stripe/services/climate_service.rb +15 -0
  222. data/lib/stripe/services/confirmation_token_service.rb +26 -0
  223. data/lib/stripe/services/country_spec_service.rb +55 -0
  224. data/lib/stripe/services/coupon_service.rb +202 -0
  225. data/lib/stripe/services/credit_note_line_item_service.rb +35 -0
  226. data/lib/stripe/services/credit_note_preview_lines_service.rb +169 -0
  227. data/lib/stripe/services/credit_note_service.rb +457 -0
  228. data/lib/stripe/services/customer_balance_transaction_service.rb +113 -0
  229. data/lib/stripe/services/customer_cash_balance_service.rb +57 -0
  230. data/lib/stripe/services/customer_cash_balance_transaction_service.rb +55 -0
  231. data/lib/stripe/services/customer_funding_instructions_service.rb +61 -0
  232. data/lib/stripe/services/customer_payment_method_service.rb +68 -0
  233. data/lib/stripe/services/customer_payment_source_service.rb +255 -0
  234. data/lib/stripe/services/customer_service.rb +664 -0
  235. data/lib/stripe/services/customer_session_service.rb +113 -0
  236. data/lib/stripe/services/customer_tax_id_service.rb +94 -0
  237. data/lib/stripe/services/dispute_service.rb +422 -0
  238. data/lib/stripe/services/entitlements/active_entitlement_service.rb +66 -0
  239. data/lib/stripe/services/entitlements/feature_service.rb +128 -0
  240. data/lib/stripe/services/entitlements_service.rb +14 -0
  241. data/lib/stripe/services/ephemeral_key_service.rb +64 -0
  242. data/lib/stripe/services/event_service.rb +87 -0
  243. data/lib/stripe/services/exchange_rate_service.rb +55 -0
  244. data/lib/stripe/services/file_link_service.rb +132 -0
  245. data/lib/stripe/services/file_service.rb +124 -0
  246. data/lib/stripe/services/financial_connections/account_owner_service.rb +46 -0
  247. data/lib/stripe/services/financial_connections/account_service.rb +177 -0
  248. data/lib/stripe/services/financial_connections/session_service.rb +98 -0
  249. data/lib/stripe/services/financial_connections/transaction_service.rb +100 -0
  250. data/lib/stripe/services/financial_connections_service.rb +15 -0
  251. data/lib/stripe/services/forwarding/request_service.rb +147 -0
  252. data/lib/stripe/services/forwarding_service.rb +13 -0
  253. data/lib/stripe/services/identity/verification_report_service.rb +95 -0
  254. data/lib/stripe/services/identity/verification_session_service.rb +337 -0
  255. data/lib/stripe/services/identity_service.rb +14 -0
  256. data/lib/stripe/services/invoice_item_service.rb +394 -0
  257. data/lib/stripe/services/invoice_line_item_service.rb +252 -0
  258. data/lib/stripe/services/invoice_payment_service.rb +83 -0
  259. data/lib/stripe/services/invoice_rendering_template_service.rb +101 -0
  260. data/lib/stripe/services/invoice_service.rb +2900 -0
  261. data/lib/stripe/services/issuing/authorization_service.rb +169 -0
  262. data/lib/stripe/services/issuing/card_service.rb +507 -0
  263. data/lib/stripe/services/issuing/cardholder_service.rb +577 -0
  264. data/lib/stripe/services/issuing/dispute_service.rb +696 -0
  265. data/lib/stripe/services/issuing/personalization_design_service.rb +245 -0
  266. data/lib/stripe/services/issuing/physical_bundle_service.rb +70 -0
  267. data/lib/stripe/services/issuing/token_service.rb +114 -0
  268. data/lib/stripe/services/issuing/transaction_service.rb +118 -0
  269. data/lib/stripe/services/issuing_service.rb +20 -0
  270. data/lib/stripe/services/mandate_service.rb +26 -0
  271. data/lib/stripe/services/oauth_service.rb +63 -0
  272. data/lib/stripe/services/payment_intent_service.rb +7202 -0
  273. data/lib/stripe/services/payment_link_line_item_service.rb +35 -0
  274. data/lib/stripe/services/payment_link_service.rb +1333 -0
  275. data/lib/stripe/services/payment_method_configuration_service.rb +2306 -0
  276. data/lib/stripe/services/payment_method_domain_service.rb +142 -0
  277. data/lib/stripe/services/payment_method_service.rb +843 -0
  278. data/lib/stripe/services/payout_service.rb +225 -0
  279. data/lib/stripe/services/plan_service.rb +297 -0
  280. data/lib/stripe/services/price_service.rb +545 -0
  281. data/lib/stripe/services/product_feature_service.rb +91 -0
  282. data/lib/stripe/services/product_service.rb +494 -0
  283. data/lib/stripe/services/promotion_code_service.rb +228 -0
  284. data/lib/stripe/services/quote_computed_upfront_line_items_service.rb +35 -0
  285. data/lib/stripe/services/quote_line_item_service.rb +35 -0
  286. data/lib/stripe/services/quote_service.rb +703 -0
  287. data/lib/stripe/services/radar/early_fraud_warning_service.rb +93 -0
  288. data/lib/stripe/services/radar/value_list_item_service.rb +130 -0
  289. data/lib/stripe/services/radar/value_list_service.rb +165 -0
  290. data/lib/stripe/services/radar_service.rb +15 -0
  291. data/lib/stripe/services/refund_service.rb +200 -0
  292. data/lib/stripe/services/reporting/report_run_service.rb +147 -0
  293. data/lib/stripe/services/reporting/report_type_service.rb +48 -0
  294. data/lib/stripe/services/reporting_service.rb +14 -0
  295. data/lib/stripe/services/review_service.rb +89 -0
  296. data/lib/stripe/services/setup_attempt_service.rb +68 -0
  297. data/lib/stripe/services/setup_intent_service.rb +3107 -0
  298. data/lib/stripe/services/shipping_rate_service.rb +250 -0
  299. data/lib/stripe/services/sigma/scheduled_query_run_service.rb +57 -0
  300. data/lib/stripe/services/sigma_service.rb +13 -0
  301. data/lib/stripe/services/source_service.rb +665 -0
  302. data/lib/stripe/services/source_transaction_service.rb +35 -0
  303. data/lib/stripe/services/subscription_item_service.rb +372 -0
  304. data/lib/stripe/services/subscription_schedule_service.rb +1224 -0
  305. data/lib/stripe/services/subscription_service.rb +1590 -0
  306. data/lib/stripe/services/tax/calculation_line_item_service.rb +37 -0
  307. data/lib/stripe/services/tax/calculation_service.rb +246 -0
  308. data/lib/stripe/services/tax/registration_service.rb +1774 -0
  309. data/lib/stripe/services/tax/settings_service.rb +104 -0
  310. data/lib/stripe/services/tax/transaction_line_item_service.rb +37 -0
  311. data/lib/stripe/services/tax/transaction_service.rb +159 -0
  312. data/lib/stripe/services/tax_code_service.rb +49 -0
  313. data/lib/stripe/services/tax_id_service.rb +116 -0
  314. data/lib/stripe/services/tax_rate_service.rb +193 -0
  315. data/lib/stripe/services/tax_service.rb +16 -0
  316. data/lib/stripe/services/terminal/configuration_service.rb +1059 -0
  317. data/lib/stripe/services/terminal/connection_token_service.rb +31 -0
  318. data/lib/stripe/services/terminal/location_service.rb +207 -0
  319. data/lib/stripe/services/terminal/reader_service.rb +488 -0
  320. data/lib/stripe/services/terminal_service.rb +16 -0
  321. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +655 -0
  322. data/lib/stripe/services/test_helpers/customer_service.rb +37 -0
  323. data/lib/stripe/services/test_helpers/issuing/authorization_service.rb +832 -0
  324. data/lib/stripe/services/test_helpers/issuing/card_service.rb +110 -0
  325. data/lib/stripe/services/test_helpers/issuing/personalization_design_service.rb +84 -0
  326. data/lib/stripe/services/test_helpers/issuing/transaction_service.rb +675 -0
  327. data/lib/stripe/services/test_helpers/issuing_service.rb +19 -0
  328. data/lib/stripe/services/test_helpers/refund_service.rb +28 -0
  329. data/lib/stripe/services/test_helpers/terminal/reader_service.rb +108 -0
  330. data/lib/stripe/services/test_helpers/terminal_service.rb +15 -0
  331. data/lib/stripe/services/test_helpers/test_clock_service.rb +119 -0
  332. data/lib/stripe/services/test_helpers/treasury/inbound_transfer_service.rb +81 -0
  333. data/lib/stripe/services/test_helpers/treasury/outbound_payment_service.rb +141 -0
  334. data/lib/stripe/services/test_helpers/treasury/outbound_transfer_service.rb +141 -0
  335. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +81 -0
  336. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +81 -0
  337. data/lib/stripe/services/test_helpers/treasury_service.rb +19 -0
  338. data/lib/stripe/services/test_helpers_service.rb +19 -0
  339. data/lib/stripe/services/token_service.rb +1224 -0
  340. data/lib/stripe/services/topup_service.rb +191 -0
  341. data/lib/stripe/services/transfer_reversal_service.rb +122 -0
  342. data/lib/stripe/services/transfer_service.rb +166 -0
  343. data/lib/stripe/services/treasury/credit_reversal_service.rb +100 -0
  344. data/lib/stripe/services/treasury/debit_reversal_service.rb +104 -0
  345. data/lib/stripe/services/treasury/financial_account_features_service.rb +196 -0
  346. data/lib/stripe/services/treasury/financial_account_service.rb +554 -0
  347. data/lib/stripe/services/treasury/inbound_transfer_service.rb +140 -0
  348. data/lib/stripe/services/treasury/outbound_payment_service.rb +310 -0
  349. data/lib/stripe/services/treasury/outbound_transfer_service.rb +176 -0
  350. data/lib/stripe/services/treasury/received_credit_service.rb +82 -0
  351. data/lib/stripe/services/treasury/received_debit_service.rb +70 -0
  352. data/lib/stripe/services/treasury/transaction_entry_service.rb +117 -0
  353. data/lib/stripe/services/treasury/transaction_service.rb +125 -0
  354. data/lib/stripe/services/treasury_service.rb +22 -0
  355. data/lib/stripe/services/v1_services.rb +90 -0
  356. data/lib/stripe/services/v2/billing/meter_event_adjustment_service.rb +44 -0
  357. data/lib/stripe/services/v2/billing/meter_event_service.rb +46 -0
  358. data/lib/stripe/services/v2/billing/meter_event_session_service.rb +23 -0
  359. data/lib/stripe/services/v2/billing/meter_event_stream_service.rb +56 -0
  360. data/lib/stripe/services/v2/billing_service.rb +18 -0
  361. data/lib/stripe/services/v2/core/event_destination_service.rb +235 -0
  362. data/lib/stripe/services/v2/core/event_service.rb +48 -0
  363. data/lib/stripe/services/v2/core_service.rb +16 -0
  364. data/lib/stripe/services/v2_services.rb +14 -0
  365. data/lib/stripe/services/webhook_endpoint_service.rb +156 -0
  366. data/lib/stripe/services.rb +180 -0
  367. data/lib/stripe/singleton_api_resource.rb +3 -3
  368. data/lib/stripe/stripe_client.rb +56 -1021
  369. data/lib/stripe/stripe_configuration.rb +63 -42
  370. data/lib/stripe/stripe_object.rb +75 -39
  371. data/lib/stripe/stripe_response.rb +1 -3
  372. data/lib/stripe/stripe_service.rb +32 -0
  373. data/lib/stripe/thin_event.rb +37 -0
  374. data/lib/stripe/util.rb +161 -39
  375. data/lib/stripe/v2_list_object.rb +84 -0
  376. data/lib/stripe/version.rb +1 -1
  377. data/lib/stripe/webhook.rb +3 -2
  378. data/lib/stripe.rb +44 -1
  379. data/rbi/stripe/resources/account.rbi +4926 -0
  380. data/rbi/stripe/resources/account_link.rbi +74 -0
  381. data/rbi/stripe/resources/account_session.rbi +1013 -0
  382. data/rbi/stripe/resources/apple_pay_domain.rbi +88 -0
  383. data/rbi/stripe/resources/application.rbi +20 -0
  384. data/rbi/stripe/resources/application_fee.rbi +118 -0
  385. data/rbi/stripe/resources/application_fee_refund.rbi +37 -0
  386. data/rbi/stripe/resources/apps/secret.rbi +195 -0
  387. data/rbi/stripe/resources/balance.rbi +235 -0
  388. data/rbi/stripe/resources/balance_transaction.rbi +147 -0
  389. data/rbi/stripe/resources/bank_account.rbi +127 -0
  390. data/rbi/stripe/resources/billing/alert.rbi +201 -0
  391. data/rbi/stripe/resources/billing/alert_triggered.rbi +28 -0
  392. data/rbi/stripe/resources/billing/credit_balance_summary.rbi +63 -0
  393. data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +147 -0
  394. data/rbi/stripe/resources/billing/credit_grant.rbi +291 -0
  395. data/rbi/stripe/resources/billing/meter.rbi +226 -0
  396. data/rbi/stripe/resources/billing/meter_event.rbi +64 -0
  397. data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +64 -0
  398. data/rbi/stripe/resources/billing/meter_event_summary.rbi +35 -0
  399. data/rbi/stripe/resources/billing_portal/configuration.rbi +645 -0
  400. data/rbi/stripe/resources/billing_portal/session.rbi +345 -0
  401. data/rbi/stripe/resources/capability.rbi +125 -0
  402. data/rbi/stripe/resources/card.rbi +125 -0
  403. data/rbi/stripe/resources/cash_balance.rbi +32 -0
  404. data/rbi/stripe/resources/charge.rbi +2069 -0
  405. data/rbi/stripe/resources/checkout/session.rbi +4004 -0
  406. data/rbi/stripe/resources/climate/order.rbi +245 -0
  407. data/rbi/stripe/resources/climate/product.rbi +75 -0
  408. data/rbi/stripe/resources/climate/supplier.rbi +72 -0
  409. data/rbi/stripe/resources/confirmation_token.rbi +1807 -0
  410. data/rbi/stripe/resources/connect_collection_transfer.rbi +26 -0
  411. data/rbi/stripe/resources/country_spec.rbi +85 -0
  412. data/rbi/stripe/resources/coupon.rbi +250 -0
  413. data/rbi/stripe/resources/credit_note.rbi +752 -0
  414. data/rbi/stripe/resources/credit_note_line_item.rbi +101 -0
  415. data/rbi/stripe/resources/customer.rbi +1005 -0
  416. data/rbi/stripe/resources/customer_balance_transaction.rbi +56 -0
  417. data/rbi/stripe/resources/customer_cash_balance_transaction.rbi +151 -0
  418. data/rbi/stripe/resources/customer_session.rbi +200 -0
  419. data/rbi/stripe/resources/discount.rbi +53 -0
  420. data/rbi/stripe/resources/dispute.rbi +761 -0
  421. data/rbi/stripe/resources/entitlements/active_entitlement.rbi +58 -0
  422. data/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi +23 -0
  423. data/rbi/stripe/resources/entitlements/feature.rbi +117 -0
  424. data/rbi/stripe/resources/ephemeral_key.rbi +44 -0
  425. data/rbi/stripe/resources/event.rbi +149 -0
  426. data/rbi/stripe/resources/exchange_rate.rbi +66 -0
  427. data/rbi/stripe/resources/file.rbi +143 -0
  428. data/rbi/stripe/resources/file_link.rbi +141 -0
  429. data/rbi/stripe/resources/financial_connections/account.rbi +339 -0
  430. data/rbi/stripe/resources/financial_connections/account_owner.rbi +35 -0
  431. data/rbi/stripe/resources/financial_connections/account_ownership.rbi +23 -0
  432. data/rbi/stripe/resources/financial_connections/session.rbi +123 -0
  433. data/rbi/stripe/resources/financial_connections/transaction.rbi +124 -0
  434. data/rbi/stripe/resources/forwarding/request.rbi +216 -0
  435. data/rbi/stripe/resources/funding_instructions.rbi +437 -0
  436. data/rbi/stripe/resources/identity/verification_report.rbi +360 -0
  437. data/rbi/stripe/resources/identity/verification_session.rbi +526 -0
  438. data/rbi/stripe/resources/invoice.rbi +3812 -0
  439. data/rbi/stripe/resources/invoice_item.rbi +473 -0
  440. data/rbi/stripe/resources/invoice_line_item.rbi +432 -0
  441. data/rbi/stripe/resources/invoice_payment.rbi +121 -0
  442. data/rbi/stripe/resources/invoice_rendering_template.rbi +104 -0
  443. data/rbi/stripe/resources/issuing/authorization.rbi +1283 -0
  444. data/rbi/stripe/resources/issuing/card.rbi +741 -0
  445. data/rbi/stripe/resources/issuing/cardholder.rbi +744 -0
  446. data/rbi/stripe/resources/issuing/dispute.rbi +913 -0
  447. data/rbi/stripe/resources/issuing/personalization_design.rbi +338 -0
  448. data/rbi/stripe/resources/issuing/physical_bundle.rbi +79 -0
  449. data/rbi/stripe/resources/issuing/token.rbi +226 -0
  450. data/rbi/stripe/resources/issuing/transaction.rbi +1061 -0
  451. data/rbi/stripe/resources/line_item.rbi +72 -0
  452. data/rbi/stripe/resources/login_link.rbi +19 -0
  453. data/rbi/stripe/resources/mandate.rbi +187 -0
  454. data/rbi/stripe/resources/payment_intent.rbi +9647 -0
  455. data/rbi/stripe/resources/payment_link.rbi +1801 -0
  456. data/rbi/stripe/resources/payment_method.rbi +1761 -0
  457. data/rbi/stripe/resources/payment_method_configuration.rbi +3550 -0
  458. data/rbi/stripe/resources/payment_method_domain.rbi +228 -0
  459. data/rbi/stripe/resources/payout.rbi +300 -0
  460. data/rbi/stripe/resources/person.rbi +401 -0
  461. data/rbi/stripe/resources/plan.rbi +371 -0
  462. data/rbi/stripe/resources/price.rbi +694 -0
  463. data/rbi/stripe/resources/product.rbi +555 -0
  464. data/rbi/stripe/resources/product_feature.rbi +26 -0
  465. data/rbi/stripe/resources/promotion_code.rbi +261 -0
  466. data/rbi/stripe/resources/quote.rbi +1126 -0
  467. data/rbi/stripe/resources/radar/early_fraud_warning.rbi +98 -0
  468. data/rbi/stripe/resources/radar/value_list.rbi +168 -0
  469. data/rbi/stripe/resources/radar/value_list_item.rbi +129 -0
  470. data/rbi/stripe/resources/refund.rbi +523 -0
  471. data/rbi/stripe/resources/reporting/report_run.rbi +191 -0
  472. data/rbi/stripe/resources/reporting/report_type.rbi +57 -0
  473. data/rbi/stripe/resources/reserve_transaction.rbi +23 -0
  474. data/rbi/stripe/resources/reversal.rbi +51 -0
  475. data/rbi/stripe/resources/review.rbi +154 -0
  476. data/rbi/stripe/resources/setup_attempt.rbi +477 -0
  477. data/rbi/stripe/resources/setup_intent.rbi +3655 -0
  478. data/rbi/stripe/resources/shipping_rate.rbi +305 -0
  479. data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +75 -0
  480. data/rbi/stripe/resources/source.rbi +1496 -0
  481. data/rbi/stripe/resources/source_mandate_notification.rbi +77 -0
  482. data/rbi/stripe/resources/source_transaction.rbi +127 -0
  483. data/rbi/stripe/resources/subscription.rbi +2027 -0
  484. data/rbi/stripe/resources/subscription_item.rbi +404 -0
  485. data/rbi/stripe/resources/subscription_schedule.rbi +1623 -0
  486. data/rbi/stripe/resources/tax/calculation.rbi +478 -0
  487. data/rbi/stripe/resources/tax/calculation_line_item.rbi +91 -0
  488. data/rbi/stripe/resources/tax/registration.rbi +2713 -0
  489. data/rbi/stripe/resources/tax/settings.rbi +141 -0
  490. data/rbi/stripe/resources/tax/transaction.rbi +351 -0
  491. data/rbi/stripe/resources/tax/transaction_line_item.rbi +54 -0
  492. data/rbi/stripe/resources/tax_code.rbi +44 -0
  493. data/rbi/stripe/resources/tax_deducted_at_source.rbi +23 -0
  494. data/rbi/stripe/resources/tax_id.rbi +165 -0
  495. data/rbi/stripe/resources/tax_rate.rbi +239 -0
  496. data/rbi/stripe/resources/terminal/configuration.rbi +1386 -0
  497. data/rbi/stripe/resources/terminal/connection_token.rbi +37 -0
  498. data/rbi/stripe/resources/terminal/location.rbi +222 -0
  499. data/rbi/stripe/resources/terminal/reader.rbi +847 -0
  500. data/rbi/stripe/resources/test_helpers/test_clock.rbi +132 -0
  501. data/rbi/stripe/resources/token.rbi +1283 -0
  502. data/rbi/stripe/resources/topup.rbi +222 -0
  503. data/rbi/stripe/resources/transfer.rbi +199 -0
  504. data/rbi/stripe/resources/treasury/credit_reversal.rbi +119 -0
  505. data/rbi/stripe/resources/treasury/debit_reversal.rbi +131 -0
  506. data/rbi/stripe/resources/treasury/financial_account.rbi +865 -0
  507. data/rbi/stripe/resources/treasury/financial_account_features.rbi +260 -0
  508. data/rbi/stripe/resources/treasury/inbound_transfer.rbi +295 -0
  509. data/rbi/stripe/resources/treasury/outbound_payment.rbi +592 -0
  510. data/rbi/stripe/resources/treasury/outbound_transfer.rbi +431 -0
  511. data/rbi/stripe/resources/treasury/received_credit.rbi +302 -0
  512. data/rbi/stripe/resources/treasury/received_debit.rbi +256 -0
  513. data/rbi/stripe/resources/treasury/transaction.rbi +215 -0
  514. data/rbi/stripe/resources/treasury/transaction_entry.rbi +192 -0
  515. data/rbi/stripe/resources/v2/amount.rbi +14 -0
  516. data/rbi/stripe/resources/v2/billing/meter_event.rbi +37 -0
  517. data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +41 -0
  518. data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +31 -0
  519. data/rbi/stripe/resources/v2/event.rbi +48 -0
  520. data/rbi/stripe/resources/v2/event_destination.rbi +91 -0
  521. data/rbi/stripe/resources/webhook_endpoint.rbi +168 -0
  522. data/rbi/stripe/services/account_capability_service.rbi +51 -0
  523. data/rbi/stripe/services/account_external_account_service.rbi +304 -0
  524. data/rbi/stripe/services/account_link_service.rbi +58 -0
  525. data/rbi/stripe/services/account_login_link_service.rbi +22 -0
  526. data/rbi/stripe/services/account_person_service.rbi +1011 -0
  527. data/rbi/stripe/services/account_service.rbi +4213 -0
  528. data/rbi/stripe/services/account_session_service.rbi +646 -0
  529. data/rbi/stripe/services/apple_pay_domain_service.rbi +76 -0
  530. data/rbi/stripe/services/application_fee_refund_service.rbi +93 -0
  531. data/rbi/stripe/services/application_fee_service.rbi +78 -0
  532. data/rbi/stripe/services/apps/secret_service.rbi +151 -0
  533. data/{lib/stripe/resources/usage_record_summary.rb → rbi/stripe/services/apps_service.rbi} +4 -3
  534. data/rbi/stripe/services/balance_service.rbi +21 -0
  535. data/rbi/stripe/services/balance_transaction_service.rbi +93 -0
  536. data/rbi/stripe/services/billing/alert_service.rbi +152 -0
  537. data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +68 -0
  538. data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +59 -0
  539. data/rbi/stripe/services/billing/credit_grant_service.rbi +211 -0
  540. data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +42 -0
  541. data/rbi/stripe/services/billing/meter_event_service.rbi +42 -0
  542. data/rbi/stripe/services/billing/meter_event_summary_service.rbi +54 -0
  543. data/rbi/stripe/services/billing/meter_service.rbi +163 -0
  544. data/rbi/stripe/services/billing_portal/configuration_service.rbi +511 -0
  545. data/rbi/stripe/services/billing_portal/session_service.rbi +204 -0
  546. data/rbi/stripe/services/billing_portal_service.rbi +10 -0
  547. data/rbi/stripe/services/billing_service.rbi +15 -0
  548. data/rbi/stripe/services/charge_service.rbi +448 -0
  549. data/rbi/stripe/services/checkout/session_line_item_service.rbi +33 -0
  550. data/rbi/stripe/services/checkout/session_service.rbi +2614 -0
  551. data/rbi/stripe/services/checkout_service.rbi +9 -0
  552. data/rbi/stripe/services/climate/order_service.rbi +142 -0
  553. data/rbi/stripe/services/climate/product_service.rbi +46 -0
  554. data/rbi/stripe/services/climate/supplier_service.rbi +46 -0
  555. data/rbi/stripe/services/climate_service.rbi +11 -0
  556. data/rbi/stripe/services/confirmation_token_service.rbi +20 -0
  557. data/rbi/stripe/services/country_spec_service.rbi +44 -0
  558. data/rbi/stripe/services/coupon_service.rbi +194 -0
  559. data/rbi/stripe/services/credit_note_line_item_service.rbi +31 -0
  560. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +167 -0
  561. data/rbi/stripe/services/credit_note_service.rbi +415 -0
  562. data/rbi/stripe/services/customer_balance_transaction_service.rbi +92 -0
  563. data/rbi/stripe/services/customer_cash_balance_service.rbi +45 -0
  564. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +44 -0
  565. data/rbi/stripe/services/customer_funding_instructions_service.rbi +59 -0
  566. data/rbi/stripe/services/customer_payment_method_service.rbi +57 -0
  567. data/rbi/stripe/services/customer_payment_source_service.rbi +232 -0
  568. data/rbi/stripe/services/customer_service.rbi +647 -0
  569. data/rbi/stripe/services/customer_session_service.rbi +116 -0
  570. data/rbi/stripe/services/customer_tax_id_service.rbi +70 -0
  571. data/rbi/stripe/services/dispute_service.rbi +424 -0
  572. data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +55 -0
  573. data/rbi/stripe/services/entitlements/feature_service.rbi +107 -0
  574. data/rbi/stripe/services/entitlements_service.rbi +10 -0
  575. data/rbi/stripe/services/ephemeral_key_service.rbi +53 -0
  576. data/rbi/stripe/services/event_service.rbi +83 -0
  577. data/rbi/stripe/services/exchange_rate_service.rbi +44 -0
  578. data/rbi/stripe/services/file_link_service.rbi +124 -0
  579. data/rbi/stripe/services/file_service.rbi +116 -0
  580. data/rbi/stripe/services/financial_connections/account_owner_service.rbi +42 -0
  581. data/rbi/stripe/services/financial_connections/account_service.rbi +133 -0
  582. data/rbi/stripe/services/financial_connections/session_service.rbi +88 -0
  583. data/rbi/stripe/services/financial_connections/transaction_service.rbi +92 -0
  584. data/rbi/stripe/services/financial_connections_service.rbi +11 -0
  585. data/rbi/stripe/services/forwarding/request_service.rbi +134 -0
  586. data/rbi/stripe/services/forwarding_service.rbi +9 -0
  587. data/rbi/stripe/services/identity/verification_report_service.rbi +87 -0
  588. data/rbi/stripe/services/identity/verification_session_service.rbi +323 -0
  589. data/rbi/stripe/services/identity_service.rbi +10 -0
  590. data/rbi/stripe/services/invoice_item_service.rbi +366 -0
  591. data/rbi/stripe/services/invoice_line_item_service.rbi +259 -0
  592. data/rbi/stripe/services/invoice_payment_service.rbi +71 -0
  593. data/rbi/stripe/services/invoice_rendering_template_service.rbi +82 -0
  594. data/rbi/stripe/services/invoice_service.rbi +2981 -0
  595. data/rbi/stripe/services/issuing/authorization_service.rbi +146 -0
  596. data/rbi/stripe/services/issuing/card_service.rbi +495 -0
  597. data/rbi/stripe/services/issuing/cardholder_service.rbi +587 -0
  598. data/rbi/stripe/services/issuing/dispute_service.rbi +707 -0
  599. data/rbi/stripe/services/issuing/personalization_design_service.rbi +243 -0
  600. data/rbi/stripe/services/issuing/physical_bundle_service.rbi +59 -0
  601. data/rbi/stripe/services/issuing/token_service.rbi +99 -0
  602. data/rbi/stripe/services/issuing/transaction_service.rbi +105 -0
  603. data/rbi/stripe/services/issuing_service.rbi +16 -0
  604. data/rbi/stripe/services/mandate_service.rbi +20 -0
  605. data/rbi/stripe/services/payment_intent_service.rbi +7659 -0
  606. data/rbi/stripe/services/payment_link_line_item_service.rbi +31 -0
  607. data/rbi/stripe/services/payment_link_service.rbi +1352 -0
  608. data/rbi/stripe/services/payment_method_configuration_service.rbi +2487 -0
  609. data/rbi/stripe/services/payment_method_domain_service.rbi +112 -0
  610. data/rbi/stripe/services/payment_method_service.rbi +776 -0
  611. data/rbi/stripe/services/payout_service.rbi +205 -0
  612. data/rbi/stripe/services/plan_service.rbi +282 -0
  613. data/rbi/stripe/services/price_service.rbi +546 -0
  614. data/rbi/stripe/services/product_feature_service.rbi +67 -0
  615. data/rbi/stripe/services/product_service.rbi +477 -0
  616. data/rbi/stripe/services/promotion_code_service.rbi +214 -0
  617. data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +31 -0
  618. data/rbi/stripe/services/quote_line_item_service.rbi +31 -0
  619. data/rbi/stripe/services/quote_service.rbi +686 -0
  620. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +85 -0
  621. data/rbi/stripe/services/radar/value_list_item_service.rbi +109 -0
  622. data/rbi/stripe/services/radar/value_list_service.rbi +141 -0
  623. data/rbi/stripe/services/radar_service.rbi +11 -0
  624. data/rbi/stripe/services/refund_service.rbi +185 -0
  625. data/rbi/stripe/services/reporting/report_run_service.rbi +135 -0
  626. data/rbi/stripe/services/reporting/report_type_service.rbi +35 -0
  627. data/rbi/stripe/services/reporting_service.rbi +10 -0
  628. data/rbi/stripe/services/review_service.rbi +84 -0
  629. data/rbi/stripe/services/setup_attempt_service.rbi +65 -0
  630. data/rbi/stripe/services/setup_intent_service.rbi +3391 -0
  631. data/rbi/stripe/services/shipping_rate_service.rbi +241 -0
  632. data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +46 -0
  633. data/rbi/stripe/services/sigma_service.rbi +9 -0
  634. data/rbi/stripe/services/source_service.rbi +663 -0
  635. data/rbi/stripe/services/source_transaction_service.rbi +31 -0
  636. data/rbi/stripe/services/subscription_item_service.rbi +350 -0
  637. data/rbi/stripe/services/subscription_schedule_service.rbi +1290 -0
  638. data/rbi/stripe/services/subscription_service.rbi +1648 -0
  639. data/rbi/stripe/services/tax/calculation_line_item_service.rbi +33 -0
  640. data/rbi/stripe/services/tax/calculation_service.rbi +234 -0
  641. data/rbi/stripe/services/tax/registration_service.rbi +1845 -0
  642. data/rbi/stripe/services/tax/settings_service.rbi +93 -0
  643. data/rbi/stripe/services/tax/transaction_line_item_service.rbi +33 -0
  644. data/rbi/stripe/services/tax/transaction_service.rbi +146 -0
  645. data/rbi/stripe/services/tax_code_service.rbi +44 -0
  646. data/rbi/stripe/services/tax_id_service.rbi +110 -0
  647. data/rbi/stripe/services/tax_rate_service.rbi +185 -0
  648. data/rbi/stripe/services/tax_service.rbi +12 -0
  649. data/rbi/stripe/services/terminal/configuration_service.rbi +1118 -0
  650. data/rbi/stripe/services/terminal/connection_token_service.rbi +25 -0
  651. data/rbi/stripe/services/terminal/location_service.rbi +182 -0
  652. data/rbi/stripe/services/terminal/reader_service.rbi +455 -0
  653. data/rbi/stripe/services/terminal_service.rbi +12 -0
  654. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +739 -0
  655. data/rbi/stripe/services/test_helpers/customer_service.rbi +33 -0
  656. data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +848 -0
  657. data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +76 -0
  658. data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +69 -0
  659. data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +711 -0
  660. data/rbi/stripe/services/test_helpers/issuing_service.rbi +14 -0
  661. data/rbi/stripe/services/test_helpers/refund_service.rbi +22 -0
  662. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +93 -0
  663. data/rbi/stripe/services/test_helpers/terminal_service.rbi +11 -0
  664. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +90 -0
  665. data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +64 -0
  666. data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +125 -0
  667. data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +125 -0
  668. data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +87 -0
  669. data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +87 -0
  670. data/rbi/stripe/services/test_helpers/treasury_service.rbi +15 -0
  671. data/rbi/stripe/services/test_helpers_service.rbi +15 -0
  672. data/rbi/stripe/services/token_service.rbi +1257 -0
  673. data/rbi/stripe/services/topup_service.rbi +176 -0
  674. data/rbi/stripe/services/transfer_reversal_service.rbi +101 -0
  675. data/rbi/stripe/services/transfer_service.rbi +152 -0
  676. data/rbi/stripe/services/treasury/credit_reversal_service.rbi +84 -0
  677. data/rbi/stripe/services/treasury/debit_reversal_service.rbi +88 -0
  678. data/rbi/stripe/services/treasury/financial_account_features_service.rbi +198 -0
  679. data/rbi/stripe/services/treasury/financial_account_service.rbi +562 -0
  680. data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +117 -0
  681. data/rbi/stripe/services/treasury/outbound_payment_service.rbi +304 -0
  682. data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +157 -0
  683. data/rbi/stripe/services/treasury/received_credit_service.rbi +72 -0
  684. data/rbi/stripe/services/treasury/received_debit_service.rbi +59 -0
  685. data/rbi/stripe/services/treasury/transaction_entry_service.rbi +111 -0
  686. data/rbi/stripe/services/treasury/transaction_service.rbi +122 -0
  687. data/rbi/stripe/services/treasury_service.rbi +18 -0
  688. data/rbi/stripe/services/v1_services.rbi +77 -0
  689. data/rbi/stripe/services/v2/billing/meter_event_adjustment_service.rbi +39 -0
  690. data/rbi/stripe/services/v2/billing/meter_event_service.rbi +42 -0
  691. data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +18 -0
  692. data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +55 -0
  693. data/rbi/stripe/services/v2/billing_service.rbi +14 -0
  694. data/rbi/stripe/services/v2/core/event_destination_service.rbi +192 -0
  695. data/rbi/stripe/services/v2/core/event_service.rbi +36 -0
  696. data/rbi/stripe/services/v2/core_service.rbi +12 -0
  697. data/rbi/stripe/services/v2_services.rbi +10 -0
  698. data/rbi/stripe/services/webhook_endpoint_service.rbi +129 -0
  699. data/stripe.gemspec +10 -7
  700. metadata +599 -18
  701. data/lib/stripe/resources/bitcoin_receiver.rb +0 -24
  702. data/lib/stripe/resources/bitcoin_transaction.rb +0 -16
  703. data/lib/stripe/resources/issuing/card_details.rb +0 -9
  704. data/lib/stripe/resources/order.rb +0 -33
  705. data/lib/stripe/resources/order_return.rb +0 -10
  706. data/lib/stripe/resources/recipient.rb +0 -14
  707. data/lib/stripe/resources/sku.rb +0 -13
  708. data/lib/stripe/resources/three_d_secure.rb +0 -14
@@ -0,0 +1,2495 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Checkout
6
+ class SessionService < StripeService
7
+ attr_reader :line_items
8
+
9
+ def initialize(requestor)
10
+ super
11
+ @line_items = Stripe::Checkout::SessionLineItemService.new(@requestor)
12
+ end
13
+
14
+ class ListParams < Stripe::RequestParams
15
+ class Created < Stripe::RequestParams
16
+ # Minimum value to filter by (exclusive)
17
+ attr_accessor :gt
18
+ # Minimum value to filter by (inclusive)
19
+ attr_accessor :gte
20
+ # Maximum value to filter by (exclusive)
21
+ attr_accessor :lt
22
+ # Maximum value to filter by (inclusive)
23
+ attr_accessor :lte
24
+
25
+ def initialize(gt: nil, gte: nil, lt: nil, lte: nil)
26
+ @gt = gt
27
+ @gte = gte
28
+ @lt = lt
29
+ @lte = lte
30
+ end
31
+ end
32
+
33
+ class CustomerDetails < Stripe::RequestParams
34
+ # Customer's email address.
35
+ attr_accessor :email
36
+
37
+ def initialize(email: nil)
38
+ @email = email
39
+ end
40
+ end
41
+ # Only return Checkout Sessions that were created during the given date interval.
42
+ attr_accessor :created
43
+ # Only return the Checkout Sessions for the Customer specified.
44
+ attr_accessor :customer
45
+ # Only return the Checkout Sessions for the Customer details specified.
46
+ attr_accessor :customer_details
47
+ # 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.
48
+ attr_accessor :ending_before
49
+ # Specifies which fields in the response should be expanded.
50
+ attr_accessor :expand
51
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
52
+ attr_accessor :limit
53
+ # Only return the Checkout Session for the PaymentIntent specified.
54
+ attr_accessor :payment_intent
55
+ # Only return the Checkout Sessions for the Payment Link specified.
56
+ attr_accessor :payment_link
57
+ # 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.
58
+ attr_accessor :starting_after
59
+ # Only return the Checkout Sessions matching the given status.
60
+ attr_accessor :status
61
+ # Only return the Checkout Session for the subscription specified.
62
+ attr_accessor :subscription
63
+
64
+ def initialize(
65
+ created: nil,
66
+ customer: nil,
67
+ customer_details: nil,
68
+ ending_before: nil,
69
+ expand: nil,
70
+ limit: nil,
71
+ payment_intent: nil,
72
+ payment_link: nil,
73
+ starting_after: nil,
74
+ status: nil,
75
+ subscription: nil
76
+ )
77
+ @created = created
78
+ @customer = customer
79
+ @customer_details = customer_details
80
+ @ending_before = ending_before
81
+ @expand = expand
82
+ @limit = limit
83
+ @payment_intent = payment_intent
84
+ @payment_link = payment_link
85
+ @starting_after = starting_after
86
+ @status = status
87
+ @subscription = subscription
88
+ end
89
+ end
90
+
91
+ class CreateParams < Stripe::RequestParams
92
+ class AdaptivePricing < Stripe::RequestParams
93
+ # Set to `true` to enable [Adaptive Pricing](https://docs.stripe.com/payments/checkout/adaptive-pricing). Defaults to your [dashboard setting](https://dashboard.stripe.com/settings/adaptive-pricing).
94
+ attr_accessor :enabled
95
+
96
+ def initialize(enabled: nil)
97
+ @enabled = enabled
98
+ end
99
+ end
100
+
101
+ class AfterExpiration < Stripe::RequestParams
102
+ class Recovery < Stripe::RequestParams
103
+ # Enables user redeemable promotion codes on the recovered Checkout Sessions. Defaults to `false`
104
+ attr_accessor :allow_promotion_codes
105
+ # If `true`, a recovery URL will be generated to recover this Checkout Session if it
106
+ # expires before a successful transaction is completed. It will be attached to the
107
+ # Checkout Session object upon expiration.
108
+ attr_accessor :enabled
109
+
110
+ def initialize(allow_promotion_codes: nil, enabled: nil)
111
+ @allow_promotion_codes = allow_promotion_codes
112
+ @enabled = enabled
113
+ end
114
+ end
115
+ # Configure a Checkout Session that can be used to recover an expired session.
116
+ attr_accessor :recovery
117
+
118
+ def initialize(recovery: nil)
119
+ @recovery = recovery
120
+ end
121
+ end
122
+
123
+ class AutomaticTax < Stripe::RequestParams
124
+ class Liability < Stripe::RequestParams
125
+ # The connected account being referenced when `type` is `account`.
126
+ attr_accessor :account
127
+ # Type of the account referenced in the request.
128
+ attr_accessor :type
129
+
130
+ def initialize(account: nil, type: nil)
131
+ @account = account
132
+ @type = type
133
+ end
134
+ end
135
+ # Set to `true` to [calculate tax automatically](https://docs.stripe.com/tax) using the customer's location.
136
+ #
137
+ # Enabling this parameter causes Checkout to collect any billing address information necessary for tax calculation.
138
+ attr_accessor :enabled
139
+ # 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.
140
+ attr_accessor :liability
141
+
142
+ def initialize(enabled: nil, liability: nil)
143
+ @enabled = enabled
144
+ @liability = liability
145
+ end
146
+ end
147
+
148
+ class ConsentCollection < Stripe::RequestParams
149
+ class PaymentMethodReuseAgreement < Stripe::RequestParams
150
+ # Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's
151
+ # defaults will be used. When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI.
152
+ attr_accessor :position
153
+
154
+ def initialize(position: nil)
155
+ @position = position
156
+ end
157
+ end
158
+ # 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.
159
+ attr_accessor :payment_method_reuse_agreement
160
+ # If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout
161
+ # Session will determine whether to display an option to opt into promotional communication
162
+ # from the merchant depending on the customer's locale. Only available to US merchants.
163
+ attr_accessor :promotions
164
+ # If set to `required`, it requires customers to check a terms of service checkbox before being able to pay.
165
+ # There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public).
166
+ attr_accessor :terms_of_service
167
+
168
+ def initialize(
169
+ payment_method_reuse_agreement: nil,
170
+ promotions: nil,
171
+ terms_of_service: nil
172
+ )
173
+ @payment_method_reuse_agreement = payment_method_reuse_agreement
174
+ @promotions = promotions
175
+ @terms_of_service = terms_of_service
176
+ end
177
+ end
178
+
179
+ class CustomField < Stripe::RequestParams
180
+ class Dropdown < Stripe::RequestParams
181
+ class Option < Stripe::RequestParams
182
+ # The label for the option, displayed to the customer. Up to 100 characters.
183
+ attr_accessor :label
184
+ # 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.
185
+ attr_accessor :value
186
+
187
+ def initialize(label: nil, value: nil)
188
+ @label = label
189
+ @value = value
190
+ end
191
+ end
192
+ # The value that will pre-fill the field on the payment page.Must match a `value` in the `options` array.
193
+ attr_accessor :default_value
194
+ # The options available for the customer to select. Up to 200 options allowed.
195
+ attr_accessor :options
196
+
197
+ def initialize(default_value: nil, options: nil)
198
+ @default_value = default_value
199
+ @options = options
200
+ end
201
+ end
202
+
203
+ class Label < Stripe::RequestParams
204
+ # Custom text for the label, displayed to the customer. Up to 50 characters.
205
+ attr_accessor :custom
206
+ # The type of the label.
207
+ attr_accessor :type
208
+
209
+ def initialize(custom: nil, type: nil)
210
+ @custom = custom
211
+ @type = type
212
+ end
213
+ end
214
+
215
+ class Numeric < Stripe::RequestParams
216
+ # The value that will pre-fill the field on the payment page.
217
+ attr_accessor :default_value
218
+ # The maximum character length constraint for the customer's input.
219
+ attr_accessor :maximum_length
220
+ # The minimum character length requirement for the customer's input.
221
+ attr_accessor :minimum_length
222
+
223
+ def initialize(default_value: nil, maximum_length: nil, minimum_length: nil)
224
+ @default_value = default_value
225
+ @maximum_length = maximum_length
226
+ @minimum_length = minimum_length
227
+ end
228
+ end
229
+
230
+ class Text < Stripe::RequestParams
231
+ # The value that will pre-fill the field on the payment page.
232
+ attr_accessor :default_value
233
+ # The maximum character length constraint for the customer's input.
234
+ attr_accessor :maximum_length
235
+ # The minimum character length requirement for the customer's input.
236
+ attr_accessor :minimum_length
237
+
238
+ def initialize(default_value: nil, maximum_length: nil, minimum_length: nil)
239
+ @default_value = default_value
240
+ @maximum_length = maximum_length
241
+ @minimum_length = minimum_length
242
+ end
243
+ end
244
+ # Configuration for `type=dropdown` fields.
245
+ attr_accessor :dropdown
246
+ # 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.
247
+ attr_accessor :key
248
+ # The label for the field, displayed to the customer.
249
+ attr_accessor :label
250
+ # Configuration for `type=numeric` fields.
251
+ attr_accessor :numeric
252
+ # Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`.
253
+ attr_accessor :optional
254
+ # Configuration for `type=text` fields.
255
+ attr_accessor :text
256
+ # The type of the field.
257
+ attr_accessor :type
258
+
259
+ def initialize(
260
+ dropdown: nil,
261
+ key: nil,
262
+ label: nil,
263
+ numeric: nil,
264
+ optional: nil,
265
+ text: nil,
266
+ type: nil
267
+ )
268
+ @dropdown = dropdown
269
+ @key = key
270
+ @label = label
271
+ @numeric = numeric
272
+ @optional = optional
273
+ @text = text
274
+ @type = type
275
+ end
276
+ end
277
+
278
+ class CustomText < Stripe::RequestParams
279
+ class AfterSubmit < Stripe::RequestParams
280
+ # Text may be up to 1200 characters in length.
281
+ attr_accessor :message
282
+
283
+ def initialize(message: nil)
284
+ @message = message
285
+ end
286
+ end
287
+
288
+ class ShippingAddress < Stripe::RequestParams
289
+ # Text may be up to 1200 characters in length.
290
+ attr_accessor :message
291
+
292
+ def initialize(message: nil)
293
+ @message = message
294
+ end
295
+ end
296
+
297
+ class Submit < Stripe::RequestParams
298
+ # Text may be up to 1200 characters in length.
299
+ attr_accessor :message
300
+
301
+ def initialize(message: nil)
302
+ @message = message
303
+ end
304
+ end
305
+
306
+ class TermsOfServiceAcceptance < Stripe::RequestParams
307
+ # Text may be up to 1200 characters in length.
308
+ attr_accessor :message
309
+
310
+ def initialize(message: nil)
311
+ @message = message
312
+ end
313
+ end
314
+ # Custom text that should be displayed after the payment confirmation button.
315
+ attr_accessor :after_submit
316
+ # Custom text that should be displayed alongside shipping address collection.
317
+ attr_accessor :shipping_address
318
+ # Custom text that should be displayed alongside the payment confirmation button.
319
+ attr_accessor :submit
320
+ # Custom text that should be displayed in place of the default terms of service agreement text.
321
+ attr_accessor :terms_of_service_acceptance
322
+
323
+ def initialize(
324
+ after_submit: nil,
325
+ shipping_address: nil,
326
+ submit: nil,
327
+ terms_of_service_acceptance: nil
328
+ )
329
+ @after_submit = after_submit
330
+ @shipping_address = shipping_address
331
+ @submit = submit
332
+ @terms_of_service_acceptance = terms_of_service_acceptance
333
+ end
334
+ end
335
+
336
+ class CustomerUpdate < Stripe::RequestParams
337
+ # Describes whether Checkout saves the billing address onto `customer.address`.
338
+ # To always collect a full billing address, use `billing_address_collection`. Defaults to `never`.
339
+ attr_accessor :address
340
+ # Describes whether Checkout saves the name onto `customer.name`. Defaults to `never`.
341
+ attr_accessor :name
342
+ # Describes whether Checkout saves shipping information onto `customer.shipping`.
343
+ # To collect shipping information, use `shipping_address_collection`. Defaults to `never`.
344
+ attr_accessor :shipping
345
+
346
+ def initialize(address: nil, name: nil, shipping: nil)
347
+ @address = address
348
+ @name = name
349
+ @shipping = shipping
350
+ end
351
+ end
352
+
353
+ class Discount < Stripe::RequestParams
354
+ # The ID of the coupon to apply to this Session.
355
+ attr_accessor :coupon
356
+ # The ID of a promotion code to apply to this Session.
357
+ attr_accessor :promotion_code
358
+
359
+ def initialize(coupon: nil, promotion_code: nil)
360
+ @coupon = coupon
361
+ @promotion_code = promotion_code
362
+ end
363
+ end
364
+
365
+ class InvoiceCreation < Stripe::RequestParams
366
+ class InvoiceData < Stripe::RequestParams
367
+ class CustomField < Stripe::RequestParams
368
+ # The name of the custom field. This may be up to 40 characters.
369
+ attr_accessor :name
370
+ # The value of the custom field. This may be up to 140 characters.
371
+ attr_accessor :value
372
+
373
+ def initialize(name: nil, value: nil)
374
+ @name = name
375
+ @value = value
376
+ end
377
+ end
378
+
379
+ class Issuer < Stripe::RequestParams
380
+ # The connected account being referenced when `type` is `account`.
381
+ attr_accessor :account
382
+ # Type of the account referenced in the request.
383
+ attr_accessor :type
384
+
385
+ def initialize(account: nil, type: nil)
386
+ @account = account
387
+ @type = type
388
+ end
389
+ end
390
+
391
+ class RenderingOptions < Stripe::RequestParams
392
+ # 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.
393
+ attr_accessor :amount_tax_display
394
+
395
+ def initialize(amount_tax_display: nil)
396
+ @amount_tax_display = amount_tax_display
397
+ end
398
+ end
399
+ # The account tax IDs associated with the invoice.
400
+ attr_accessor :account_tax_ids
401
+ # Default custom fields to be displayed on invoices for this customer.
402
+ attr_accessor :custom_fields
403
+ # An arbitrary string attached to the object. Often useful for displaying to users.
404
+ attr_accessor :description
405
+ # Default footer to be displayed on invoices for this customer.
406
+ attr_accessor :footer
407
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
408
+ attr_accessor :issuer
409
+ # 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`.
410
+ attr_accessor :metadata
411
+ # Default options for invoice PDF rendering for this customer.
412
+ attr_accessor :rendering_options
413
+
414
+ def initialize(
415
+ account_tax_ids: nil,
416
+ custom_fields: nil,
417
+ description: nil,
418
+ footer: nil,
419
+ issuer: nil,
420
+ metadata: nil,
421
+ rendering_options: nil
422
+ )
423
+ @account_tax_ids = account_tax_ids
424
+ @custom_fields = custom_fields
425
+ @description = description
426
+ @footer = footer
427
+ @issuer = issuer
428
+ @metadata = metadata
429
+ @rendering_options = rendering_options
430
+ end
431
+ end
432
+ # Set to `true` to enable invoice creation.
433
+ attr_accessor :enabled
434
+ # Parameters passed when creating invoices for payment-mode Checkout Sessions.
435
+ attr_accessor :invoice_data
436
+
437
+ def initialize(enabled: nil, invoice_data: nil)
438
+ @enabled = enabled
439
+ @invoice_data = invoice_data
440
+ end
441
+ end
442
+
443
+ class LineItem < Stripe::RequestParams
444
+ class AdjustableQuantity < Stripe::RequestParams
445
+ # Set to true if the quantity can be adjusted to any non-negative integer.
446
+ attr_accessor :enabled
447
+ # The maximum quantity the customer can purchase for the Checkout Session. By default this value is 99. You can specify a value up to 999999.
448
+ attr_accessor :maximum
449
+ # The minimum quantity the customer must purchase for the Checkout Session. By default this value is 0.
450
+ attr_accessor :minimum
451
+
452
+ def initialize(enabled: nil, maximum: nil, minimum: nil)
453
+ @enabled = enabled
454
+ @maximum = maximum
455
+ @minimum = minimum
456
+ end
457
+ end
458
+
459
+ class PriceData < Stripe::RequestParams
460
+ class ProductData < Stripe::RequestParams
461
+ # The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.
462
+ attr_accessor :description
463
+ # A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
464
+ attr_accessor :images
465
+ # 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`.
466
+ attr_accessor :metadata
467
+ # The product's name, meant to be displayable to the customer.
468
+ attr_accessor :name
469
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
470
+ attr_accessor :tax_code
471
+
472
+ def initialize(description: nil, images: nil, metadata: nil, name: nil, tax_code: nil)
473
+ @description = description
474
+ @images = images
475
+ @metadata = metadata
476
+ @name = name
477
+ @tax_code = tax_code
478
+ end
479
+ end
480
+
481
+ class Recurring < Stripe::RequestParams
482
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
483
+ attr_accessor :interval
484
+ # The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
485
+ attr_accessor :interval_count
486
+
487
+ def initialize(interval: nil, interval_count: nil)
488
+ @interval = interval
489
+ @interval_count = interval_count
490
+ end
491
+ end
492
+ # 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).
493
+ attr_accessor :currency
494
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. One of `product` or `product_data` is required.
495
+ attr_accessor :product
496
+ # Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required.
497
+ attr_accessor :product_data
498
+ # The recurring components of a price such as `interval` and `interval_count`.
499
+ attr_accessor :recurring
500
+ # Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
501
+ attr_accessor :tax_behavior
502
+ # A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
503
+ attr_accessor :unit_amount
504
+ # Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
505
+ attr_accessor :unit_amount_decimal
506
+
507
+ def initialize(
508
+ currency: nil,
509
+ product: nil,
510
+ product_data: nil,
511
+ recurring: nil,
512
+ tax_behavior: nil,
513
+ unit_amount: nil,
514
+ unit_amount_decimal: nil
515
+ )
516
+ @currency = currency
517
+ @product = product
518
+ @product_data = product_data
519
+ @recurring = recurring
520
+ @tax_behavior = tax_behavior
521
+ @unit_amount = unit_amount
522
+ @unit_amount_decimal = unit_amount_decimal
523
+ end
524
+ end
525
+ # When set, provides configuration for this item’s quantity to be adjusted by the customer during Checkout.
526
+ attr_accessor :adjustable_quantity
527
+ # The [tax rates](https://stripe.com/docs/api/tax_rates) that will be applied to this line item depending on the customer's billing/shipping address. We currently support the following countries: US, GB, AU, and all countries in the EU.
528
+ attr_accessor :dynamic_tax_rates
529
+ # The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. One of `price` or `price_data` is required.
530
+ attr_accessor :price
531
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
532
+ attr_accessor :price_data
533
+ # The quantity of the line item being purchased. Quantity should not be defined when `recurring.usage_type=metered`.
534
+ attr_accessor :quantity
535
+ # The [tax rates](https://stripe.com/docs/api/tax_rates) which apply to this line item.
536
+ attr_accessor :tax_rates
537
+
538
+ def initialize(
539
+ adjustable_quantity: nil,
540
+ dynamic_tax_rates: nil,
541
+ price: nil,
542
+ price_data: nil,
543
+ quantity: nil,
544
+ tax_rates: nil
545
+ )
546
+ @adjustable_quantity = adjustable_quantity
547
+ @dynamic_tax_rates = dynamic_tax_rates
548
+ @price = price
549
+ @price_data = price_data
550
+ @quantity = quantity
551
+ @tax_rates = tax_rates
552
+ end
553
+ end
554
+
555
+ class OptionalItem < Stripe::RequestParams
556
+ class AdjustableQuantity < Stripe::RequestParams
557
+ # Set to true if the quantity can be adjusted to any non-negative integer.
558
+ attr_accessor :enabled
559
+ # The maximum quantity of this item the customer can purchase. By default this value is 99. You can specify a value up to 999999.
560
+ attr_accessor :maximum
561
+ # 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.
562
+ attr_accessor :minimum
563
+
564
+ def initialize(enabled: nil, maximum: nil, minimum: nil)
565
+ @enabled = enabled
566
+ @maximum = maximum
567
+ @minimum = minimum
568
+ end
569
+ end
570
+ # 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.
571
+ attr_accessor :adjustable_quantity
572
+ # The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object.
573
+ attr_accessor :price
574
+ # The initial quantity of the line item created when a customer chooses to add this optional item to their order.
575
+ attr_accessor :quantity
576
+
577
+ def initialize(adjustable_quantity: nil, price: nil, quantity: nil)
578
+ @adjustable_quantity = adjustable_quantity
579
+ @price = price
580
+ @quantity = quantity
581
+ end
582
+ end
583
+
584
+ class PaymentIntentData < Stripe::RequestParams
585
+ class Shipping < Stripe::RequestParams
586
+ class Address < Stripe::RequestParams
587
+ # City, district, suburb, town, or village.
588
+ attr_accessor :city
589
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
590
+ attr_accessor :country
591
+ # Address line 1 (e.g., street, PO Box, or company name).
592
+ attr_accessor :line1
593
+ # Address line 2 (e.g., apartment, suite, unit, or building).
594
+ attr_accessor :line2
595
+ # ZIP or postal code.
596
+ attr_accessor :postal_code
597
+ # State, county, province, or region.
598
+ attr_accessor :state
599
+
600
+ def initialize(
601
+ city: nil,
602
+ country: nil,
603
+ line1: nil,
604
+ line2: nil,
605
+ postal_code: nil,
606
+ state: nil
607
+ )
608
+ @city = city
609
+ @country = country
610
+ @line1 = line1
611
+ @line2 = line2
612
+ @postal_code = postal_code
613
+ @state = state
614
+ end
615
+ end
616
+ # Shipping address.
617
+ attr_accessor :address
618
+ # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
619
+ attr_accessor :carrier
620
+ # Recipient name.
621
+ attr_accessor :name
622
+ # Recipient phone (including extension).
623
+ attr_accessor :phone
624
+ # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.
625
+ attr_accessor :tracking_number
626
+
627
+ def initialize(address: nil, carrier: nil, name: nil, phone: nil, tracking_number: nil)
628
+ @address = address
629
+ @carrier = carrier
630
+ @name = name
631
+ @phone = phone
632
+ @tracking_number = tracking_number
633
+ end
634
+ end
635
+
636
+ class TransferData < Stripe::RequestParams
637
+ # The amount that will be transferred automatically when a charge succeeds.
638
+ attr_accessor :amount
639
+ # If specified, successful charges will be attributed to the destination
640
+ # account for tax reporting, and the funds from charges will be transferred
641
+ # to the destination account. The ID of the resulting transfer will be
642
+ # returned on the successful charge's `transfer` field.
643
+ attr_accessor :destination
644
+
645
+ def initialize(amount: nil, destination: nil)
646
+ @amount = amount
647
+ @destination = destination
648
+ end
649
+ end
650
+ # 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. The amount of the application fee collected will be capped at the total amount captured. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
651
+ attr_accessor :application_fee_amount
652
+ # Controls when the funds will be captured from the customer's account.
653
+ attr_accessor :capture_method
654
+ # An arbitrary string attached to the object. Often useful for displaying to users.
655
+ attr_accessor :description
656
+ # 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`.
657
+ attr_accessor :metadata
658
+ # The Stripe account ID for which these funds are intended. For details,
659
+ # see the PaymentIntents [use case for connected
660
+ # accounts](/docs/payments/connected-accounts).
661
+ attr_accessor :on_behalf_of
662
+ # Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails).
663
+ attr_accessor :receipt_email
664
+ # Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment
665
+ # method collected by this Checkout Session.
666
+ #
667
+ # When setting this to `on_session`, Checkout will show a notice to the
668
+ # customer that their payment details will be saved.
669
+ #
670
+ # When setting this to `off_session`, Checkout will show a notice to the
671
+ # customer that their payment details will be saved and used for future
672
+ # payments.
673
+ #
674
+ # If a Customer has been provided or Checkout creates a new Customer,
675
+ # Checkout will attach the payment method to the Customer.
676
+ #
677
+ # If Checkout does not create a Customer, the payment method is not attached
678
+ # to a Customer. To reuse the payment method, you can retrieve it from the
679
+ # Checkout Session's PaymentIntent.
680
+ #
681
+ # When processing card payments, Checkout also uses `setup_future_usage`
682
+ # to dynamically optimize your payment flow and comply with regional
683
+ # legislation and network rules, such as SCA.
684
+ attr_accessor :setup_future_usage
685
+ # Shipping information for this payment.
686
+ attr_accessor :shipping
687
+ # 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).
688
+ #
689
+ # 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.
690
+ attr_accessor :statement_descriptor
691
+ # 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.
692
+ attr_accessor :statement_descriptor_suffix
693
+ # The parameters used to automatically create a Transfer when the payment succeeds.
694
+ # For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
695
+ attr_accessor :transfer_data
696
+ # 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.
697
+ attr_accessor :transfer_group
698
+
699
+ def initialize(
700
+ application_fee_amount: nil,
701
+ capture_method: nil,
702
+ description: nil,
703
+ metadata: nil,
704
+ on_behalf_of: nil,
705
+ receipt_email: nil,
706
+ setup_future_usage: nil,
707
+ shipping: nil,
708
+ statement_descriptor: nil,
709
+ statement_descriptor_suffix: nil,
710
+ transfer_data: nil,
711
+ transfer_group: nil
712
+ )
713
+ @application_fee_amount = application_fee_amount
714
+ @capture_method = capture_method
715
+ @description = description
716
+ @metadata = metadata
717
+ @on_behalf_of = on_behalf_of
718
+ @receipt_email = receipt_email
719
+ @setup_future_usage = setup_future_usage
720
+ @shipping = shipping
721
+ @statement_descriptor = statement_descriptor
722
+ @statement_descriptor_suffix = statement_descriptor_suffix
723
+ @transfer_data = transfer_data
724
+ @transfer_group = transfer_group
725
+ end
726
+ end
727
+
728
+ class PaymentMethodData < Stripe::RequestParams
729
+ # Allow redisplay will be set on the payment method on confirmation and indicates whether this payment method can be shown again to the customer in a checkout flow. Only set this field if you wish to override the allow_redisplay value determined by Checkout.
730
+ attr_accessor :allow_redisplay
731
+
732
+ def initialize(allow_redisplay: nil)
733
+ @allow_redisplay = allow_redisplay
734
+ end
735
+ end
736
+
737
+ class PaymentMethodOptions < Stripe::RequestParams
738
+ class AcssDebit < Stripe::RequestParams
739
+ class MandateOptions < Stripe::RequestParams
740
+ # A URL for custom mandate text to render during confirmation step.
741
+ # The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,
742
+ # or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent.
743
+ attr_accessor :custom_mandate_url
744
+ # List of Stripe products where this mandate can be selected automatically. Only usable in `setup` mode.
745
+ attr_accessor :default_for
746
+ # Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'.
747
+ attr_accessor :interval_description
748
+ # Payment schedule for the mandate.
749
+ attr_accessor :payment_schedule
750
+ # Transaction type of the mandate.
751
+ attr_accessor :transaction_type
752
+
753
+ def initialize(
754
+ custom_mandate_url: nil,
755
+ default_for: nil,
756
+ interval_description: nil,
757
+ payment_schedule: nil,
758
+ transaction_type: nil
759
+ )
760
+ @custom_mandate_url = custom_mandate_url
761
+ @default_for = default_for
762
+ @interval_description = interval_description
763
+ @payment_schedule = payment_schedule
764
+ @transaction_type = transaction_type
765
+ end
766
+ end
767
+ # 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). This is only accepted for Checkout Sessions in `setup` mode.
768
+ attr_accessor :currency
769
+ # Additional fields for Mandate creation
770
+ attr_accessor :mandate_options
771
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
772
+ #
773
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
774
+ #
775
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
776
+ #
777
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
778
+ attr_accessor :setup_future_usage
779
+ # Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now.
780
+ attr_accessor :target_date
781
+ # Verification method for the intent
782
+ attr_accessor :verification_method
783
+
784
+ def initialize(
785
+ currency: nil,
786
+ mandate_options: nil,
787
+ setup_future_usage: nil,
788
+ target_date: nil,
789
+ verification_method: nil
790
+ )
791
+ @currency = currency
792
+ @mandate_options = mandate_options
793
+ @setup_future_usage = setup_future_usage
794
+ @target_date = target_date
795
+ @verification_method = verification_method
796
+ end
797
+ end
798
+
799
+ class Affirm < Stripe::RequestParams
800
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
801
+ #
802
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
803
+ #
804
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
805
+ #
806
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
807
+ attr_accessor :setup_future_usage
808
+
809
+ def initialize(setup_future_usage: nil)
810
+ @setup_future_usage = setup_future_usage
811
+ end
812
+ end
813
+
814
+ class AfterpayClearpay < Stripe::RequestParams
815
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
816
+ #
817
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
818
+ #
819
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
820
+ #
821
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
822
+ attr_accessor :setup_future_usage
823
+
824
+ def initialize(setup_future_usage: nil)
825
+ @setup_future_usage = setup_future_usage
826
+ end
827
+ end
828
+
829
+ class Alipay < Stripe::RequestParams
830
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
831
+ #
832
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
833
+ #
834
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
835
+ #
836
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
837
+ attr_accessor :setup_future_usage
838
+
839
+ def initialize(setup_future_usage: nil)
840
+ @setup_future_usage = setup_future_usage
841
+ end
842
+ end
843
+
844
+ class AmazonPay < Stripe::RequestParams
845
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
846
+ #
847
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
848
+ #
849
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
850
+ #
851
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
852
+ attr_accessor :setup_future_usage
853
+
854
+ def initialize(setup_future_usage: nil)
855
+ @setup_future_usage = setup_future_usage
856
+ end
857
+ end
858
+
859
+ class AuBecsDebit < Stripe::RequestParams
860
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
861
+ #
862
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
863
+ #
864
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
865
+ #
866
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
867
+ attr_accessor :setup_future_usage
868
+ # Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now.
869
+ attr_accessor :target_date
870
+
871
+ def initialize(setup_future_usage: nil, target_date: nil)
872
+ @setup_future_usage = setup_future_usage
873
+ @target_date = target_date
874
+ end
875
+ end
876
+
877
+ class BacsDebit < Stripe::RequestParams
878
+ class MandateOptions < Stripe::RequestParams
879
+ # Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'DDIC' or 'STRIPE'.
880
+ attr_accessor :reference_prefix
881
+
882
+ def initialize(reference_prefix: nil)
883
+ @reference_prefix = reference_prefix
884
+ end
885
+ end
886
+ # Additional fields for Mandate creation
887
+ attr_accessor :mandate_options
888
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
889
+ #
890
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
891
+ #
892
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
893
+ #
894
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
895
+ attr_accessor :setup_future_usage
896
+ # Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now.
897
+ attr_accessor :target_date
898
+
899
+ def initialize(mandate_options: nil, setup_future_usage: nil, target_date: nil)
900
+ @mandate_options = mandate_options
901
+ @setup_future_usage = setup_future_usage
902
+ @target_date = target_date
903
+ end
904
+ end
905
+
906
+ class Bancontact < Stripe::RequestParams
907
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
908
+ #
909
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
910
+ #
911
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
912
+ #
913
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
914
+ attr_accessor :setup_future_usage
915
+
916
+ def initialize(setup_future_usage: nil)
917
+ @setup_future_usage = setup_future_usage
918
+ end
919
+ end
920
+
921
+ class Boleto < Stripe::RequestParams
922
+ # The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time.
923
+ attr_accessor :expires_after_days
924
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
925
+ #
926
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
927
+ #
928
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
929
+ #
930
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
931
+ attr_accessor :setup_future_usage
932
+
933
+ def initialize(expires_after_days: nil, setup_future_usage: nil)
934
+ @expires_after_days = expires_after_days
935
+ @setup_future_usage = setup_future_usage
936
+ end
937
+ end
938
+
939
+ class Card < Stripe::RequestParams
940
+ class Installments < Stripe::RequestParams
941
+ # Setting to true enables installments for this Checkout Session.
942
+ # Setting to false will prevent any installment plan from applying to a payment.
943
+ attr_accessor :enabled
944
+
945
+ def initialize(enabled: nil)
946
+ @enabled = enabled
947
+ end
948
+ end
949
+
950
+ class Restrictions < Stripe::RequestParams
951
+ # Specify the card brands to block in the Checkout Session. If a customer enters or selects a card belonging to a blocked brand, they can't complete the Session.
952
+ attr_accessor :brands_blocked
953
+
954
+ def initialize(brands_blocked: nil)
955
+ @brands_blocked = brands_blocked
956
+ end
957
+ end
958
+ # Installment options for card payments
959
+ attr_accessor :installments
960
+ # Request ability to [capture beyond the standard authorization validity window](/payments/extended-authorization) for this CheckoutSession.
961
+ attr_accessor :request_extended_authorization
962
+ # Request ability to [increment the authorization](/payments/incremental-authorization) for this CheckoutSession.
963
+ attr_accessor :request_incremental_authorization
964
+ # Request ability to make [multiple captures](/payments/multicapture) for this CheckoutSession.
965
+ attr_accessor :request_multicapture
966
+ # Request ability to [overcapture](/payments/overcapture) for this CheckoutSession.
967
+ attr_accessor :request_overcapture
968
+ # We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
969
+ attr_accessor :request_three_d_secure
970
+ # Restrictions to apply to the card payment method. For example, you can block specific card brands.
971
+ attr_accessor :restrictions
972
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
973
+ #
974
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
975
+ #
976
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
977
+ #
978
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
979
+ attr_accessor :setup_future_usage
980
+ # Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters.
981
+ attr_accessor :statement_descriptor_suffix_kana
982
+ # Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters.
983
+ attr_accessor :statement_descriptor_suffix_kanji
984
+
985
+ def initialize(
986
+ installments: nil,
987
+ request_extended_authorization: nil,
988
+ request_incremental_authorization: nil,
989
+ request_multicapture: nil,
990
+ request_overcapture: nil,
991
+ request_three_d_secure: nil,
992
+ restrictions: nil,
993
+ setup_future_usage: nil,
994
+ statement_descriptor_suffix_kana: nil,
995
+ statement_descriptor_suffix_kanji: nil
996
+ )
997
+ @installments = installments
998
+ @request_extended_authorization = request_extended_authorization
999
+ @request_incremental_authorization = request_incremental_authorization
1000
+ @request_multicapture = request_multicapture
1001
+ @request_overcapture = request_overcapture
1002
+ @request_three_d_secure = request_three_d_secure
1003
+ @restrictions = restrictions
1004
+ @setup_future_usage = setup_future_usage
1005
+ @statement_descriptor_suffix_kana = statement_descriptor_suffix_kana
1006
+ @statement_descriptor_suffix_kanji = statement_descriptor_suffix_kanji
1007
+ end
1008
+ end
1009
+
1010
+ class Cashapp < Stripe::RequestParams
1011
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1012
+ #
1013
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1014
+ #
1015
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1016
+ #
1017
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1018
+ attr_accessor :setup_future_usage
1019
+
1020
+ def initialize(setup_future_usage: nil)
1021
+ @setup_future_usage = setup_future_usage
1022
+ end
1023
+ end
1024
+
1025
+ class CustomerBalance < Stripe::RequestParams
1026
+ class BankTransfer < Stripe::RequestParams
1027
+ class EuBankTransfer < Stripe::RequestParams
1028
+ # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
1029
+ attr_accessor :country
1030
+
1031
+ def initialize(country: nil)
1032
+ @country = country
1033
+ end
1034
+ end
1035
+ # Configuration for eu_bank_transfer funding type.
1036
+ attr_accessor :eu_bank_transfer
1037
+ # List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned.
1038
+ #
1039
+ # Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
1040
+ attr_accessor :requested_address_types
1041
+ # The list of bank transfer types that this PaymentIntent is allowed to use for funding.
1042
+ attr_accessor :type
1043
+
1044
+ def initialize(eu_bank_transfer: nil, requested_address_types: nil, type: nil)
1045
+ @eu_bank_transfer = eu_bank_transfer
1046
+ @requested_address_types = requested_address_types
1047
+ @type = type
1048
+ end
1049
+ end
1050
+ # Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
1051
+ attr_accessor :bank_transfer
1052
+ # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.
1053
+ attr_accessor :funding_type
1054
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1055
+ #
1056
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1057
+ #
1058
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1059
+ #
1060
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1061
+ attr_accessor :setup_future_usage
1062
+
1063
+ def initialize(bank_transfer: nil, funding_type: nil, setup_future_usage: nil)
1064
+ @bank_transfer = bank_transfer
1065
+ @funding_type = funding_type
1066
+ @setup_future_usage = setup_future_usage
1067
+ end
1068
+ end
1069
+
1070
+ class Eps < Stripe::RequestParams
1071
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1072
+ #
1073
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1074
+ #
1075
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1076
+ #
1077
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1078
+ attr_accessor :setup_future_usage
1079
+
1080
+ def initialize(setup_future_usage: nil)
1081
+ @setup_future_usage = setup_future_usage
1082
+ end
1083
+ end
1084
+
1085
+ class Fpx < Stripe::RequestParams
1086
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1087
+ #
1088
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1089
+ #
1090
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1091
+ #
1092
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1093
+ attr_accessor :setup_future_usage
1094
+
1095
+ def initialize(setup_future_usage: nil)
1096
+ @setup_future_usage = setup_future_usage
1097
+ end
1098
+ end
1099
+
1100
+ class Giropay < Stripe::RequestParams
1101
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1102
+ #
1103
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1104
+ #
1105
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1106
+ #
1107
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1108
+ attr_accessor :setup_future_usage
1109
+
1110
+ def initialize(setup_future_usage: nil)
1111
+ @setup_future_usage = setup_future_usage
1112
+ end
1113
+ end
1114
+
1115
+ class Grabpay < Stripe::RequestParams
1116
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1117
+ #
1118
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1119
+ #
1120
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1121
+ #
1122
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1123
+ attr_accessor :setup_future_usage
1124
+
1125
+ def initialize(setup_future_usage: nil)
1126
+ @setup_future_usage = setup_future_usage
1127
+ end
1128
+ end
1129
+
1130
+ class Ideal < Stripe::RequestParams
1131
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1132
+ #
1133
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1134
+ #
1135
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1136
+ #
1137
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1138
+ attr_accessor :setup_future_usage
1139
+
1140
+ def initialize(setup_future_usage: nil)
1141
+ @setup_future_usage = setup_future_usage
1142
+ end
1143
+ end
1144
+
1145
+ class KakaoPay < Stripe::RequestParams
1146
+ # Controls when the funds will be captured from the customer's account.
1147
+ attr_accessor :capture_method
1148
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1149
+ #
1150
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1151
+ #
1152
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1153
+ #
1154
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1155
+ attr_accessor :setup_future_usage
1156
+
1157
+ def initialize(capture_method: nil, setup_future_usage: nil)
1158
+ @capture_method = capture_method
1159
+ @setup_future_usage = setup_future_usage
1160
+ end
1161
+ end
1162
+
1163
+ class Klarna < Stripe::RequestParams
1164
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1165
+ #
1166
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1167
+ #
1168
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1169
+ #
1170
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1171
+ attr_accessor :setup_future_usage
1172
+
1173
+ def initialize(setup_future_usage: nil)
1174
+ @setup_future_usage = setup_future_usage
1175
+ end
1176
+ end
1177
+
1178
+ class Konbini < Stripe::RequestParams
1179
+ # The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days.
1180
+ attr_accessor :expires_after_days
1181
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1182
+ #
1183
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1184
+ #
1185
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1186
+ #
1187
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1188
+ attr_accessor :setup_future_usage
1189
+
1190
+ def initialize(expires_after_days: nil, setup_future_usage: nil)
1191
+ @expires_after_days = expires_after_days
1192
+ @setup_future_usage = setup_future_usage
1193
+ end
1194
+ end
1195
+
1196
+ class KrCard < Stripe::RequestParams
1197
+ # Controls when the funds will be captured from the customer's account.
1198
+ attr_accessor :capture_method
1199
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1200
+ #
1201
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1202
+ #
1203
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1204
+ #
1205
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1206
+ attr_accessor :setup_future_usage
1207
+
1208
+ def initialize(capture_method: nil, setup_future_usage: nil)
1209
+ @capture_method = capture_method
1210
+ @setup_future_usage = setup_future_usage
1211
+ end
1212
+ end
1213
+
1214
+ class Link < Stripe::RequestParams
1215
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1216
+ #
1217
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1218
+ #
1219
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1220
+ #
1221
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1222
+ attr_accessor :setup_future_usage
1223
+
1224
+ def initialize(setup_future_usage: nil)
1225
+ @setup_future_usage = setup_future_usage
1226
+ end
1227
+ end
1228
+
1229
+ class Mobilepay < Stripe::RequestParams
1230
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1231
+ #
1232
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1233
+ #
1234
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1235
+ #
1236
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1237
+ attr_accessor :setup_future_usage
1238
+
1239
+ def initialize(setup_future_usage: nil)
1240
+ @setup_future_usage = setup_future_usage
1241
+ end
1242
+ end
1243
+
1244
+ class Multibanco < Stripe::RequestParams
1245
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1246
+ #
1247
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1248
+ #
1249
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1250
+ #
1251
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1252
+ attr_accessor :setup_future_usage
1253
+
1254
+ def initialize(setup_future_usage: nil)
1255
+ @setup_future_usage = setup_future_usage
1256
+ end
1257
+ end
1258
+
1259
+ class NaverPay < Stripe::RequestParams
1260
+ # Controls when the funds will be captured from the customer's account.
1261
+ attr_accessor :capture_method
1262
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1263
+ #
1264
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1265
+ #
1266
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1267
+ #
1268
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1269
+ attr_accessor :setup_future_usage
1270
+
1271
+ def initialize(capture_method: nil, setup_future_usage: nil)
1272
+ @capture_method = capture_method
1273
+ @setup_future_usage = setup_future_usage
1274
+ end
1275
+ end
1276
+
1277
+ class Oxxo < Stripe::RequestParams
1278
+ # The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time.
1279
+ attr_accessor :expires_after_days
1280
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1281
+ #
1282
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1283
+ #
1284
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1285
+ #
1286
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1287
+ attr_accessor :setup_future_usage
1288
+
1289
+ def initialize(expires_after_days: nil, setup_future_usage: nil)
1290
+ @expires_after_days = expires_after_days
1291
+ @setup_future_usage = setup_future_usage
1292
+ end
1293
+ end
1294
+
1295
+ class P24 < Stripe::RequestParams
1296
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1297
+ #
1298
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1299
+ #
1300
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1301
+ #
1302
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1303
+ attr_accessor :setup_future_usage
1304
+ # Confirm that the payer has accepted the P24 terms and conditions.
1305
+ attr_accessor :tos_shown_and_accepted
1306
+
1307
+ def initialize(setup_future_usage: nil, tos_shown_and_accepted: nil)
1308
+ @setup_future_usage = setup_future_usage
1309
+ @tos_shown_and_accepted = tos_shown_and_accepted
1310
+ end
1311
+ end
1312
+
1313
+ class PayByBank < Stripe::RequestParams; end
1314
+
1315
+ class Payco < Stripe::RequestParams
1316
+ # Controls when the funds will be captured from the customer's account.
1317
+ attr_accessor :capture_method
1318
+
1319
+ def initialize(capture_method: nil)
1320
+ @capture_method = capture_method
1321
+ end
1322
+ end
1323
+
1324
+ class Paynow < Stripe::RequestParams
1325
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1326
+ #
1327
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1328
+ #
1329
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1330
+ #
1331
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1332
+ attr_accessor :setup_future_usage
1333
+
1334
+ def initialize(setup_future_usage: nil)
1335
+ @setup_future_usage = setup_future_usage
1336
+ end
1337
+ end
1338
+
1339
+ class Paypal < Stripe::RequestParams
1340
+ # Controls when the funds will be captured from the customer's account.
1341
+ attr_accessor :capture_method
1342
+ # [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to.
1343
+ attr_accessor :preferred_locale
1344
+ # A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID.
1345
+ attr_accessor :reference
1346
+ # The risk correlation ID for an on-session payment using a saved PayPal payment method.
1347
+ attr_accessor :risk_correlation_id
1348
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1349
+ #
1350
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1351
+ #
1352
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1353
+ #
1354
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1355
+ #
1356
+ # If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
1357
+ attr_accessor :setup_future_usage
1358
+
1359
+ def initialize(
1360
+ capture_method: nil,
1361
+ preferred_locale: nil,
1362
+ reference: nil,
1363
+ risk_correlation_id: nil,
1364
+ setup_future_usage: nil
1365
+ )
1366
+ @capture_method = capture_method
1367
+ @preferred_locale = preferred_locale
1368
+ @reference = reference
1369
+ @risk_correlation_id = risk_correlation_id
1370
+ @setup_future_usage = setup_future_usage
1371
+ end
1372
+ end
1373
+
1374
+ class Pix < Stripe::RequestParams
1375
+ # The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds.
1376
+ attr_accessor :expires_after_seconds
1377
+
1378
+ def initialize(expires_after_seconds: nil)
1379
+ @expires_after_seconds = expires_after_seconds
1380
+ end
1381
+ end
1382
+
1383
+ class RevolutPay < Stripe::RequestParams
1384
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1385
+ #
1386
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1387
+ #
1388
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1389
+ #
1390
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1391
+ attr_accessor :setup_future_usage
1392
+
1393
+ def initialize(setup_future_usage: nil)
1394
+ @setup_future_usage = setup_future_usage
1395
+ end
1396
+ end
1397
+
1398
+ class SamsungPay < Stripe::RequestParams
1399
+ # Controls when the funds will be captured from the customer's account.
1400
+ attr_accessor :capture_method
1401
+
1402
+ def initialize(capture_method: nil)
1403
+ @capture_method = capture_method
1404
+ end
1405
+ end
1406
+
1407
+ class SepaDebit < Stripe::RequestParams
1408
+ class MandateOptions < Stripe::RequestParams
1409
+ # Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'.
1410
+ attr_accessor :reference_prefix
1411
+
1412
+ def initialize(reference_prefix: nil)
1413
+ @reference_prefix = reference_prefix
1414
+ end
1415
+ end
1416
+ # Additional fields for Mandate creation
1417
+ attr_accessor :mandate_options
1418
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1419
+ #
1420
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1421
+ #
1422
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1423
+ #
1424
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1425
+ attr_accessor :setup_future_usage
1426
+ # Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now.
1427
+ attr_accessor :target_date
1428
+
1429
+ def initialize(mandate_options: nil, setup_future_usage: nil, target_date: nil)
1430
+ @mandate_options = mandate_options
1431
+ @setup_future_usage = setup_future_usage
1432
+ @target_date = target_date
1433
+ end
1434
+ end
1435
+
1436
+ class Sofort < Stripe::RequestParams
1437
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1438
+ #
1439
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1440
+ #
1441
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1442
+ #
1443
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1444
+ attr_accessor :setup_future_usage
1445
+
1446
+ def initialize(setup_future_usage: nil)
1447
+ @setup_future_usage = setup_future_usage
1448
+ end
1449
+ end
1450
+
1451
+ class Swish < Stripe::RequestParams
1452
+ # The order reference that will be displayed to customers in the Swish application. Defaults to the `id` of the Payment Intent.
1453
+ attr_accessor :reference
1454
+
1455
+ def initialize(reference: nil)
1456
+ @reference = reference
1457
+ end
1458
+ end
1459
+
1460
+ class UsBankAccount < Stripe::RequestParams
1461
+ class FinancialConnections < Stripe::RequestParams
1462
+ # The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
1463
+ attr_accessor :permissions
1464
+ # List of data features that you would like to retrieve upon account creation.
1465
+ attr_accessor :prefetch
1466
+
1467
+ def initialize(permissions: nil, prefetch: nil)
1468
+ @permissions = permissions
1469
+ @prefetch = prefetch
1470
+ end
1471
+ end
1472
+ # Additional fields for Financial Connections Session creation
1473
+ attr_accessor :financial_connections
1474
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1475
+ #
1476
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1477
+ #
1478
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1479
+ #
1480
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1481
+ attr_accessor :setup_future_usage
1482
+ # Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now.
1483
+ attr_accessor :target_date
1484
+ # Verification method for the intent
1485
+ attr_accessor :verification_method
1486
+
1487
+ def initialize(
1488
+ financial_connections: nil,
1489
+ setup_future_usage: nil,
1490
+ target_date: nil,
1491
+ verification_method: nil
1492
+ )
1493
+ @financial_connections = financial_connections
1494
+ @setup_future_usage = setup_future_usage
1495
+ @target_date = target_date
1496
+ @verification_method = verification_method
1497
+ end
1498
+ end
1499
+
1500
+ class WechatPay < Stripe::RequestParams
1501
+ # The app ID registered with WeChat Pay. Only required when client is ios or android.
1502
+ attr_accessor :app_id
1503
+ # The client type that the end customer will pay from
1504
+ attr_accessor :client
1505
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1506
+ #
1507
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1508
+ #
1509
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1510
+ #
1511
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1512
+ attr_accessor :setup_future_usage
1513
+
1514
+ def initialize(app_id: nil, client: nil, setup_future_usage: nil)
1515
+ @app_id = app_id
1516
+ @client = client
1517
+ @setup_future_usage = setup_future_usage
1518
+ end
1519
+ end
1520
+ # contains details about the ACSS Debit payment method options.
1521
+ attr_accessor :acss_debit
1522
+ # contains details about the Affirm payment method options.
1523
+ attr_accessor :affirm
1524
+ # contains details about the Afterpay Clearpay payment method options.
1525
+ attr_accessor :afterpay_clearpay
1526
+ # contains details about the Alipay payment method options.
1527
+ attr_accessor :alipay
1528
+ # contains details about the AmazonPay payment method options.
1529
+ attr_accessor :amazon_pay
1530
+ # contains details about the AU Becs Debit payment method options.
1531
+ attr_accessor :au_becs_debit
1532
+ # contains details about the Bacs Debit payment method options.
1533
+ attr_accessor :bacs_debit
1534
+ # contains details about the Bancontact payment method options.
1535
+ attr_accessor :bancontact
1536
+ # contains details about the Boleto payment method options.
1537
+ attr_accessor :boleto
1538
+ # contains details about the Card payment method options.
1539
+ attr_accessor :card
1540
+ # contains details about the Cashapp Pay payment method options.
1541
+ attr_accessor :cashapp
1542
+ # contains details about the Customer Balance payment method options.
1543
+ attr_accessor :customer_balance
1544
+ # contains details about the EPS payment method options.
1545
+ attr_accessor :eps
1546
+ # contains details about the FPX payment method options.
1547
+ attr_accessor :fpx
1548
+ # contains details about the Giropay payment method options.
1549
+ attr_accessor :giropay
1550
+ # contains details about the Grabpay payment method options.
1551
+ attr_accessor :grabpay
1552
+ # contains details about the Ideal payment method options.
1553
+ attr_accessor :ideal
1554
+ # contains details about the Kakao Pay payment method options.
1555
+ attr_accessor :kakao_pay
1556
+ # contains details about the Klarna payment method options.
1557
+ attr_accessor :klarna
1558
+ # contains details about the Konbini payment method options.
1559
+ attr_accessor :konbini
1560
+ # contains details about the Korean card payment method options.
1561
+ attr_accessor :kr_card
1562
+ # contains details about the Link payment method options.
1563
+ attr_accessor :link
1564
+ # contains details about the Mobilepay payment method options.
1565
+ attr_accessor :mobilepay
1566
+ # contains details about the Multibanco payment method options.
1567
+ attr_accessor :multibanco
1568
+ # contains details about the Naver Pay payment method options.
1569
+ attr_accessor :naver_pay
1570
+ # contains details about the OXXO payment method options.
1571
+ attr_accessor :oxxo
1572
+ # contains details about the P24 payment method options.
1573
+ attr_accessor :p24
1574
+ # contains details about the Pay By Bank payment method options.
1575
+ attr_accessor :pay_by_bank
1576
+ # contains details about the PAYCO payment method options.
1577
+ attr_accessor :payco
1578
+ # contains details about the PayNow payment method options.
1579
+ attr_accessor :paynow
1580
+ # contains details about the PayPal payment method options.
1581
+ attr_accessor :paypal
1582
+ # contains details about the Pix payment method options.
1583
+ attr_accessor :pix
1584
+ # contains details about the RevolutPay payment method options.
1585
+ attr_accessor :revolut_pay
1586
+ # contains details about the Samsung Pay payment method options.
1587
+ attr_accessor :samsung_pay
1588
+ # contains details about the Sepa Debit payment method options.
1589
+ attr_accessor :sepa_debit
1590
+ # contains details about the Sofort payment method options.
1591
+ attr_accessor :sofort
1592
+ # contains details about the Swish payment method options.
1593
+ attr_accessor :swish
1594
+ # contains details about the Us Bank Account payment method options.
1595
+ attr_accessor :us_bank_account
1596
+ # contains details about the WeChat Pay payment method options.
1597
+ attr_accessor :wechat_pay
1598
+
1599
+ def initialize(
1600
+ acss_debit: nil,
1601
+ affirm: nil,
1602
+ afterpay_clearpay: nil,
1603
+ alipay: nil,
1604
+ amazon_pay: nil,
1605
+ au_becs_debit: nil,
1606
+ bacs_debit: nil,
1607
+ bancontact: nil,
1608
+ boleto: nil,
1609
+ card: nil,
1610
+ cashapp: nil,
1611
+ customer_balance: nil,
1612
+ eps: nil,
1613
+ fpx: nil,
1614
+ giropay: nil,
1615
+ grabpay: nil,
1616
+ ideal: nil,
1617
+ kakao_pay: nil,
1618
+ klarna: nil,
1619
+ konbini: nil,
1620
+ kr_card: nil,
1621
+ link: nil,
1622
+ mobilepay: nil,
1623
+ multibanco: nil,
1624
+ naver_pay: nil,
1625
+ oxxo: nil,
1626
+ p24: nil,
1627
+ pay_by_bank: nil,
1628
+ payco: nil,
1629
+ paynow: nil,
1630
+ paypal: nil,
1631
+ pix: nil,
1632
+ revolut_pay: nil,
1633
+ samsung_pay: nil,
1634
+ sepa_debit: nil,
1635
+ sofort: nil,
1636
+ swish: nil,
1637
+ us_bank_account: nil,
1638
+ wechat_pay: nil
1639
+ )
1640
+ @acss_debit = acss_debit
1641
+ @affirm = affirm
1642
+ @afterpay_clearpay = afterpay_clearpay
1643
+ @alipay = alipay
1644
+ @amazon_pay = amazon_pay
1645
+ @au_becs_debit = au_becs_debit
1646
+ @bacs_debit = bacs_debit
1647
+ @bancontact = bancontact
1648
+ @boleto = boleto
1649
+ @card = card
1650
+ @cashapp = cashapp
1651
+ @customer_balance = customer_balance
1652
+ @eps = eps
1653
+ @fpx = fpx
1654
+ @giropay = giropay
1655
+ @grabpay = grabpay
1656
+ @ideal = ideal
1657
+ @kakao_pay = kakao_pay
1658
+ @klarna = klarna
1659
+ @konbini = konbini
1660
+ @kr_card = kr_card
1661
+ @link = link
1662
+ @mobilepay = mobilepay
1663
+ @multibanco = multibanco
1664
+ @naver_pay = naver_pay
1665
+ @oxxo = oxxo
1666
+ @p24 = p24
1667
+ @pay_by_bank = pay_by_bank
1668
+ @payco = payco
1669
+ @paynow = paynow
1670
+ @paypal = paypal
1671
+ @pix = pix
1672
+ @revolut_pay = revolut_pay
1673
+ @samsung_pay = samsung_pay
1674
+ @sepa_debit = sepa_debit
1675
+ @sofort = sofort
1676
+ @swish = swish
1677
+ @us_bank_account = us_bank_account
1678
+ @wechat_pay = wechat_pay
1679
+ end
1680
+ end
1681
+
1682
+ class Permissions < Stripe::RequestParams
1683
+ # Determines which entity is allowed to update the shipping details.
1684
+ #
1685
+ # Default is `client_only`. Stripe Checkout client will automatically update the shipping details. If set to `server_only`, only your server is allowed to update the shipping details.
1686
+ #
1687
+ # When set to `server_only`, you must add the onShippingDetailsChange event handler when initializing the Stripe Checkout client and manually update the shipping details from your server using the Stripe API.
1688
+ attr_accessor :update_shipping_details
1689
+
1690
+ def initialize(update_shipping_details: nil)
1691
+ @update_shipping_details = update_shipping_details
1692
+ end
1693
+ end
1694
+
1695
+ class PhoneNumberCollection < Stripe::RequestParams
1696
+ # Set to `true` to enable phone number collection.
1697
+ #
1698
+ # Can only be set in `payment` and `subscription` mode.
1699
+ attr_accessor :enabled
1700
+
1701
+ def initialize(enabled: nil)
1702
+ @enabled = enabled
1703
+ end
1704
+ end
1705
+
1706
+ class SavedPaymentMethodOptions < Stripe::RequestParams
1707
+ # Uses the `allow_redisplay` value of each saved payment method to filter the set presented to a returning customer. By default, only saved payment methods with ’allow_redisplay: ‘always’ are shown in Checkout.
1708
+ attr_accessor :allow_redisplay_filters
1709
+ # Enable customers to choose if they wish to remove their saved payment methods. Disabled by default.
1710
+ attr_accessor :payment_method_remove
1711
+ # Enable customers to choose if they wish to save their payment method for future use. Disabled by default.
1712
+ attr_accessor :payment_method_save
1713
+
1714
+ def initialize(
1715
+ allow_redisplay_filters: nil,
1716
+ payment_method_remove: nil,
1717
+ payment_method_save: nil
1718
+ )
1719
+ @allow_redisplay_filters = allow_redisplay_filters
1720
+ @payment_method_remove = payment_method_remove
1721
+ @payment_method_save = payment_method_save
1722
+ end
1723
+ end
1724
+
1725
+ class SetupIntentData < Stripe::RequestParams
1726
+ # An arbitrary string attached to the object. Often useful for displaying to users.
1727
+ attr_accessor :description
1728
+ # 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`.
1729
+ attr_accessor :metadata
1730
+ # The Stripe account for which the setup is intended.
1731
+ attr_accessor :on_behalf_of
1732
+
1733
+ def initialize(description: nil, metadata: nil, on_behalf_of: nil)
1734
+ @description = description
1735
+ @metadata = metadata
1736
+ @on_behalf_of = on_behalf_of
1737
+ end
1738
+ end
1739
+
1740
+ class ShippingAddressCollection < Stripe::RequestParams
1741
+ # An array of two-letter ISO country codes representing which countries Checkout should provide as options for
1742
+ # shipping locations.
1743
+ attr_accessor :allowed_countries
1744
+
1745
+ def initialize(allowed_countries: nil)
1746
+ @allowed_countries = allowed_countries
1747
+ end
1748
+ end
1749
+
1750
+ class ShippingOption < Stripe::RequestParams
1751
+ class ShippingRateData < Stripe::RequestParams
1752
+ class DeliveryEstimate < Stripe::RequestParams
1753
+ class Maximum < Stripe::RequestParams
1754
+ # A unit of time.
1755
+ attr_accessor :unit
1756
+ # Must be greater than 0.
1757
+ attr_accessor :value
1758
+
1759
+ def initialize(unit: nil, value: nil)
1760
+ @unit = unit
1761
+ @value = value
1762
+ end
1763
+ end
1764
+
1765
+ class Minimum < Stripe::RequestParams
1766
+ # A unit of time.
1767
+ attr_accessor :unit
1768
+ # Must be greater than 0.
1769
+ attr_accessor :value
1770
+
1771
+ def initialize(unit: nil, value: nil)
1772
+ @unit = unit
1773
+ @value = value
1774
+ end
1775
+ end
1776
+ # The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.
1777
+ attr_accessor :maximum
1778
+ # The lower bound of the estimated range. If empty, represents no lower bound.
1779
+ attr_accessor :minimum
1780
+
1781
+ def initialize(maximum: nil, minimum: nil)
1782
+ @maximum = maximum
1783
+ @minimum = minimum
1784
+ end
1785
+ end
1786
+
1787
+ class FixedAmount < Stripe::RequestParams
1788
+ class CurrencyOptions < Stripe::RequestParams
1789
+ # A non-negative integer in cents representing how much to charge.
1790
+ attr_accessor :amount
1791
+ # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
1792
+ attr_accessor :tax_behavior
1793
+
1794
+ def initialize(amount: nil, tax_behavior: nil)
1795
+ @amount = amount
1796
+ @tax_behavior = tax_behavior
1797
+ end
1798
+ end
1799
+ # A non-negative integer in cents representing how much to charge.
1800
+ attr_accessor :amount
1801
+ # 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).
1802
+ attr_accessor :currency
1803
+ # Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
1804
+ attr_accessor :currency_options
1805
+
1806
+ def initialize(amount: nil, currency: nil, currency_options: nil)
1807
+ @amount = amount
1808
+ @currency = currency
1809
+ @currency_options = currency_options
1810
+ end
1811
+ end
1812
+ # The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
1813
+ attr_accessor :delivery_estimate
1814
+ # The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.
1815
+ attr_accessor :display_name
1816
+ # Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.
1817
+ attr_accessor :fixed_amount
1818
+ # 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`.
1819
+ attr_accessor :metadata
1820
+ # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
1821
+ attr_accessor :tax_behavior
1822
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`.
1823
+ attr_accessor :tax_code
1824
+ # The type of calculation to use on the shipping rate.
1825
+ attr_accessor :type
1826
+
1827
+ def initialize(
1828
+ delivery_estimate: nil,
1829
+ display_name: nil,
1830
+ fixed_amount: nil,
1831
+ metadata: nil,
1832
+ tax_behavior: nil,
1833
+ tax_code: nil,
1834
+ type: nil
1835
+ )
1836
+ @delivery_estimate = delivery_estimate
1837
+ @display_name = display_name
1838
+ @fixed_amount = fixed_amount
1839
+ @metadata = metadata
1840
+ @tax_behavior = tax_behavior
1841
+ @tax_code = tax_code
1842
+ @type = type
1843
+ end
1844
+ end
1845
+ # The ID of the Shipping Rate to use for this shipping option.
1846
+ attr_accessor :shipping_rate
1847
+ # Parameters to be passed to Shipping Rate creation for this shipping option.
1848
+ attr_accessor :shipping_rate_data
1849
+
1850
+ def initialize(shipping_rate: nil, shipping_rate_data: nil)
1851
+ @shipping_rate = shipping_rate
1852
+ @shipping_rate_data = shipping_rate_data
1853
+ end
1854
+ end
1855
+
1856
+ class SubscriptionData < Stripe::RequestParams
1857
+ class InvoiceSettings < Stripe::RequestParams
1858
+ class Issuer < Stripe::RequestParams
1859
+ # The connected account being referenced when `type` is `account`.
1860
+ attr_accessor :account
1861
+ # Type of the account referenced in the request.
1862
+ attr_accessor :type
1863
+
1864
+ def initialize(account: nil, type: nil)
1865
+ @account = account
1866
+ @type = type
1867
+ end
1868
+ end
1869
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
1870
+ attr_accessor :issuer
1871
+
1872
+ def initialize(issuer: nil)
1873
+ @issuer = issuer
1874
+ end
1875
+ end
1876
+
1877
+ class TransferData < Stripe::RequestParams
1878
+ # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination.
1879
+ attr_accessor :amount_percent
1880
+ # ID of an existing, connected Stripe account.
1881
+ attr_accessor :destination
1882
+
1883
+ def initialize(amount_percent: nil, destination: nil)
1884
+ @amount_percent = amount_percent
1885
+ @destination = destination
1886
+ end
1887
+ end
1888
+
1889
+ class TrialSettings < Stripe::RequestParams
1890
+ class EndBehavior < Stripe::RequestParams
1891
+ # Indicates how the subscription should change when the trial ends if the user did not provide a payment method.
1892
+ attr_accessor :missing_payment_method
1893
+
1894
+ def initialize(missing_payment_method: nil)
1895
+ @missing_payment_method = missing_payment_method
1896
+ end
1897
+ end
1898
+ # Defines how the subscription should behave when the user's free trial ends.
1899
+ attr_accessor :end_behavior
1900
+
1901
+ def initialize(end_behavior: nil)
1902
+ @end_behavior = end_behavior
1903
+ end
1904
+ end
1905
+ # 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. To use an application fee percent, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).
1906
+ attr_accessor :application_fee_percent
1907
+ # A future timestamp to anchor the subscription's billing cycle for new subscriptions.
1908
+ attr_accessor :billing_cycle_anchor
1909
+ # The tax rates that will apply to any subscription item that does not have
1910
+ # `tax_rates` set. Invoices created will have their `default_tax_rates` populated
1911
+ # from the subscription.
1912
+ attr_accessor :default_tax_rates
1913
+ # The subscription's description, meant to be displayable to the customer.
1914
+ # Use this field to optionally store an explanation of the subscription
1915
+ # for rendering in the [customer portal](https://stripe.com/docs/customer-management).
1916
+ attr_accessor :description
1917
+ # All invoices will be billed using the specified settings.
1918
+ attr_accessor :invoice_settings
1919
+ # 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`.
1920
+ attr_accessor :metadata
1921
+ # The account on behalf of which to charge, for each of the subscription's invoices.
1922
+ attr_accessor :on_behalf_of
1923
+ # Determines how to handle prorations resulting from the `billing_cycle_anchor`. If no value is passed, the default is `create_prorations`.
1924
+ attr_accessor :proration_behavior
1925
+ # If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges.
1926
+ attr_accessor :transfer_data
1927
+ # Unix timestamp representing the end of the trial period the customer
1928
+ # will get before being charged for the first time. Has to be at least
1929
+ # 48 hours in the future.
1930
+ attr_accessor :trial_end
1931
+ # Integer representing the number of trial period days before the
1932
+ # customer is charged for the first time. Has to be at least 1.
1933
+ attr_accessor :trial_period_days
1934
+ # Settings related to subscription trials.
1935
+ attr_accessor :trial_settings
1936
+
1937
+ def initialize(
1938
+ application_fee_percent: nil,
1939
+ billing_cycle_anchor: nil,
1940
+ default_tax_rates: nil,
1941
+ description: nil,
1942
+ invoice_settings: nil,
1943
+ metadata: nil,
1944
+ on_behalf_of: nil,
1945
+ proration_behavior: nil,
1946
+ transfer_data: nil,
1947
+ trial_end: nil,
1948
+ trial_period_days: nil,
1949
+ trial_settings: nil
1950
+ )
1951
+ @application_fee_percent = application_fee_percent
1952
+ @billing_cycle_anchor = billing_cycle_anchor
1953
+ @default_tax_rates = default_tax_rates
1954
+ @description = description
1955
+ @invoice_settings = invoice_settings
1956
+ @metadata = metadata
1957
+ @on_behalf_of = on_behalf_of
1958
+ @proration_behavior = proration_behavior
1959
+ @transfer_data = transfer_data
1960
+ @trial_end = trial_end
1961
+ @trial_period_days = trial_period_days
1962
+ @trial_settings = trial_settings
1963
+ end
1964
+ end
1965
+
1966
+ class TaxIdCollection < Stripe::RequestParams
1967
+ # Enable tax ID collection during checkout. Defaults to `false`.
1968
+ attr_accessor :enabled
1969
+ # Describes whether a tax ID is required during checkout. Defaults to `never`.
1970
+ attr_accessor :required
1971
+
1972
+ def initialize(enabled: nil, required: nil)
1973
+ @enabled = enabled
1974
+ @required = required
1975
+ end
1976
+ end
1977
+
1978
+ class WalletOptions < Stripe::RequestParams
1979
+ class Link < Stripe::RequestParams
1980
+ # Specifies whether Checkout should display Link as a payment option. By default, Checkout will display all the supported wallets that the Checkout Session was created with. This is the `auto` behavior, and it is the default choice.
1981
+ attr_accessor :display
1982
+
1983
+ def initialize(display: nil)
1984
+ @display = display
1985
+ end
1986
+ end
1987
+ # contains details about the Link wallet options.
1988
+ attr_accessor :link
1989
+
1990
+ def initialize(link: nil)
1991
+ @link = link
1992
+ end
1993
+ end
1994
+ # Settings for price localization with [Adaptive Pricing](https://docs.stripe.com/payments/checkout/adaptive-pricing).
1995
+ attr_accessor :adaptive_pricing
1996
+ # Configure actions after a Checkout Session has expired.
1997
+ attr_accessor :after_expiration
1998
+ # Enables user redeemable promotion codes.
1999
+ attr_accessor :allow_promotion_codes
2000
+ # Settings for automatic tax lookup for this session and resulting payments, invoices, and subscriptions.
2001
+ attr_accessor :automatic_tax
2002
+ # Specify whether Checkout should collect the customer's billing address. Defaults to `auto`.
2003
+ attr_accessor :billing_address_collection
2004
+ # If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. This parameter is not allowed if ui_mode is `embedded` or `custom`.
2005
+ attr_accessor :cancel_url
2006
+ # A unique string to reference the Checkout Session. This can be a
2007
+ # customer ID, a cart ID, or similar, and can be used to reconcile the
2008
+ # session with your internal systems.
2009
+ attr_accessor :client_reference_id
2010
+ # Configure fields for the Checkout Session to gather active consent from customers.
2011
+ attr_accessor :consent_collection
2012
+ # 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). Required in `setup` mode when `payment_method_types` is not set.
2013
+ attr_accessor :currency
2014
+ # Collect additional information from your customer using custom fields. Up to 3 fields are supported.
2015
+ attr_accessor :custom_fields
2016
+ # Display additional text for your customers using custom text.
2017
+ attr_accessor :custom_text
2018
+ # ID of an existing Customer, if one exists. In `payment` mode, the customer’s most recently saved card
2019
+ # payment method will be used to prefill the email, name, card details, and billing address
2020
+ # on the Checkout page. In `subscription` mode, the customer’s [default payment method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method)
2021
+ # will be used if it’s a card, otherwise the most recently saved card will be used. A valid billing address, billing name and billing email are required on the payment method for Checkout to prefill the customer's card details.
2022
+ #
2023
+ # If the Customer already has a valid [email](https://stripe.com/docs/api/customers/object#customer_object-email) set, the email will be prefilled and not editable in Checkout.
2024
+ # If the Customer does not have a valid `email`, Checkout will set the email entered during the session on the Customer.
2025
+ #
2026
+ # If blank for Checkout Sessions in `subscription` mode or with `customer_creation` set as `always` in `payment` mode, Checkout will create a new Customer object based on information provided during the payment flow.
2027
+ #
2028
+ # You can set [`payment_intent_data.setup_future_usage`](https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage) to have Checkout automatically attach the payment method to the Customer you pass in for future reuse.
2029
+ attr_accessor :customer
2030
+ # Configure whether a Checkout Session creates a [Customer](https://stripe.com/docs/api/customers) during Session confirmation.
2031
+ #
2032
+ # When a Customer is not created, you can still retrieve email, address, and other customer data entered in Checkout
2033
+ # with [customer_details](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-customer_details).
2034
+ #
2035
+ # Sessions that don't create Customers instead are grouped by [guest customers](https://stripe.com/docs/payments/checkout/guest-customers)
2036
+ # in the Dashboard. Promotion codes limited to first time customers will return invalid for these Sessions.
2037
+ #
2038
+ # Can only be set in `payment` and `setup` mode.
2039
+ attr_accessor :customer_creation
2040
+ # If provided, this value will be used when the Customer object is created.
2041
+ # If not provided, customers will be asked to enter their email address.
2042
+ # Use this parameter to prefill customer data if you already have an email
2043
+ # on file. To access information about the customer once a session is
2044
+ # complete, use the `customer` field.
2045
+ attr_accessor :customer_email
2046
+ # Controls what fields on Customer can be updated by the Checkout Session. Can only be provided when `customer` is provided.
2047
+ attr_accessor :customer_update
2048
+ # The coupon or promotion code to apply to this Session. Currently, only up to one may be specified.
2049
+ attr_accessor :discounts
2050
+ # Specifies which fields in the response should be expanded.
2051
+ attr_accessor :expand
2052
+ # The Epoch time in seconds at which the Checkout Session will expire. It can be anywhere from 30 minutes to 24 hours after Checkout Session creation. By default, this value is 24 hours from creation.
2053
+ attr_accessor :expires_at
2054
+ # Generate a post-purchase Invoice for one-time payments.
2055
+ attr_accessor :invoice_creation
2056
+ # A list of items the customer is purchasing. Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices).
2057
+ #
2058
+ # For `payment` mode, there is a maximum of 100 line items, however it is recommended to consolidate line items if there are more than a few dozen.
2059
+ #
2060
+ # For `subscription` mode, there is a maximum of 20 line items with recurring Prices and 20 line items with one-time Prices. Line items with one-time Prices will be on the initial invoice only.
2061
+ attr_accessor :line_items
2062
+ # The IETF language tag of the locale Checkout is displayed in. If blank or `auto`, the browser's locale is used.
2063
+ attr_accessor :locale
2064
+ # 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`.
2065
+ attr_accessor :metadata
2066
+ # The mode of the Checkout Session. Pass `subscription` if the Checkout Session includes at least one recurring item.
2067
+ attr_accessor :mode
2068
+ # 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).
2069
+ #
2070
+ # There is a maximum of 10 optional items allowed on a Checkout Session, and the existing limits on the number of line items allowed on a Checkout Session apply to the combined number of line items and optional items.
2071
+ #
2072
+ # For `payment` mode, there is a maximum of 100 combined line items and optional items, however it is recommended to consolidate items if there are more than a few dozen.
2073
+ #
2074
+ # For `subscription` mode, there is a maximum of 20 line items and optional items with recurring Prices and 20 line items and optional items with one-time Prices.
2075
+ attr_accessor :optional_items
2076
+ # A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode.
2077
+ attr_accessor :payment_intent_data
2078
+ # 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.
2079
+ # This may occur if the Checkout Session includes a free trial or a discount.
2080
+ #
2081
+ # Can only be set in `subscription` mode. Defaults to `always`.
2082
+ #
2083
+ # 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).
2084
+ attr_accessor :payment_method_collection
2085
+ # The ID of the payment method configuration to use with this Checkout session.
2086
+ attr_accessor :payment_method_configuration
2087
+ # This parameter allows you to set some attributes on the payment method created during a Checkout session.
2088
+ attr_accessor :payment_method_data
2089
+ # Payment-method-specific configuration.
2090
+ attr_accessor :payment_method_options
2091
+ # A list of the types of payment methods (e.g., `card`) this Checkout Session can accept.
2092
+ #
2093
+ # You can omit this attribute to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).
2094
+ # See [Dynamic Payment Methods](https://stripe.com/docs/payments/payment-methods/integration-options#using-dynamic-payment-methods) for more details.
2095
+ #
2096
+ # Read more about the supported payment methods and their requirements in our [payment
2097
+ # method details guide](/docs/payments/checkout/payment-methods).
2098
+ #
2099
+ # If multiple payment methods are passed, Checkout will dynamically reorder them to
2100
+ # prioritize the most relevant payment methods based on the customer's location and
2101
+ # other characteristics.
2102
+ attr_accessor :payment_method_types
2103
+ # This property is used to set up permissions for various actions (e.g., update) on the CheckoutSession object. Can only be set when creating `embedded` or `custom` sessions.
2104
+ #
2105
+ # For specific permissions, please refer to their dedicated subsections, such as `permissions.update_shipping_details`.
2106
+ attr_accessor :permissions
2107
+ # Controls phone number collection settings for the session.
2108
+ #
2109
+ # We recommend that you review your privacy policy and check with your legal contacts
2110
+ # before using this feature. Learn more about [collecting phone numbers with Checkout](https://stripe.com/docs/payments/checkout/phone-numbers).
2111
+ attr_accessor :phone_number_collection
2112
+ # This parameter applies to `ui_mode: embedded`. Learn more about the [redirect behavior](https://stripe.com/docs/payments/checkout/custom-success-page?payment-ui=embedded-form) of embedded sessions. Defaults to `always`.
2113
+ attr_accessor :redirect_on_completion
2114
+ # The URL to redirect your customer back to after they authenticate or cancel their payment on the
2115
+ # payment method's app or site. This parameter is required if `ui_mode` is `embedded` or `custom`
2116
+ # and redirect-based payment methods are enabled on the session.
2117
+ attr_accessor :return_url
2118
+ # Controls saved payment method settings for the session. Only available in `payment` and `subscription` mode.
2119
+ attr_accessor :saved_payment_method_options
2120
+ # A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in `setup` mode.
2121
+ attr_accessor :setup_intent_data
2122
+ # When set, provides configuration for Checkout to collect a shipping address from a customer.
2123
+ attr_accessor :shipping_address_collection
2124
+ # The shipping rate options to apply to this Session. Up to a maximum of 5.
2125
+ attr_accessor :shipping_options
2126
+ # Describes the type of transaction being performed by Checkout in order
2127
+ # to customize relevant text on the page, such as the submit button.
2128
+ # `submit_type` can only be specified on Checkout Sessions in
2129
+ # `payment` or `subscription` mode. If blank or `auto`, `pay` is used.
2130
+ attr_accessor :submit_type
2131
+ # A subset of parameters to be passed to subscription creation for Checkout Sessions in `subscription` mode.
2132
+ attr_accessor :subscription_data
2133
+ # The URL to which Stripe should send customers when payment or setup
2134
+ # is complete.
2135
+ # This parameter is not allowed if ui_mode is `embedded` or `custom`. If you'd like to use
2136
+ # information from the successful Checkout Session on your page, read the
2137
+ # guide on [customizing your success page](https://stripe.com/docs/payments/checkout/custom-success-page).
2138
+ attr_accessor :success_url
2139
+ # Controls tax ID collection during checkout.
2140
+ attr_accessor :tax_id_collection
2141
+ # The UI mode of the Session. Defaults to `hosted`.
2142
+ attr_accessor :ui_mode
2143
+ # Wallet-specific configuration.
2144
+ attr_accessor :wallet_options
2145
+
2146
+ def initialize(
2147
+ adaptive_pricing: nil,
2148
+ after_expiration: nil,
2149
+ allow_promotion_codes: nil,
2150
+ automatic_tax: nil,
2151
+ billing_address_collection: nil,
2152
+ cancel_url: nil,
2153
+ client_reference_id: nil,
2154
+ consent_collection: nil,
2155
+ currency: nil,
2156
+ custom_fields: nil,
2157
+ custom_text: nil,
2158
+ customer: nil,
2159
+ customer_creation: nil,
2160
+ customer_email: nil,
2161
+ customer_update: nil,
2162
+ discounts: nil,
2163
+ expand: nil,
2164
+ expires_at: nil,
2165
+ invoice_creation: nil,
2166
+ line_items: nil,
2167
+ locale: nil,
2168
+ metadata: nil,
2169
+ mode: nil,
2170
+ optional_items: nil,
2171
+ payment_intent_data: nil,
2172
+ payment_method_collection: nil,
2173
+ payment_method_configuration: nil,
2174
+ payment_method_data: nil,
2175
+ payment_method_options: nil,
2176
+ payment_method_types: nil,
2177
+ permissions: nil,
2178
+ phone_number_collection: nil,
2179
+ redirect_on_completion: nil,
2180
+ return_url: nil,
2181
+ saved_payment_method_options: nil,
2182
+ setup_intent_data: nil,
2183
+ shipping_address_collection: nil,
2184
+ shipping_options: nil,
2185
+ submit_type: nil,
2186
+ subscription_data: nil,
2187
+ success_url: nil,
2188
+ tax_id_collection: nil,
2189
+ ui_mode: nil,
2190
+ wallet_options: nil
2191
+ )
2192
+ @adaptive_pricing = adaptive_pricing
2193
+ @after_expiration = after_expiration
2194
+ @allow_promotion_codes = allow_promotion_codes
2195
+ @automatic_tax = automatic_tax
2196
+ @billing_address_collection = billing_address_collection
2197
+ @cancel_url = cancel_url
2198
+ @client_reference_id = client_reference_id
2199
+ @consent_collection = consent_collection
2200
+ @currency = currency
2201
+ @custom_fields = custom_fields
2202
+ @custom_text = custom_text
2203
+ @customer = customer
2204
+ @customer_creation = customer_creation
2205
+ @customer_email = customer_email
2206
+ @customer_update = customer_update
2207
+ @discounts = discounts
2208
+ @expand = expand
2209
+ @expires_at = expires_at
2210
+ @invoice_creation = invoice_creation
2211
+ @line_items = line_items
2212
+ @locale = locale
2213
+ @metadata = metadata
2214
+ @mode = mode
2215
+ @optional_items = optional_items
2216
+ @payment_intent_data = payment_intent_data
2217
+ @payment_method_collection = payment_method_collection
2218
+ @payment_method_configuration = payment_method_configuration
2219
+ @payment_method_data = payment_method_data
2220
+ @payment_method_options = payment_method_options
2221
+ @payment_method_types = payment_method_types
2222
+ @permissions = permissions
2223
+ @phone_number_collection = phone_number_collection
2224
+ @redirect_on_completion = redirect_on_completion
2225
+ @return_url = return_url
2226
+ @saved_payment_method_options = saved_payment_method_options
2227
+ @setup_intent_data = setup_intent_data
2228
+ @shipping_address_collection = shipping_address_collection
2229
+ @shipping_options = shipping_options
2230
+ @submit_type = submit_type
2231
+ @subscription_data = subscription_data
2232
+ @success_url = success_url
2233
+ @tax_id_collection = tax_id_collection
2234
+ @ui_mode = ui_mode
2235
+ @wallet_options = wallet_options
2236
+ end
2237
+ end
2238
+
2239
+ class RetrieveParams < Stripe::RequestParams
2240
+ # Specifies which fields in the response should be expanded.
2241
+ attr_accessor :expand
2242
+
2243
+ def initialize(expand: nil)
2244
+ @expand = expand
2245
+ end
2246
+ end
2247
+
2248
+ class UpdateParams < Stripe::RequestParams
2249
+ class CollectedInformation < Stripe::RequestParams
2250
+ class ShippingDetails < Stripe::RequestParams
2251
+ class Address < Stripe::RequestParams
2252
+ # City, district, suburb, town, or village.
2253
+ attr_accessor :city
2254
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
2255
+ attr_accessor :country
2256
+ # Address line 1 (e.g., street, PO Box, or company name).
2257
+ attr_accessor :line1
2258
+ # Address line 2 (e.g., apartment, suite, unit, or building).
2259
+ attr_accessor :line2
2260
+ # ZIP or postal code.
2261
+ attr_accessor :postal_code
2262
+ # State, county, province, or region.
2263
+ attr_accessor :state
2264
+
2265
+ def initialize(
2266
+ city: nil,
2267
+ country: nil,
2268
+ line1: nil,
2269
+ line2: nil,
2270
+ postal_code: nil,
2271
+ state: nil
2272
+ )
2273
+ @city = city
2274
+ @country = country
2275
+ @line1 = line1
2276
+ @line2 = line2
2277
+ @postal_code = postal_code
2278
+ @state = state
2279
+ end
2280
+ end
2281
+ # The address of the customer
2282
+ attr_accessor :address
2283
+ # The name of customer
2284
+ attr_accessor :name
2285
+
2286
+ def initialize(address: nil, name: nil)
2287
+ @address = address
2288
+ @name = name
2289
+ end
2290
+ end
2291
+ # The shipping details to apply to this Session.
2292
+ attr_accessor :shipping_details
2293
+
2294
+ def initialize(shipping_details: nil)
2295
+ @shipping_details = shipping_details
2296
+ end
2297
+ end
2298
+
2299
+ class ShippingOption < Stripe::RequestParams
2300
+ class ShippingRateData < Stripe::RequestParams
2301
+ class DeliveryEstimate < Stripe::RequestParams
2302
+ class Maximum < Stripe::RequestParams
2303
+ # A unit of time.
2304
+ attr_accessor :unit
2305
+ # Must be greater than 0.
2306
+ attr_accessor :value
2307
+
2308
+ def initialize(unit: nil, value: nil)
2309
+ @unit = unit
2310
+ @value = value
2311
+ end
2312
+ end
2313
+
2314
+ class Minimum < Stripe::RequestParams
2315
+ # A unit of time.
2316
+ attr_accessor :unit
2317
+ # Must be greater than 0.
2318
+ attr_accessor :value
2319
+
2320
+ def initialize(unit: nil, value: nil)
2321
+ @unit = unit
2322
+ @value = value
2323
+ end
2324
+ end
2325
+ # The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.
2326
+ attr_accessor :maximum
2327
+ # The lower bound of the estimated range. If empty, represents no lower bound.
2328
+ attr_accessor :minimum
2329
+
2330
+ def initialize(maximum: nil, minimum: nil)
2331
+ @maximum = maximum
2332
+ @minimum = minimum
2333
+ end
2334
+ end
2335
+
2336
+ class FixedAmount < Stripe::RequestParams
2337
+ class CurrencyOptions < Stripe::RequestParams
2338
+ # A non-negative integer in cents representing how much to charge.
2339
+ attr_accessor :amount
2340
+ # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
2341
+ attr_accessor :tax_behavior
2342
+
2343
+ def initialize(amount: nil, tax_behavior: nil)
2344
+ @amount = amount
2345
+ @tax_behavior = tax_behavior
2346
+ end
2347
+ end
2348
+ # A non-negative integer in cents representing how much to charge.
2349
+ attr_accessor :amount
2350
+ # 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).
2351
+ attr_accessor :currency
2352
+ # Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
2353
+ attr_accessor :currency_options
2354
+
2355
+ def initialize(amount: nil, currency: nil, currency_options: nil)
2356
+ @amount = amount
2357
+ @currency = currency
2358
+ @currency_options = currency_options
2359
+ end
2360
+ end
2361
+ # The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
2362
+ attr_accessor :delivery_estimate
2363
+ # The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.
2364
+ attr_accessor :display_name
2365
+ # Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.
2366
+ attr_accessor :fixed_amount
2367
+ # 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`.
2368
+ attr_accessor :metadata
2369
+ # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
2370
+ attr_accessor :tax_behavior
2371
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`.
2372
+ attr_accessor :tax_code
2373
+ # The type of calculation to use on the shipping rate.
2374
+ attr_accessor :type
2375
+
2376
+ def initialize(
2377
+ delivery_estimate: nil,
2378
+ display_name: nil,
2379
+ fixed_amount: nil,
2380
+ metadata: nil,
2381
+ tax_behavior: nil,
2382
+ tax_code: nil,
2383
+ type: nil
2384
+ )
2385
+ @delivery_estimate = delivery_estimate
2386
+ @display_name = display_name
2387
+ @fixed_amount = fixed_amount
2388
+ @metadata = metadata
2389
+ @tax_behavior = tax_behavior
2390
+ @tax_code = tax_code
2391
+ @type = type
2392
+ end
2393
+ end
2394
+ # The ID of the Shipping Rate to use for this shipping option.
2395
+ attr_accessor :shipping_rate
2396
+ # Parameters to be passed to Shipping Rate creation for this shipping option.
2397
+ attr_accessor :shipping_rate_data
2398
+
2399
+ def initialize(shipping_rate: nil, shipping_rate_data: nil)
2400
+ @shipping_rate = shipping_rate
2401
+ @shipping_rate_data = shipping_rate_data
2402
+ end
2403
+ end
2404
+ # Information about the customer collected within the Checkout Session. Can only be set when updating `embedded` or `custom` sessions.
2405
+ attr_accessor :collected_information
2406
+ # Specifies which fields in the response should be expanded.
2407
+ attr_accessor :expand
2408
+ # 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`.
2409
+ attr_accessor :metadata
2410
+ # The shipping rate options to apply to this Session. Up to a maximum of 5.
2411
+ attr_accessor :shipping_options
2412
+
2413
+ def initialize(
2414
+ collected_information: nil,
2415
+ expand: nil,
2416
+ metadata: nil,
2417
+ shipping_options: nil
2418
+ )
2419
+ @collected_information = collected_information
2420
+ @expand = expand
2421
+ @metadata = metadata
2422
+ @shipping_options = shipping_options
2423
+ end
2424
+ end
2425
+
2426
+ class ExpireParams < Stripe::RequestParams
2427
+ # Specifies which fields in the response should be expanded.
2428
+ attr_accessor :expand
2429
+
2430
+ def initialize(expand: nil)
2431
+ @expand = expand
2432
+ end
2433
+ end
2434
+
2435
+ # Creates a Checkout Session object.
2436
+ def create(params = {}, opts = {})
2437
+ request(
2438
+ method: :post,
2439
+ path: "/v1/checkout/sessions",
2440
+ params: params,
2441
+ opts: opts,
2442
+ base_address: :api
2443
+ )
2444
+ end
2445
+
2446
+ # A Checkout Session can be expired when it is in one of these statuses: open
2447
+ #
2448
+ # After it expires, a customer can't complete a Checkout Session and customers loading the Checkout Session see a message saying the Checkout Session is expired.
2449
+ def expire(session, params = {}, opts = {})
2450
+ request(
2451
+ method: :post,
2452
+ path: format("/v1/checkout/sessions/%<session>s/expire", { session: CGI.escape(session) }),
2453
+ params: params,
2454
+ opts: opts,
2455
+ base_address: :api
2456
+ )
2457
+ end
2458
+
2459
+ # Returns a list of Checkout Sessions.
2460
+ def list(params = {}, opts = {})
2461
+ request(
2462
+ method: :get,
2463
+ path: "/v1/checkout/sessions",
2464
+ params: params,
2465
+ opts: opts,
2466
+ base_address: :api
2467
+ )
2468
+ end
2469
+
2470
+ # Retrieves a Checkout Session object.
2471
+ def retrieve(session, params = {}, opts = {})
2472
+ request(
2473
+ method: :get,
2474
+ path: format("/v1/checkout/sessions/%<session>s", { session: CGI.escape(session) }),
2475
+ params: params,
2476
+ opts: opts,
2477
+ base_address: :api
2478
+ )
2479
+ end
2480
+
2481
+ # Updates a Checkout Session object.
2482
+ #
2483
+ # Related guide: [Dynamically update Checkout](https://docs.stripe.com/payments/checkout/dynamic-updates)
2484
+ def update(session, params = {}, opts = {})
2485
+ request(
2486
+ method: :post,
2487
+ path: format("/v1/checkout/sessions/%<session>s", { session: CGI.escape(session) }),
2488
+ params: params,
2489
+ opts: opts,
2490
+ base_address: :api
2491
+ )
2492
+ end
2493
+ end
2494
+ end
2495
+ end