stripe 5.55.0 → 13.5.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 (380) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +567 -4
  3. data/Gemfile +12 -4
  4. data/Makefile +18 -3
  5. data/OPENAPI_VERSION +1 -0
  6. data/README.md +93 -21
  7. data/Rakefile +3 -6
  8. data/VERSION +1 -1
  9. data/examples/README.md +16 -0
  10. data/examples/example_template.rb +36 -0
  11. data/examples/meter_event_stream.rb +57 -0
  12. data/examples/thinevent_webhook_handler.rb +39 -0
  13. data/{bin → exe}/stripe-console +1 -1
  14. data/justfile +43 -0
  15. data/lib/data/ca-certificates.crt +1241 -1937
  16. data/lib/stripe/api_operations/create.rb +6 -2
  17. data/lib/stripe/api_operations/delete.rb +12 -7
  18. data/lib/stripe/api_operations/list.rb +6 -9
  19. data/lib/stripe/api_operations/nested_resource.rb +63 -35
  20. data/lib/stripe/api_operations/request.rb +29 -65
  21. data/lib/stripe/api_operations/save.rb +20 -10
  22. data/lib/stripe/api_operations/search.rb +11 -9
  23. data/lib/stripe/api_operations/singleton_save.rb +90 -0
  24. data/lib/stripe/api_requestor.rb +1131 -0
  25. data/lib/stripe/api_resource.rb +48 -18
  26. data/lib/stripe/api_resource_test_helpers.rb +9 -3
  27. data/lib/stripe/api_version.rb +8 -0
  28. data/lib/stripe/connection_manager.rb +5 -7
  29. data/lib/stripe/errors.rb +11 -13
  30. data/lib/stripe/event_types.rb +14 -0
  31. data/lib/stripe/events/v1_billing_meter_error_report_triggered_event.rb +23 -0
  32. data/lib/stripe/events/v1_billing_meter_no_meter_found_event.rb +13 -0
  33. data/lib/stripe/instrumentation.rb +37 -15
  34. data/lib/stripe/list_object.rb +5 -3
  35. data/lib/stripe/multipart_encoder.rb +7 -7
  36. data/lib/stripe/oauth.rb +14 -21
  37. data/lib/stripe/object_types.rb +151 -103
  38. data/lib/stripe/request_options.rb +129 -0
  39. data/lib/stripe/resources/account.rb +129 -25
  40. data/lib/stripe/resources/account_link.rb +12 -0
  41. data/lib/stripe/resources/account_session.rb +25 -0
  42. data/lib/stripe/resources/alipay_account.rb +1 -1
  43. data/lib/stripe/resources/apple_pay_domain.rb +38 -0
  44. data/lib/stripe/resources/application_fee.rb +9 -2
  45. data/lib/stripe/resources/application_fee_refund.rb +9 -2
  46. data/lib/stripe/resources/apps/secret.rb +55 -0
  47. data/lib/stripe/resources/balance.rb +14 -0
  48. data/lib/stripe/resources/balance_transaction.rb +19 -0
  49. data/lib/stripe/resources/bank_account.rb +53 -4
  50. data/lib/stripe/resources/billing/alert.rb +87 -0
  51. data/lib/stripe/resources/billing/credit_balance_summary.rb +14 -0
  52. data/lib/stripe/resources/billing/credit_balance_transaction.rb +26 -0
  53. data/lib/stripe/resources/billing/credit_grant.rb +90 -0
  54. data/lib/stripe/resources/billing/meter.rb +85 -0
  55. data/lib/stripe/resources/billing/meter_event.rb +26 -0
  56. data/lib/stripe/resources/billing/meter_event_adjustment.rb +26 -0
  57. data/lib/stripe/resources/billing/meter_event_summary.rb +17 -0
  58. data/lib/stripe/resources/billing_portal/configuration.rb +34 -0
  59. data/lib/stripe/resources/billing_portal/session.rb +27 -0
  60. data/lib/stripe/resources/capability.rb +7 -2
  61. data/lib/stripe/resources/card.rb +34 -3
  62. data/lib/stripe/resources/cash_balance.rb +4 -0
  63. data/lib/stripe/resources/charge.rb +52 -3
  64. data/lib/stripe/resources/checkout/session.rb +83 -5
  65. data/lib/stripe/resources/climate/order.rb +67 -0
  66. data/lib/stripe/resources/climate/product.rb +27 -0
  67. data/lib/stripe/resources/climate/supplier.rb +26 -0
  68. data/lib/stripe/resources/confirmation_token.rb +39 -0
  69. data/lib/stripe/resources/country_spec.rb +14 -0
  70. data/lib/stripe/resources/coupon.rb +48 -0
  71. data/lib/stripe/resources/credit_note.rb +67 -9
  72. data/lib/stripe/resources/credit_note_line_item.rb +4 -0
  73. data/lib/stripe/resources/customer.rb +172 -28
  74. data/lib/stripe/resources/customer_balance_transaction.rb +9 -1
  75. data/lib/stripe/resources/customer_cash_balance_transaction.rb +15 -0
  76. data/lib/stripe/resources/customer_session.rb +29 -0
  77. data/lib/stripe/resources/discount.rb +7 -0
  78. data/lib/stripe/resources/dispute.rb +41 -3
  79. data/lib/stripe/resources/entitlements/active_entitlement.rb +26 -0
  80. data/lib/stripe/resources/entitlements/feature.rb +49 -0
  81. data/lib/stripe/resources/ephemeral_key.rb +23 -0
  82. data/lib/stripe/resources/event.rb +38 -0
  83. data/lib/stripe/resources/exchange_rate.rb +34 -0
  84. data/lib/stripe/resources/file.rb +37 -15
  85. data/lib/stripe/resources/file_link.rb +26 -0
  86. data/lib/stripe/resources/financial_connections/account.rb +101 -6
  87. data/lib/stripe/resources/financial_connections/account_owner.rb +4 -0
  88. data/lib/stripe/resources/financial_connections/account_ownership.rb +4 -0
  89. data/lib/stripe/resources/financial_connections/session.rb +14 -0
  90. data/lib/stripe/resources/financial_connections/transaction.rb +26 -0
  91. data/lib/stripe/resources/forwarding/request.rb +52 -0
  92. data/lib/stripe/resources/funding_instructions.rb +8 -0
  93. data/lib/stripe/resources/identity/verification_report.rb +24 -0
  94. data/lib/stripe/resources/identity/verification_session.rb +117 -5
  95. data/lib/stripe/resources/invoice.rb +247 -20
  96. data/lib/stripe/resources/invoice_item.rb +54 -0
  97. data/lib/stripe/resources/invoice_line_item.rb +22 -1
  98. data/lib/stripe/resources/invoice_rendering_template.rb +65 -0
  99. data/lib/stripe/resources/issuing/authorization.rb +210 -5
  100. data/lib/stripe/resources/issuing/card.rb +128 -4
  101. data/lib/stripe/resources/issuing/cardholder.rb +36 -0
  102. data/lib/stripe/resources/issuing/dispute.rb +47 -2
  103. data/lib/stripe/resources/issuing/personalization_design.rb +119 -0
  104. data/lib/stripe/resources/issuing/physical_bundle.rb +26 -0
  105. data/lib/stripe/resources/issuing/token.rb +32 -0
  106. data/lib/stripe/resources/issuing/transaction.rb +79 -0
  107. data/lib/stripe/resources/line_item.rb +4 -0
  108. data/lib/stripe/resources/login_link.rb +4 -0
  109. data/lib/stripe/resources/mandate.rb +4 -0
  110. data/lib/stripe/resources/payment_intent.rb +238 -15
  111. data/lib/stripe/resources/payment_link.rb +39 -2
  112. data/lib/stripe/resources/payment_method.rb +78 -5
  113. data/lib/stripe/resources/payment_method_configuration.rb +59 -0
  114. data/lib/stripe/resources/payment_method_domain.rb +79 -0
  115. data/lib/stripe/resources/payout.rb +63 -5
  116. data/lib/stripe/resources/person.rb +8 -1
  117. data/lib/stripe/resources/plan.rb +51 -0
  118. data/lib/stripe/resources/price.rb +30 -1
  119. data/lib/stripe/resources/product.rb +55 -1
  120. data/lib/stripe/resources/product_feature.rb +13 -0
  121. data/lib/stripe/resources/promotion_code.rb +25 -0
  122. data/lib/stripe/resources/quote.rb +97 -39
  123. data/lib/stripe/resources/radar/early_fraud_warning.rb +17 -0
  124. data/lib/stripe/resources/radar/value_list.rb +56 -0
  125. data/lib/stripe/resources/radar/value_list_item.rb +46 -0
  126. data/lib/stripe/resources/refund.rb +70 -5
  127. data/lib/stripe/resources/reporting/report_run.rb +31 -0
  128. data/lib/stripe/resources/reporting/report_type.rb +21 -1
  129. data/lib/stripe/resources/reversal.rb +17 -2
  130. data/lib/stripe/resources/review.rb +24 -3
  131. data/lib/stripe/resources/setup_attempt.rb +12 -0
  132. data/lib/stripe/resources/setup_intent.rb +113 -7
  133. data/lib/stripe/resources/shipping_rate.rb +25 -0
  134. data/lib/stripe/resources/sigma/scheduled_query_run.rb +17 -0
  135. data/lib/stripe/resources/source.rb +52 -10
  136. data/lib/stripe/resources/source_transaction.rb +7 -0
  137. data/lib/stripe/resources/subscription.rb +118 -5
  138. data/lib/stripe/resources/subscription_item.rb +54 -6
  139. data/lib/stripe/resources/subscription_schedule.rb +60 -5
  140. data/lib/stripe/resources/tax/calculation.rb +48 -0
  141. data/lib/stripe/resources/tax/calculation_line_item.rb +13 -0
  142. data/lib/stripe/resources/tax/registration.rb +54 -0
  143. data/lib/stripe/resources/tax/settings.rb +17 -0
  144. data/lib/stripe/resources/tax/transaction.rb +56 -0
  145. data/lib/stripe/resources/tax/transaction_line_item.rb +13 -0
  146. data/lib/stripe/resources/tax_code.rb +9 -0
  147. data/lib/stripe/resources/tax_id.rb +34 -12
  148. data/lib/stripe/resources/tax_rate.rb +26 -0
  149. data/lib/stripe/resources/terminal/configuration.rb +54 -0
  150. data/lib/stripe/resources/terminal/connection_token.rb +16 -0
  151. data/lib/stripe/resources/terminal/location.rb +57 -0
  152. data/lib/stripe/resources/terminal/reader.rb +138 -11
  153. data/lib/stripe/resources/test_helpers/test_clock.rb +58 -3
  154. data/lib/stripe/resources/token.rb +29 -0
  155. data/lib/stripe/resources/topup.rb +40 -3
  156. data/lib/stripe/resources/transfer.rb +29 -6
  157. data/lib/stripe/resources/treasury/credit_reversal.rb +37 -0
  158. data/lib/stripe/resources/treasury/debit_reversal.rb +37 -0
  159. data/lib/stripe/resources/treasury/financial_account.rb +109 -0
  160. data/lib/stripe/resources/treasury/financial_account_features.rb +15 -0
  161. data/lib/stripe/resources/treasury/inbound_transfer.rb +130 -0
  162. data/lib/stripe/resources/treasury/outbound_payment.rb +152 -0
  163. data/lib/stripe/resources/treasury/outbound_transfer.rb +152 -0
  164. data/lib/stripe/resources/treasury/received_credit.rb +47 -0
  165. data/lib/stripe/resources/treasury/received_debit.rb +47 -0
  166. data/lib/stripe/resources/treasury/transaction.rb +26 -0
  167. data/lib/stripe/resources/treasury/transaction_entry.rb +30 -0
  168. data/lib/stripe/resources/usage_record.rb +9 -0
  169. data/lib/stripe/resources/usage_record_summary.rb +4 -0
  170. data/lib/stripe/resources/v2/billing/meter_event.rb +16 -0
  171. data/lib/stripe/resources/v2/billing/meter_event_adjustment.rb +15 -0
  172. data/lib/stripe/resources/v2/billing/meter_event_session.rb +15 -0
  173. data/lib/stripe/resources/v2/event.rb +13 -0
  174. data/lib/stripe/resources/v2/event_destination.rb +13 -0
  175. data/lib/stripe/resources/webhook_endpoint.rb +55 -0
  176. data/lib/stripe/resources.rb +51 -10
  177. data/lib/stripe/search_result_object.rb +5 -2
  178. data/lib/stripe/services/account_capability_service.rb +39 -0
  179. data/lib/stripe/services/account_external_account_service.rb +68 -0
  180. data/lib/stripe/services/account_link_service.rb +17 -0
  181. data/lib/stripe/services/account_login_link_service.rb +19 -0
  182. data/lib/stripe/services/account_person_service.rb +61 -0
  183. data/lib/stripe/services/account_service.rb +100 -0
  184. data/lib/stripe/services/account_session_service.rb +17 -0
  185. data/lib/stripe/services/apple_pay_domain_service.rb +50 -0
  186. data/lib/stripe/services/application_fee_refund_service.rb +60 -0
  187. data/lib/stripe/services/application_fee_service.rb +35 -0
  188. data/lib/stripe/services/apps/secret_service.rb +52 -0
  189. data/lib/stripe/services/apps_service.rb +13 -0
  190. data/lib/stripe/services/balance_service.rb +12 -0
  191. data/lib/stripe/services/balance_transaction_service.rb +32 -0
  192. data/lib/stripe/services/billing/alert_service.rb +74 -0
  193. data/lib/stripe/services/billing/credit_balance_summary_service.rb +19 -0
  194. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +30 -0
  195. data/lib/stripe/services/billing/credit_grant_service.rb +74 -0
  196. data/lib/stripe/services/billing/meter_event_adjustment_service.rb +19 -0
  197. data/lib/stripe/services/billing/meter_event_service.rb +19 -0
  198. data/lib/stripe/services/billing/meter_event_summary_service.rb +19 -0
  199. data/lib/stripe/services/billing/meter_service.rb +81 -0
  200. data/lib/stripe/services/billing_portal/configuration_service.rb +52 -0
  201. data/lib/stripe/services/billing_portal/session_service.rb +19 -0
  202. data/lib/stripe/services/billing_portal_service.rb +14 -0
  203. data/lib/stripe/services/billing_service.rb +20 -0
  204. data/lib/stripe/services/charge_service.rb +69 -0
  205. data/lib/stripe/services/checkout/session_line_item_service.rb +19 -0
  206. data/lib/stripe/services/checkout/session_service.rb +72 -0
  207. data/lib/stripe/services/checkout_service.rb +13 -0
  208. data/lib/stripe/services/climate/order_service.rb +68 -0
  209. data/lib/stripe/services/climate/product_service.rb +30 -0
  210. data/lib/stripe/services/climate/supplier_service.rb +30 -0
  211. data/lib/stripe/services/climate_service.rb +15 -0
  212. data/lib/stripe/services/confirmation_token_service.rb +17 -0
  213. data/lib/stripe/services/country_spec_service.rb +28 -0
  214. data/lib/stripe/services/coupon_service.rb +51 -0
  215. data/lib/stripe/services/credit_note_line_item_service.rb +17 -0
  216. data/lib/stripe/services/credit_note_preview_lines_service.rb +17 -0
  217. data/lib/stripe/services/credit_note_service.rb +93 -0
  218. data/lib/stripe/services/customer_balance_transaction_service.rb +50 -0
  219. data/lib/stripe/services/customer_cash_balance_service.rb +28 -0
  220. data/lib/stripe/services/customer_cash_balance_transaction_service.rb +28 -0
  221. data/lib/stripe/services/customer_funding_instructions_service.rb +19 -0
  222. data/lib/stripe/services/customer_payment_method_service.rb +28 -0
  223. data/lib/stripe/services/customer_payment_source_service.rb +76 -0
  224. data/lib/stripe/services/customer_service.rb +89 -0
  225. data/lib/stripe/services/customer_session_service.rb +17 -0
  226. data/lib/stripe/services/customer_tax_id_service.rb +50 -0
  227. data/lib/stripe/services/dispute_service.rb +48 -0
  228. data/lib/stripe/services/entitlements/active_entitlement_service.rb +30 -0
  229. data/lib/stripe/services/entitlements/feature_service.rb +52 -0
  230. data/lib/stripe/services/entitlements_service.rb +14 -0
  231. data/lib/stripe/services/ephemeral_key_service.rb +28 -0
  232. data/lib/stripe/services/event_service.rb +22 -0
  233. data/lib/stripe/services/exchange_rate_service.rb +28 -0
  234. data/lib/stripe/services/file_link_service.rb +38 -0
  235. data/lib/stripe/services/file_service.rb +35 -0
  236. data/lib/stripe/services/financial_connections/account_owner_service.rb +19 -0
  237. data/lib/stripe/services/financial_connections/account_service.rb +81 -0
  238. data/lib/stripe/services/financial_connections/session_service.rb +30 -0
  239. data/lib/stripe/services/financial_connections/transaction_service.rb +30 -0
  240. data/lib/stripe/services/financial_connections_service.rb +15 -0
  241. data/lib/stripe/services/forwarding/request_service.rb +41 -0
  242. data/lib/stripe/services/forwarding_service.rb +13 -0
  243. data/lib/stripe/services/identity/verification_report_service.rb +30 -0
  244. data/lib/stripe/services/identity/verification_session_service.rb +106 -0
  245. data/lib/stripe/services/identity_service.rb +14 -0
  246. data/lib/stripe/services/invoice_item_service.rb +61 -0
  247. data/lib/stripe/services/invoice_line_item_service.rb +31 -0
  248. data/lib/stripe/services/invoice_rendering_template_service.rb +50 -0
  249. data/lib/stripe/services/invoice_service.rb +202 -0
  250. data/lib/stripe/services/invoice_upcoming_lines_service.rb +17 -0
  251. data/lib/stripe/services/issuing/authorization_service.rb +65 -0
  252. data/lib/stripe/services/issuing/card_service.rb +52 -0
  253. data/lib/stripe/services/issuing/cardholder_service.rb +52 -0
  254. data/lib/stripe/services/issuing/dispute_service.rb +63 -0
  255. data/lib/stripe/services/issuing/personalization_design_service.rb +52 -0
  256. data/lib/stripe/services/issuing/physical_bundle_service.rb +30 -0
  257. data/lib/stripe/services/issuing/token_service.rb +41 -0
  258. data/lib/stripe/services/issuing/transaction_service.rb +41 -0
  259. data/lib/stripe/services/issuing_service.rb +20 -0
  260. data/lib/stripe/services/mandate_service.rb +17 -0
  261. data/lib/stripe/services/oauth_service.rb +63 -0
  262. data/lib/stripe/services/payment_intent_service.rb +204 -0
  263. data/lib/stripe/services/payment_link_line_item_service.rb +17 -0
  264. data/lib/stripe/services/payment_link_service.rb +57 -0
  265. data/lib/stripe/services/payment_method_configuration_service.rb +50 -0
  266. data/lib/stripe/services/payment_method_domain_service.rb +66 -0
  267. data/lib/stripe/services/payment_method_service.rb +86 -0
  268. data/lib/stripe/services/payout_service.rb +66 -0
  269. data/lib/stripe/services/plan_service.rb +49 -0
  270. data/lib/stripe/services/price_service.rb +52 -0
  271. data/lib/stripe/services/product_feature_service.rb +50 -0
  272. data/lib/stripe/services/product_service.rb +70 -0
  273. data/lib/stripe/services/promotion_code_service.rb +50 -0
  274. data/lib/stripe/services/quote_computed_upfront_line_items_service.rb +17 -0
  275. data/lib/stripe/services/quote_line_item_service.rb +17 -0
  276. data/lib/stripe/services/quote_service.rb +92 -0
  277. data/lib/stripe/services/radar/early_fraud_warning_service.rb +32 -0
  278. data/lib/stripe/services/radar/value_list_item_service.rb +52 -0
  279. data/lib/stripe/services/radar/value_list_service.rb +63 -0
  280. data/lib/stripe/services/radar_service.rb +15 -0
  281. data/lib/stripe/services/refund_service.rb +63 -0
  282. data/lib/stripe/services/reporting/report_run_service.rb +41 -0
  283. data/lib/stripe/services/reporting/report_type_service.rb +30 -0
  284. data/lib/stripe/services/reporting_service.rb +14 -0
  285. data/lib/stripe/services/review_service.rb +33 -0
  286. data/lib/stripe/services/setup_attempt_service.rb +17 -0
  287. data/lib/stripe/services/setup_intent_service.rb +105 -0
  288. data/lib/stripe/services/shipping_rate_service.rb +50 -0
  289. data/lib/stripe/services/sigma/scheduled_query_run_service.rb +30 -0
  290. data/lib/stripe/services/sigma_service.rb +13 -0
  291. data/lib/stripe/services/source_service.rb +64 -0
  292. data/lib/stripe/services/source_transaction_service.rb +17 -0
  293. data/lib/stripe/services/subscription_item_service.rb +69 -0
  294. data/lib/stripe/services/subscription_item_usage_record_service.rb +23 -0
  295. data/lib/stripe/services/subscription_item_usage_record_summary_service.rb +19 -0
  296. data/lib/stripe/services/subscription_schedule_service.rb +72 -0
  297. data/lib/stripe/services/subscription_service.rb +127 -0
  298. data/lib/stripe/services/tax/calculation_line_item_service.rb +19 -0
  299. data/lib/stripe/services/tax/calculation_service.rb +37 -0
  300. data/lib/stripe/services/tax/registration_service.rb +54 -0
  301. data/lib/stripe/services/tax/settings_service.rb +30 -0
  302. data/lib/stripe/services/tax/transaction_line_item_service.rb +19 -0
  303. data/lib/stripe/services/tax/transaction_service.rb +48 -0
  304. data/lib/stripe/services/tax_code_service.rb +22 -0
  305. data/lib/stripe/services/tax_id_service.rb +38 -0
  306. data/lib/stripe/services/tax_rate_service.rb +38 -0
  307. data/lib/stripe/services/tax_service.rb +16 -0
  308. data/lib/stripe/services/terminal/configuration_service.rb +63 -0
  309. data/lib/stripe/services/terminal/connection_token_service.rb +19 -0
  310. data/lib/stripe/services/terminal/location_service.rb +64 -0
  311. data/lib/stripe/services/terminal/reader_service.rb +118 -0
  312. data/lib/stripe/services/terminal_service.rb +16 -0
  313. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +19 -0
  314. data/lib/stripe/services/test_helpers/customer_service.rb +19 -0
  315. data/lib/stripe/services/test_helpers/issuing/authorization_service.rb +87 -0
  316. data/lib/stripe/services/test_helpers/issuing/card_service.rb +65 -0
  317. data/lib/stripe/services/test_helpers/issuing/personalization_design_service.rb +43 -0
  318. data/lib/stripe/services/test_helpers/issuing/transaction_service.rb +43 -0
  319. data/lib/stripe/services/test_helpers/issuing_service.rb +19 -0
  320. data/lib/stripe/services/test_helpers/refund_service.rb +19 -0
  321. data/lib/stripe/services/test_helpers/terminal/reader_service.rb +21 -0
  322. data/lib/stripe/services/test_helpers/terminal_service.rb +15 -0
  323. data/lib/stripe/services/test_helpers/test_clock_service.rb +63 -0
  324. data/lib/stripe/services/test_helpers/treasury/inbound_transfer_service.rb +43 -0
  325. data/lib/stripe/services/test_helpers/treasury/outbound_payment_service.rb +54 -0
  326. data/lib/stripe/services/test_helpers/treasury/outbound_transfer_service.rb +54 -0
  327. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +21 -0
  328. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +21 -0
  329. data/lib/stripe/services/test_helpers/treasury_service.rb +19 -0
  330. data/lib/stripe/services/test_helpers_service.rb +19 -0
  331. data/lib/stripe/services/token_service.rb +23 -0
  332. data/lib/stripe/services/topup_service.rb +49 -0
  333. data/lib/stripe/services/transfer_reversal_service.rb +56 -0
  334. data/lib/stripe/services/transfer_service.rb +47 -0
  335. data/lib/stripe/services/treasury/credit_reversal_service.rb +41 -0
  336. data/lib/stripe/services/treasury/debit_reversal_service.rb +41 -0
  337. data/lib/stripe/services/treasury/financial_account_features_service.rb +30 -0
  338. data/lib/stripe/services/treasury/financial_account_service.rb +70 -0
  339. data/lib/stripe/services/treasury/inbound_transfer_service.rb +52 -0
  340. data/lib/stripe/services/treasury/outbound_payment_service.rb +52 -0
  341. data/lib/stripe/services/treasury/outbound_transfer_service.rb +52 -0
  342. data/lib/stripe/services/treasury/received_credit_service.rb +30 -0
  343. data/lib/stripe/services/treasury/received_debit_service.rb +30 -0
  344. data/lib/stripe/services/treasury/transaction_entry_service.rb +30 -0
  345. data/lib/stripe/services/treasury/transaction_service.rb +30 -0
  346. data/lib/stripe/services/treasury_service.rb +22 -0
  347. data/lib/stripe/services/v1_services.rb +89 -0
  348. data/lib/stripe/services/v2/billing/meter_event_adjustment_service.rb +21 -0
  349. data/lib/stripe/services/v2/billing/meter_event_service.rb +21 -0
  350. data/lib/stripe/services/v2/billing/meter_event_session_service.rb +21 -0
  351. data/lib/stripe/services/v2/billing/meter_event_stream_service.rb +23 -0
  352. data/lib/stripe/services/v2/billing_service.rb +18 -0
  353. data/lib/stripe/services/v2/core/event_destination_service.rb +98 -0
  354. data/lib/stripe/services/v2/core/event_service.rb +32 -0
  355. data/lib/stripe/services/v2/core_service.rb +16 -0
  356. data/lib/stripe/services/v2_services.rb +14 -0
  357. data/lib/stripe/services/webhook_endpoint_service.rb +61 -0
  358. data/lib/stripe/services.rb +182 -0
  359. data/lib/stripe/singleton_api_resource.rb +3 -3
  360. data/lib/stripe/stripe_client.rb +55 -1028
  361. data/lib/stripe/stripe_configuration.rb +63 -42
  362. data/lib/stripe/stripe_object.rb +60 -38
  363. data/lib/stripe/stripe_response.rb +1 -3
  364. data/lib/stripe/stripe_service.rb +32 -0
  365. data/lib/stripe/thin_event.rb +37 -0
  366. data/lib/stripe/util.rb +109 -45
  367. data/lib/stripe/v2_list_object.rb +84 -0
  368. data/lib/stripe/version.rb +1 -1
  369. data/lib/stripe/webhook.rb +3 -2
  370. data/lib/stripe.rb +39 -0
  371. data/stripe.gemspec +7 -4
  372. metadata +252 -13
  373. data/lib/stripe/resources/bitcoin_receiver.rb +0 -24
  374. data/lib/stripe/resources/bitcoin_transaction.rb +0 -16
  375. data/lib/stripe/resources/issuing/card_details.rb +0 -10
  376. data/lib/stripe/resources/order.rb +0 -33
  377. data/lib/stripe/resources/order_return.rb +0 -10
  378. data/lib/stripe/resources/recipient.rb +0 -14
  379. data/lib/stripe/resources/sku.rb +0 -13
  380. data/lib/stripe/resources/three_d_secure.rb +0 -14
@@ -2,9 +2,43 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Stripe
5
+ # `ExchangeRate` objects allow you to determine the rates that Stripe is currently
6
+ # using to convert from one currency to another. Since this number is variable
7
+ # throughout the day, there are various reasons why you might want to know the current
8
+ # rate (for example, to dynamically price an item for a user with a default
9
+ # payment in a foreign currency).
10
+ #
11
+ # Please refer to our [Exchange Rates API](https://stripe.com/docs/fx-rates) guide for more details.
12
+ #
13
+ # *[Note: this integration path is supported but no longer recommended]* Additionally,
14
+ # you can guarantee that a charge is made with an exchange rate that you expect is
15
+ # current. To do so, you must pass in the exchange_rate to charges endpoints. If the
16
+ # value is no longer up to date, the charge won't go through. Please refer to our
17
+ # [Using with charges](https://stripe.com/docs/exchange-rates) guide for more details.
18
+ #
19
+ # -----
20
+ #
21
+ #  
22
+ #
23
+ # *This Exchange Rates API is a Beta Service and is subject to Stripe's terms of service. You may use the API solely for the purpose of transacting on Stripe. For example, the API may be queried in order to:*
24
+ #
25
+ # - *localize prices for processing payments on Stripe*
26
+ # - *reconcile Stripe transactions*
27
+ # - *determine how much money to send to a connected account*
28
+ # - *determine app fees to charge a connected account*
29
+ #
30
+ # *Using this Exchange Rates API beta for any purpose other than to transact on Stripe is strictly prohibited and constitutes a violation of Stripe's terms of service.*
5
31
  class ExchangeRate < APIResource
6
32
  extend Stripe::APIOperations::List
7
33
 
8
34
  OBJECT_NAME = "exchange_rate"
35
+ def self.object_name
36
+ "exchange_rate"
37
+ end
38
+
39
+ # Returns a list of objects that contain the rates at which foreign currencies are converted to one another. Only shows the currencies for which Stripe supports.
40
+ def self.list(params = {}, opts = {})
41
+ request_stripe_object(method: :get, path: "/v1/exchange_rates", params: params, opts: opts)
42
+ end
9
43
  end
10
44
  end
@@ -2,35 +2,57 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Stripe
5
+ # This object represents files hosted on Stripe's servers. You can upload
6
+ # files with the [create file](https://stripe.com/docs/api#create_file) request
7
+ # (for example, when uploading dispute evidence). Stripe also
8
+ # creates files independently (for example, the results of a [Sigma scheduled
9
+ # query](https://stripe.com/docs/api#scheduled_queries)).
10
+ #
11
+ # Related guide: [File upload guide](https://stripe.com/docs/file-upload)
5
12
  class File < APIResource
6
13
  extend Stripe::APIOperations::Create
7
14
  extend Stripe::APIOperations::List
8
15
 
9
16
  OBJECT_NAME = "file"
17
+ def self.object_name
18
+ "file"
19
+ end
20
+
21
+ # To upload a file to Stripe, you need to send a request of type multipart/form-data. Include the file you want to upload in the request, and the parameters for creating a file.
22
+ #
23
+ # All of Stripe's officially supported Client libraries support sending multipart/form-data.
24
+ def self.create(params = {}, opts = {})
25
+ if params[:file] && !params[:file].is_a?(String) && !params[:file].respond_to?(:read)
26
+ raise ArgumentError, "file must respond to `#read`"
27
+ end
28
+
29
+ opts = { content_type: MultipartEncoder::MULTIPART_FORM_DATA }.merge(Util.normalize_opts(opts))
30
+
31
+ request_stripe_object(
32
+ method: :post,
33
+ path: "/v1/files",
34
+ params: params,
35
+ opts: opts,
36
+ base_address: :files
37
+ )
38
+ end
39
+
40
+ # Returns a list of the files that your account has access to. Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top.
41
+ def self.list(params = {}, opts = {})
42
+ request_stripe_object(method: :get, path: "/v1/files", params: params, opts: opts)
43
+ end
10
44
 
11
45
  # This resource can have two different object names. In latter API
12
46
  # versions, only `file` is used, but since stripe-ruby may be used with
13
47
  # any API version, we need to support deserializing the older
14
48
  # `file_upload` object into the same class.
15
49
  OBJECT_NAME_ALT = "file_upload"
50
+ def self.object_name_alt
51
+ "file_upload"
52
+ end
16
53
 
17
54
  def self.resource_url
18
55
  "/v1/files"
19
56
  end
20
-
21
- def self.create(params = {}, opts = {})
22
- if params[:file] && !params[:file].is_a?(String)
23
- unless params[:file].respond_to?(:read)
24
- raise ArgumentError, "file must respond to `#read`"
25
- end
26
- end
27
-
28
- config = opts[:client]&.config || Stripe.config
29
- opts = {
30
- api_base: config.uploads_base,
31
- content_type: MultipartEncoder::MULTIPART_FORM_DATA,
32
- }.merge(Util.normalize_opts(opts))
33
- super
34
- end
35
57
  end
36
58
  end
@@ -2,11 +2,37 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Stripe
5
+ # To share the contents of a `File` object with non-Stripe users, you can
6
+ # create a `FileLink`. `FileLink`s contain a URL that you can use to
7
+ # retrieve the contents of the file without authentication.
5
8
  class FileLink < APIResource
6
9
  extend Stripe::APIOperations::Create
7
10
  extend Stripe::APIOperations::List
8
11
  include Stripe::APIOperations::Save
9
12
 
10
13
  OBJECT_NAME = "file_link"
14
+ def self.object_name
15
+ "file_link"
16
+ end
17
+
18
+ # Creates a new file link object.
19
+ def self.create(params = {}, opts = {})
20
+ request_stripe_object(method: :post, path: "/v1/file_links", params: params, opts: opts)
21
+ end
22
+
23
+ # Returns a list of file links.
24
+ def self.list(params = {}, opts = {})
25
+ request_stripe_object(method: :get, path: "/v1/file_links", params: params, opts: opts)
26
+ end
27
+
28
+ # Updates an existing file link object. Expired links can no longer be updated.
29
+ def self.update(link, params = {}, opts = {})
30
+ request_stripe_object(
31
+ method: :post,
32
+ path: format("/v1/file_links/%<link>s", { link: CGI.escape(link) }),
33
+ params: params,
34
+ opts: opts
35
+ )
36
+ end
11
37
  end
12
38
  end
@@ -3,25 +3,120 @@
3
3
 
4
4
  module Stripe
5
5
  module FinancialConnections
6
+ # A Financial Connections Account represents an account that exists outside of Stripe, to which you have been granted some degree of access.
6
7
  class Account < APIResource
7
- OBJECT_NAME = "financial_connections.account"
8
+ extend Stripe::APIOperations::List
8
9
 
9
- custom_method :disconnect, http_verb: :post
10
- custom_method :refresh, http_verb: :post
10
+ OBJECT_NAME = "financial_connections.account"
11
+ def self.object_name
12
+ "financial_connections.account"
13
+ end
11
14
 
15
+ # Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions).
12
16
  def disconnect(params = {}, opts = {})
13
17
  request_stripe_object(
14
18
  method: :post,
15
- path: resource_url + "/disconnect",
19
+ path: format("/v1/financial_connections/accounts/%<account>s/disconnect", { account: CGI.escape(self["id"]) }),
20
+ params: params,
21
+ opts: opts
22
+ )
23
+ end
24
+
25
+ # Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions).
26
+ def self.disconnect(account, params = {}, opts = {})
27
+ request_stripe_object(
28
+ method: :post,
29
+ path: format("/v1/financial_connections/accounts/%<account>s/disconnect", { account: CGI.escape(account) }),
30
+ params: params,
31
+ opts: opts
32
+ )
33
+ end
34
+
35
+ # Returns a list of Financial Connections Account objects.
36
+ def self.list(params = {}, opts = {})
37
+ request_stripe_object(
38
+ method: :get,
39
+ path: "/v1/financial_connections/accounts",
40
+ params: params,
41
+ opts: opts
42
+ )
43
+ end
44
+
45
+ # Lists all owners for a given Account
46
+ def list_owners(params = {}, opts = {})
47
+ request_stripe_object(
48
+ method: :get,
49
+ path: format("/v1/financial_connections/accounts/%<account>s/owners", { account: CGI.escape(self["id"]) }),
50
+ params: params,
51
+ opts: opts
52
+ )
53
+ end
54
+
55
+ # Lists all owners for a given Account
56
+ def self.list_owners(account, params = {}, opts = {})
57
+ request_stripe_object(
58
+ method: :get,
59
+ path: format("/v1/financial_connections/accounts/%<account>s/owners", { account: CGI.escape(account) }),
60
+ params: params,
61
+ opts: opts
62
+ )
63
+ end
64
+
65
+ # Refreshes the data associated with a Financial Connections Account.
66
+ def refresh_account(params = {}, opts = {})
67
+ request_stripe_object(
68
+ method: :post,
69
+ path: format("/v1/financial_connections/accounts/%<account>s/refresh", { account: CGI.escape(self["id"]) }),
70
+ params: params,
71
+ opts: opts
72
+ )
73
+ end
74
+
75
+ # Refreshes the data associated with a Financial Connections Account.
76
+ def self.refresh_account(account, params = {}, opts = {})
77
+ request_stripe_object(
78
+ method: :post,
79
+ path: format("/v1/financial_connections/accounts/%<account>s/refresh", { account: CGI.escape(account) }),
80
+ params: params,
81
+ opts: opts
82
+ )
83
+ end
84
+
85
+ # Subscribes to periodic refreshes of data associated with a Financial Connections Account.
86
+ def subscribe(params = {}, opts = {})
87
+ request_stripe_object(
88
+ method: :post,
89
+ path: format("/v1/financial_connections/accounts/%<account>s/subscribe", { account: CGI.escape(self["id"]) }),
90
+ params: params,
91
+ opts: opts
92
+ )
93
+ end
94
+
95
+ # Subscribes to periodic refreshes of data associated with a Financial Connections Account.
96
+ def self.subscribe(account, params = {}, opts = {})
97
+ request_stripe_object(
98
+ method: :post,
99
+ path: format("/v1/financial_connections/accounts/%<account>s/subscribe", { account: CGI.escape(account) }),
100
+ params: params,
101
+ opts: opts
102
+ )
103
+ end
104
+
105
+ # Unsubscribes from periodic refreshes of data associated with a Financial Connections Account.
106
+ def unsubscribe(params = {}, opts = {})
107
+ request_stripe_object(
108
+ method: :post,
109
+ path: format("/v1/financial_connections/accounts/%<account>s/unsubscribe", { account: CGI.escape(self["id"]) }),
16
110
  params: params,
17
111
  opts: opts
18
112
  )
19
113
  end
20
114
 
21
- def refresh(params = {}, opts = {})
115
+ # Unsubscribes from periodic refreshes of data associated with a Financial Connections Account.
116
+ def self.unsubscribe(account, params = {}, opts = {})
22
117
  request_stripe_object(
23
118
  method: :post,
24
- path: resource_url + "/refresh",
119
+ path: format("/v1/financial_connections/accounts/%<account>s/unsubscribe", { account: CGI.escape(account) }),
25
120
  params: params,
26
121
  opts: opts
27
122
  )
@@ -3,8 +3,12 @@
3
3
 
4
4
  module Stripe
5
5
  module FinancialConnections
6
+ # Describes an owner of an account.
6
7
  class AccountOwner < StripeObject
7
8
  OBJECT_NAME = "financial_connections.account_owner"
9
+ def self.object_name
10
+ "financial_connections.account_owner"
11
+ end
8
12
  end
9
13
  end
10
14
  end
@@ -3,8 +3,12 @@
3
3
 
4
4
  module Stripe
5
5
  module FinancialConnections
6
+ # Describes a snapshot of the owners of an account at a particular point in time.
6
7
  class AccountOwnership < StripeObject
7
8
  OBJECT_NAME = "financial_connections.account_ownership"
9
+ def self.object_name
10
+ "financial_connections.account_ownership"
11
+ end
8
12
  end
9
13
  end
10
14
  end
@@ -3,10 +3,24 @@
3
3
 
4
4
  module Stripe
5
5
  module FinancialConnections
6
+ # A Financial Connections Session is the secure way to programmatically launch the client-side Stripe.js modal that lets your users link their accounts.
6
7
  class Session < APIResource
7
8
  extend Stripe::APIOperations::Create
8
9
 
9
10
  OBJECT_NAME = "financial_connections.session"
11
+ def self.object_name
12
+ "financial_connections.session"
13
+ end
14
+
15
+ # To launch the Financial Connections authorization flow, create a Session. The session's client_secret can be used to launch the flow using Stripe.js.
16
+ def self.create(params = {}, opts = {})
17
+ request_stripe_object(
18
+ method: :post,
19
+ path: "/v1/financial_connections/sessions",
20
+ params: params,
21
+ opts: opts
22
+ )
23
+ end
10
24
  end
11
25
  end
12
26
  end
@@ -0,0 +1,26 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module FinancialConnections
6
+ # A Transaction represents a real transaction that affects a Financial Connections Account balance.
7
+ class Transaction < APIResource
8
+ extend Stripe::APIOperations::List
9
+
10
+ OBJECT_NAME = "financial_connections.transaction"
11
+ def self.object_name
12
+ "financial_connections.transaction"
13
+ end
14
+
15
+ # Returns a list of Financial Connections Transaction objects.
16
+ def self.list(params = {}, opts = {})
17
+ request_stripe_object(
18
+ method: :get,
19
+ path: "/v1/financial_connections/transactions",
20
+ params: params,
21
+ opts: opts
22
+ )
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,52 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Forwarding
6
+ # Instructs Stripe to make a request on your behalf using the destination URL. The destination URL
7
+ # is activated by Stripe at the time of onboarding. Stripe verifies requests with your credentials
8
+ # provided during onboarding, and injects card details from the payment_method into the request.
9
+ #
10
+ # Stripe redacts all sensitive fields and headers, including authentication credentials and card numbers,
11
+ # before storing the request and response data in the forwarding Request object, which are subject to a
12
+ # 30-day retention period.
13
+ #
14
+ # You can provide a Stripe idempotency key to make sure that requests with the same key result in only one
15
+ # outbound request. The Stripe idempotency key provided should be unique and different from any idempotency
16
+ # keys provided on the underlying third-party request.
17
+ #
18
+ # Forwarding Requests are synchronous requests that return a response or time out according to
19
+ # Stripe's limits.
20
+ #
21
+ # Related guide: [Forward card details to third-party API endpoints](https://docs.stripe.com/payments/forwarding).
22
+ class Request < APIResource
23
+ extend Stripe::APIOperations::Create
24
+ extend Stripe::APIOperations::List
25
+
26
+ OBJECT_NAME = "forwarding.request"
27
+ def self.object_name
28
+ "forwarding.request"
29
+ end
30
+
31
+ # Creates a ForwardingRequest object.
32
+ def self.create(params = {}, opts = {})
33
+ request_stripe_object(
34
+ method: :post,
35
+ path: "/v1/forwarding/requests",
36
+ params: params,
37
+ opts: opts
38
+ )
39
+ end
40
+
41
+ # Lists all ForwardingRequest objects.
42
+ def self.list(params = {}, opts = {})
43
+ request_stripe_object(
44
+ method: :get,
45
+ path: "/v1/forwarding/requests",
46
+ params: params,
47
+ opts: opts
48
+ )
49
+ end
50
+ end
51
+ end
52
+ end
@@ -2,8 +2,16 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Stripe
5
+ # Each customer has a [`balance`](https://stripe.com/docs/api/customers/object#customer_object-balance) that is
6
+ # automatically applied to future invoices and payments using the `customer_balance` payment method.
7
+ # Customers can fund this balance by initiating a bank transfer to any account in the
8
+ # `financial_addresses` field.
9
+ # Related guide: [Customer balance funding instructions](https://stripe.com/docs/payments/customer-balance/funding-instructions)
5
10
  class FundingInstructions < APIResource
6
11
  OBJECT_NAME = "funding_instructions"
12
+ def self.object_name
13
+ "funding_instructions"
14
+ end
7
15
 
8
16
  def resource_url
9
17
  if !respond_to?(:customer) || customer.nil?
@@ -3,10 +3,34 @@
3
3
 
4
4
  module Stripe
5
5
  module Identity
6
+ # A VerificationReport is the result of an attempt to collect and verify data from a user.
7
+ # The collection of verification checks performed is determined from the `type` and `options`
8
+ # parameters used. You can find the result of each verification check performed in the
9
+ # appropriate sub-resource: `document`, `id_number`, `selfie`.
10
+ #
11
+ # Each VerificationReport contains a copy of any data collected by the user as well as
12
+ # reference IDs which can be used to access collected images through the [FileUpload](https://stripe.com/docs/api/files)
13
+ # API. To configure and create VerificationReports, use the
14
+ # [VerificationSession](https://stripe.com/docs/api/identity/verification_sessions) API.
15
+ #
16
+ # Related guide: [Accessing verification results](https://stripe.com/docs/identity/verification-sessions#results).
6
17
  class VerificationReport < APIResource
7
18
  extend Stripe::APIOperations::List
8
19
 
9
20
  OBJECT_NAME = "identity.verification_report"
21
+ def self.object_name
22
+ "identity.verification_report"
23
+ end
24
+
25
+ # List all verification reports.
26
+ def self.list(params = {}, opts = {})
27
+ request_stripe_object(
28
+ method: :get,
29
+ path: "/v1/identity/verification_reports",
30
+ params: params,
31
+ opts: opts
32
+ )
33
+ end
10
34
  end
11
35
  end
12
36
  end
@@ -3,29 +3,141 @@
3
3
 
4
4
  module Stripe
5
5
  module Identity
6
+ # A VerificationSession guides you through the process of collecting and verifying the identities
7
+ # of your users. It contains details about the type of verification, such as what [verification
8
+ # check](https://stripe.com/docs/identity/verification-checks) to perform. Only create one VerificationSession for
9
+ # each verification in your system.
10
+ #
11
+ # A VerificationSession transitions through [multiple
12
+ # statuses](https://stripe.com/docs/identity/how-sessions-work) throughout its lifetime as it progresses through
13
+ # the verification flow. The VerificationSession contains the user's verified data after
14
+ # verification checks are complete.
15
+ #
16
+ # Related guide: [The Verification Sessions API](https://stripe.com/docs/identity/verification-sessions)
6
17
  class VerificationSession < APIResource
7
18
  extend Stripe::APIOperations::Create
8
19
  extend Stripe::APIOperations::List
9
20
  include Stripe::APIOperations::Save
10
21
 
11
22
  OBJECT_NAME = "identity.verification_session"
23
+ def self.object_name
24
+ "identity.verification_session"
25
+ end
12
26
 
13
- custom_method :cancel, http_verb: :post
14
- custom_method :redact, http_verb: :post
15
-
27
+ # A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work).
28
+ #
29
+ # Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel).
16
30
  def cancel(params = {}, opts = {})
17
31
  request_stripe_object(
18
32
  method: :post,
19
- path: resource_url + "/cancel",
33
+ path: format("/v1/identity/verification_sessions/%<session>s/cancel", { session: CGI.escape(self["id"]) }),
34
+ params: params,
35
+ opts: opts
36
+ )
37
+ end
38
+
39
+ # A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work).
40
+ #
41
+ # Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel).
42
+ def self.cancel(session, params = {}, opts = {})
43
+ request_stripe_object(
44
+ method: :post,
45
+ path: format("/v1/identity/verification_sessions/%<session>s/cancel", { session: CGI.escape(session) }),
46
+ params: params,
47
+ opts: opts
48
+ )
49
+ end
50
+
51
+ # Creates a VerificationSession object.
52
+ #
53
+ # After the VerificationSession is created, display a verification modal using the session client_secret or send your users to the session's url.
54
+ #
55
+ # If your API key is in test mode, verification checks won't actually process, though everything else will occur as if in live mode.
56
+ #
57
+ # Related guide: [Verify your users' identity documents](https://stripe.com/docs/identity/verify-identity-documents)
58
+ def self.create(params = {}, opts = {})
59
+ request_stripe_object(
60
+ method: :post,
61
+ path: "/v1/identity/verification_sessions",
62
+ params: params,
63
+ opts: opts
64
+ )
65
+ end
66
+
67
+ # Returns a list of VerificationSessions
68
+ def self.list(params = {}, opts = {})
69
+ request_stripe_object(
70
+ method: :get,
71
+ path: "/v1/identity/verification_sessions",
20
72
  params: params,
21
73
  opts: opts
22
74
  )
23
75
  end
24
76
 
77
+ # Redact a VerificationSession to remove all collected information from Stripe. This will redact
78
+ # the VerificationSession and all objects related to it, including VerificationReports, Events,
79
+ # request logs, etc.
80
+ #
81
+ # A VerificationSession object can be redacted when it is in requires_input or verified
82
+ # [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action
83
+ # state will automatically cancel it.
84
+ #
85
+ # The redaction process may take up to four days. When the redaction process is in progress, the
86
+ # VerificationSession's redaction.status field will be set to processing; when the process is
87
+ # finished, it will change to redacted and an identity.verification_session.redacted event
88
+ # will be emitted.
89
+ #
90
+ # Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the
91
+ # fields that contain personal data will be replaced by the string [redacted] or a similar
92
+ # placeholder. The metadata field will also be erased. Redacted objects cannot be updated or
93
+ # used for any purpose.
94
+ #
95
+ # [Learn more](https://stripe.com/docs/identity/verification-sessions#redact).
25
96
  def redact(params = {}, opts = {})
26
97
  request_stripe_object(
27
98
  method: :post,
28
- path: resource_url + "/redact",
99
+ path: format("/v1/identity/verification_sessions/%<session>s/redact", { session: CGI.escape(self["id"]) }),
100
+ params: params,
101
+ opts: opts
102
+ )
103
+ end
104
+
105
+ # Redact a VerificationSession to remove all collected information from Stripe. This will redact
106
+ # the VerificationSession and all objects related to it, including VerificationReports, Events,
107
+ # request logs, etc.
108
+ #
109
+ # A VerificationSession object can be redacted when it is in requires_input or verified
110
+ # [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action
111
+ # state will automatically cancel it.
112
+ #
113
+ # The redaction process may take up to four days. When the redaction process is in progress, the
114
+ # VerificationSession's redaction.status field will be set to processing; when the process is
115
+ # finished, it will change to redacted and an identity.verification_session.redacted event
116
+ # will be emitted.
117
+ #
118
+ # Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the
119
+ # fields that contain personal data will be replaced by the string [redacted] or a similar
120
+ # placeholder. The metadata field will also be erased. Redacted objects cannot be updated or
121
+ # used for any purpose.
122
+ #
123
+ # [Learn more](https://stripe.com/docs/identity/verification-sessions#redact).
124
+ def self.redact(session, params = {}, opts = {})
125
+ request_stripe_object(
126
+ method: :post,
127
+ path: format("/v1/identity/verification_sessions/%<session>s/redact", { session: CGI.escape(session) }),
128
+ params: params,
129
+ opts: opts
130
+ )
131
+ end
132
+
133
+ # Updates a VerificationSession object.
134
+ #
135
+ # When the session status is requires_input, you can use this method to update the
136
+ # verification check and options.
137
+ def self.update(session, params = {}, opts = {})
138
+ request_stripe_object(
139
+ method: :post,
140
+ path: format("/v1/identity/verification_sessions/%<session>s", { session: CGI.escape(session) }),
29
141
  params: params,
30
142
  opts: opts
31
143
  )