stripe 19.7.0.pre.alpha.3 → 19.7.0.pre.alpha.5

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 (247) hide show
  1. checksums.yaml +4 -4
  2. data/lib/stripe/api_requestor.rb +20 -1
  3. data/lib/stripe/api_version.rb +1 -1
  4. data/lib/stripe/errors.rb +6 -0
  5. data/lib/stripe/event_types.rb +48 -0
  6. data/lib/stripe/events/v1_balance_available_event.rb +3 -1
  7. data/lib/stripe/events/v1_balance_settings_updated_event.rb +3 -1
  8. data/lib/stripe/events/v1_cash_balance_funds_available_event.rb +3 -1
  9. data/lib/stripe/events/v1_setup_intent_succeeded_event.rb +2 -2
  10. data/lib/stripe/events/v1_tax_settings_updated_event.rb +3 -1
  11. data/lib/stripe/events/v2_billing_contract_collection_blocked_event.rb +44 -0
  12. data/lib/stripe/events/v2_billing_contract_collection_current_event.rb +44 -0
  13. data/lib/stripe/events/v2_billing_contract_collection_past_due_event.rb +44 -0
  14. data/lib/stripe/events/v2_billing_contract_collection_unpaid_event.rb +44 -0
  15. data/lib/stripe/events/v2_core_vault_network_token_activated_event.rb +44 -0
  16. data/lib/stripe/events/v2_core_vault_network_token_authorization_requirements_changed_event.rb +48 -0
  17. data/lib/stripe/events/v2_core_vault_network_token_deactivated_event.rb +46 -0
  18. data/lib/stripe/events/v2_core_vault_network_token_details_updated_event.rb +44 -0
  19. data/lib/stripe/events/v2_core_vault_network_token_suspended_event.rb +44 -0
  20. data/lib/stripe/events/v2_money_management_financial_account_wallet_export_completed_event.rb +44 -0
  21. data/lib/stripe/events/v2_money_management_financial_account_wallet_export_pending_event.rb +44 -0
  22. data/lib/stripe/events/v2_money_management_financial_account_wallet_export_ready_event.rb +44 -0
  23. data/lib/stripe/object_types.rb +17 -1
  24. data/lib/stripe/params/account_create_params.rb +15 -15
  25. data/lib/stripe/params/account_external_account_update_params.rb +1 -1
  26. data/lib/stripe/params/account_person_create_params.rb +7 -7
  27. data/lib/stripe/params/account_person_update_params.rb +7 -7
  28. data/lib/stripe/params/account_update_params.rb +16 -16
  29. data/lib/stripe/params/balance_settings_update_params.rb +9 -1
  30. data/lib/stripe/params/balance_transaction_list_params.rb +1 -1
  31. data/lib/stripe/params/charge_create_params.rb +1 -1
  32. data/lib/stripe/params/checkout/session_approve_params.rb +27 -0
  33. data/lib/stripe/params/checkout/session_create_params.rb +23 -3
  34. data/lib/stripe/params/checkout/session_update_params.rb +2 -2
  35. data/lib/stripe/params/confirmation_token_create_params.rb +2 -2
  36. data/lib/stripe/params/customer_session_create_params.rb +4 -0
  37. data/lib/stripe/params/external_account_update_params.rb +1 -1
  38. data/lib/stripe/params/file_create_params.rb +1 -1
  39. data/lib/stripe/params/financial_connections/consent_create_params.rb +38 -0
  40. data/lib/stripe/params/financial_connections/consent_retrieve_params.rb +15 -0
  41. data/lib/stripe/params/financial_connections/session_create_params.rb +1 -1
  42. data/lib/stripe/params/invoice_create_params.rb +17 -1
  43. data/lib/stripe/params/invoice_create_preview_params.rb +6 -2
  44. data/lib/stripe/params/invoice_update_params.rb +17 -1
  45. data/lib/stripe/params/issuing/cardholder_create_params.rb +2 -2
  46. data/lib/stripe/params/issuing/cardholder_update_params.rb +2 -2
  47. data/lib/stripe/params/payment_intent_confirm_params.rb +3 -3
  48. data/lib/stripe/params/payment_intent_create_params.rb +5 -5
  49. data/lib/stripe/params/payment_intent_update_params.rb +4 -4
  50. data/lib/stripe/params/payment_link_create_params.rb +1 -1
  51. data/lib/stripe/params/payment_link_update_params.rb +1 -1
  52. data/lib/stripe/params/payment_method_create_params.rb +2 -2
  53. data/lib/stripe/params/payment_plan_create_params.rb +2 -2
  54. data/lib/stripe/params/payment_plan_update_params.rb +2 -2
  55. data/lib/stripe/params/payout_create_params.rb +21 -1
  56. data/lib/stripe/params/product_list_params.rb +1 -1
  57. data/lib/stripe/params/radar/payment_evaluation_create_params.rb +1 -1
  58. data/lib/stripe/params/setup_intent_confirm_params.rb +2 -2
  59. data/lib/stripe/params/setup_intent_create_params.rb +2 -2
  60. data/lib/stripe/params/setup_intent_update_params.rb +2 -2
  61. data/lib/stripe/params/subscription_create_params.rb +16 -0
  62. data/lib/stripe/params/subscription_item_update_params.rb +2 -2
  63. data/lib/stripe/params/subscription_update_params.rb +18 -2
  64. data/lib/stripe/params/tax/form_list_params.rb +1 -1
  65. data/lib/stripe/params/terminal/reader_list_params.rb +5 -1
  66. data/lib/stripe/params/test_helpers/confirmation_token_create_params.rb +2 -2
  67. data/lib/stripe/params/token_create_params.rb +13 -13
  68. data/lib/stripe/params/treasury/inbound_transfer_create_params.rb +28 -0
  69. data/lib/stripe/params/v2/billing/contract_create_params.rb +4 -1
  70. data/lib/stripe/params/v2/billing/contract_update_params.rb +8 -2
  71. data/lib/stripe/params/v2/core/account_create_params.rb +48 -0
  72. data/lib/stripe/params/v2/core/account_update_params.rb +51 -0
  73. data/lib/stripe/params/v2/core/vault/network_token_create_from_credential_params.rb +33 -0
  74. data/lib/stripe/params/v2/core/vault/network_token_create_params.rb +59 -0
  75. data/lib/stripe/params/v2/core/vault/network_token_generate_cryptogram_params.rb +19 -0
  76. data/lib/stripe/params/v2/core/vault/network_token_retrieve_params.rb +12 -0
  77. data/lib/stripe/params/v2/money_management/financial_account_close_params.rb +4 -1
  78. data/lib/stripe/params/v2/money_management/financial_account_create_params.rb +15 -1
  79. data/lib/stripe/params/v2/money_management/financial_account_update_params.rb +35 -2
  80. data/lib/stripe/params/v2/money_management/financial_accounts/wallet_export_export_credentials_params.rb +30 -0
  81. data/lib/stripe/params/v2/money_management/financial_accounts/wallet_export_retrieve_params.rb +12 -0
  82. data/lib/stripe/params/v2/money_management/financial_address_create_params.rb +23 -20
  83. data/lib/stripe/params/v2/money_management/financial_address_list_params.rb +1 -4
  84. data/lib/stripe/params/v2/money_management/financial_address_retrieve_params.rb +1 -8
  85. data/lib/stripe/params/v2/money_management/outbound_payment_create_params.rb +4 -1
  86. data/lib/stripe/params/v2/money_management/outbound_payment_quote_create_params.rb +4 -1
  87. data/lib/stripe/params/v2/money_management/outbound_setup_intent_create_params.rb +22 -1
  88. data/lib/stripe/params/v2/money_management/outbound_transfer_create_params.rb +20 -1
  89. data/lib/stripe/params/v2/money_management/payout_intent_create_params.rb +4 -1
  90. data/lib/stripe/params/v2/money_management/payout_intent_update_params.rb +4 -1
  91. data/lib/stripe/params/v2/payments/off_session_payment_create_params.rb +5 -1
  92. data/lib/stripe/params/v2/provisioning/catalog/provider_list_params.rb +26 -0
  93. data/lib/stripe/params/v2/provisioning/catalog/service_list_params.rb +29 -0
  94. data/lib/stripe/params/v2/provisioning/eligibility_retrieve_params.rb +10 -0
  95. data/lib/stripe/params/v2/provisioning/payment_method_request_create_params.rb +62 -0
  96. data/lib/stripe/params/v2/provisioning/payment_profile_retrieve_params.rb +18 -0
  97. data/lib/stripe/params/v2/provisioning/payment_profile_update_limit_params.rb +46 -0
  98. data/lib/stripe/params/v2/provisioning/project_create_params.rb +23 -0
  99. data/lib/stripe/params/v2/provisioning/provider_connection_list_params.rb +17 -0
  100. data/lib/stripe/params/v2/provisioning/provider_connection_request_create_params.rb +41 -0
  101. data/lib/stripe/params/v2/provisioning/provider_connection_request_retrieve_params.rb +10 -0
  102. data/lib/stripe/params/v2/provisioning/provider_connection_request_submit_information_params.rb +21 -0
  103. data/lib/stripe/params/v2/provisioning/provider_connection_unlink_params.rb +10 -0
  104. data/lib/stripe/params/v2/provisioning/resource_create_params.rb +47 -0
  105. data/lib/stripe/params/v2/provisioning/resource_link_params.rb +39 -0
  106. data/lib/stripe/params/v2/provisioning/resource_remove_params.rb +10 -0
  107. data/lib/stripe/params/v2/provisioning/resource_retrieve_params.rb +10 -0
  108. data/lib/stripe/params/v2/provisioning/resource_rotate_credentials_params.rb +10 -0
  109. data/lib/stripe/params/v2/provisioning/resource_submit_information_params.rb +17 -0
  110. data/lib/stripe/params/v2/provisioning/resource_unlink_params.rb +10 -0
  111. data/lib/stripe/params/v2/provisioning/resource_update_params.rb +24 -0
  112. data/lib/stripe/params/v2/signals/account_activity_create_params.rb +14 -0
  113. data/lib/stripe/params.rb +69 -2
  114. data/lib/stripe/resources/account.rb +24 -4
  115. data/lib/stripe/resources/account_session.rb +1 -28
  116. data/lib/stripe/resources/apps/install.rb +118 -0
  117. data/lib/stripe/resources/balance.rb +3 -1
  118. data/lib/stripe/resources/balance_settings.rb +2 -0
  119. data/lib/stripe/resources/capital/financing_offer.rb +2 -0
  120. data/lib/stripe/resources/capital/financing_summary.rb +6 -0
  121. data/lib/stripe/resources/charge.rb +11 -15
  122. data/lib/stripe/resources/checkout/session.rb +39 -5
  123. data/lib/stripe/resources/coupon.rb +2 -2
  124. data/lib/stripe/resources/customer.rb +1 -1
  125. data/lib/stripe/resources/customer_cash_balance_transaction.rb +6 -0
  126. data/lib/stripe/resources/customer_session.rb +2 -0
  127. data/lib/stripe/resources/delegated_checkout/requested_session.rb +1 -1
  128. data/lib/stripe/resources/discount.rb +1 -1
  129. data/lib/stripe/resources/dispute.rb +30 -1
  130. data/lib/stripe/resources/event.rb +1 -1
  131. data/lib/stripe/resources/file.rb +2 -2
  132. data/lib/stripe/resources/financial_connections/consent.rb +69 -0
  133. data/lib/stripe/resources/financial_connections/session.rb +16 -0
  134. data/lib/stripe/resources/financial_connections/transaction.rb +4 -4
  135. data/lib/stripe/resources/invoice.rb +25 -6
  136. data/lib/stripe/resources/invoice_item.rb +1 -1
  137. data/lib/stripe/resources/invoice_payment.rb +2 -2
  138. data/lib/stripe/resources/issuing/authorization.rb +45 -1
  139. data/lib/stripe/resources/issuing/cardholder.rb +2 -2
  140. data/lib/stripe/resources/issuing/token.rb +3 -3
  141. data/lib/stripe/resources/line_item.rb +1 -1
  142. data/lib/stripe/resources/mandate.rb +1 -1
  143. data/lib/stripe/resources/order.rb +1 -1
  144. data/lib/stripe/resources/payment_attempt_record.rb +36 -2
  145. data/lib/stripe/resources/payment_intent.rb +28 -6
  146. data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +2 -2
  147. data/lib/stripe/resources/payment_link.rb +1 -1
  148. data/lib/stripe/resources/payment_record.rb +36 -2
  149. data/lib/stripe/resources/payout.rb +28 -1
  150. data/lib/stripe/resources/person.rb +4 -4
  151. data/lib/stripe/resources/plan.rb +2 -2
  152. data/lib/stripe/resources/price.rb +1 -1
  153. data/lib/stripe/resources/product.rb +2 -2
  154. data/lib/stripe/resources/product_catalog/trial_offer.rb +3 -3
  155. data/lib/stripe/resources/quote.rb +3 -3
  156. data/lib/stripe/resources/quote_preview_invoice.rb +23 -5
  157. data/lib/stripe/resources/radar/payment_evaluation.rb +45 -3
  158. data/lib/stripe/resources/setup_attempt.rb +19 -3
  159. data/lib/stripe/resources/setup_intent.rb +38 -6
  160. data/lib/stripe/resources/subscription.rb +21 -1
  161. data/lib/stripe/resources/subscription_item.rb +3 -3
  162. data/lib/stripe/resources/tax/calculation_line_item.rb +1 -0
  163. data/lib/stripe/resources/tax/form.rb +1 -1
  164. data/lib/stripe/resources/tax/location.rb +3 -3
  165. data/lib/stripe/resources/tax/registration.rb +27 -417
  166. data/lib/stripe/resources/tax/transaction_line_item.rb +1 -0
  167. data/lib/stripe/resources/tax_code.rb +1 -1
  168. data/lib/stripe/resources/terminal/reader.rb +3 -3
  169. data/lib/stripe/resources/transfer.rb +1 -1
  170. data/lib/stripe/resources/treasury/credit_reversal.rb +1 -1
  171. data/lib/stripe/resources/treasury/debit_reversal.rb +1 -1
  172. data/lib/stripe/resources/treasury/inbound_transfer.rb +17 -3
  173. data/lib/stripe/resources/treasury/outbound_payment.rb +1 -1
  174. data/lib/stripe/resources/treasury/outbound_transfer.rb +1 -1
  175. data/lib/stripe/resources/treasury/received_credit.rb +7 -7
  176. data/lib/stripe/resources/treasury/received_debit.rb +6 -6
  177. data/lib/stripe/resources/treasury/transaction.rb +8 -8
  178. data/lib/stripe/resources/treasury/transaction_entry.rb +8 -8
  179. data/lib/stripe/resources/v2/billing/contract.rb +26 -0
  180. data/lib/stripe/resources/v2/core/account.rb +207 -0
  181. data/lib/stripe/resources/v2/core/event_destination.rb +1 -1
  182. data/lib/stripe/resources/v2/core/event_notification.rb +15 -1
  183. data/lib/stripe/resources/v2/core/fee_batch.rb +10 -20
  184. data/lib/stripe/resources/v2/core/fee_entry.rb +4 -8
  185. data/lib/stripe/resources/v2/core/vault/network_token.rb +61 -0
  186. data/lib/stripe/resources/v2/money_management/financial_account.rb +19 -1
  187. data/lib/stripe/resources/v2/money_management/financial_account_wallet_export.rb +53 -0
  188. data/lib/stripe/resources/v2/money_management/financial_account_wallet_export_credentials.rb +67 -0
  189. data/lib/stripe/resources/v2/money_management/financial_address.rb +106 -119
  190. data/lib/stripe/resources/v2/money_management/inbound_transfer.rb +5 -5
  191. data/lib/stripe/resources/v2/money_management/outbound_payment.rb +2 -0
  192. data/lib/stripe/resources/v2/money_management/outbound_payment_quote.rb +2 -0
  193. data/lib/stripe/resources/v2/money_management/outbound_transfer.rb +27 -1
  194. data/lib/stripe/resources/v2/money_management/payout_intent.rb +2 -0
  195. data/lib/stripe/resources/v2/money_management/payout_method.rb +27 -0
  196. data/lib/stripe/resources/v2/money_management/received_credit.rb +190 -10
  197. data/lib/stripe/resources/v2/payments/off_session_payment.rb +95 -1
  198. data/lib/stripe/resources/v2/provisioning/eligibility.rb +34 -0
  199. data/lib/stripe/resources/v2/provisioning/payment_method_request.rb +33 -0
  200. data/lib/stripe/resources/v2/provisioning/payment_profile.rb +111 -0
  201. data/lib/stripe/resources/v2/provisioning/project.rb +56 -0
  202. data/lib/stripe/resources/v2/provisioning/provider.rb +56 -0
  203. data/lib/stripe/resources/v2/provisioning/provider_connection.rb +82 -0
  204. data/lib/stripe/resources/v2/provisioning/provider_connection_request.rb +65 -0
  205. data/lib/stripe/resources/v2/provisioning/provider_service_detail.rb +221 -0
  206. data/lib/stripe/resources/v2/provisioning/resource.rb +67 -0
  207. data/lib/stripe/resources/v2/signals/account_activity.rb +17 -0
  208. data/lib/stripe/resources/webhook_endpoint.rb +1 -1
  209. data/lib/stripe/resources.rb +86 -2
  210. data/lib/stripe/services/account_session_service.rb +1 -1
  211. data/lib/stripe/services/charge_service.rb +2 -8
  212. data/lib/stripe/services/financial_connections/account_service.rb +1 -1
  213. data/lib/stripe/services/financial_connections/authorization_service.rb +1 -1
  214. data/lib/stripe/services/financial_connections/consent_service.rb +30 -0
  215. data/lib/stripe/services/financial_connections_service.rb +2 -1
  216. data/lib/stripe/services/invoice_service.rb +2 -1
  217. data/lib/stripe/services/radar_service.rb +1 -2
  218. data/lib/stripe/services/tax/location_service.rb +2 -2
  219. data/lib/stripe/services/v2/billing/contract_service.rb +7 -0
  220. data/lib/stripe/services/v2/core/vault/network_token_service.rb +67 -0
  221. data/lib/stripe/services/v2/core/vault_service.rb +2 -1
  222. data/lib/stripe/services/v2/money_management/financial_account_service.rb +3 -1
  223. data/lib/stripe/services/v2/money_management/financial_accounts/wallet_export_service.rb +36 -0
  224. data/lib/stripe/services/v2/money_management/financial_address_service.rb +3 -3
  225. data/lib/stripe/services/v2/money_management/payout_intent_service.rb +2 -0
  226. data/lib/stripe/services/v2/provisioning/catalog/provider_service.rb +23 -0
  227. data/lib/stripe/services/v2/provisioning/catalog/service_service.rb +23 -0
  228. data/lib/stripe/services/v2/provisioning/catalog_service.rb +18 -0
  229. data/lib/stripe/services/v2/provisioning/eligibility_service.rb +22 -0
  230. data/lib/stripe/services/v2/provisioning/payment_method_request_service.rb +25 -0
  231. data/lib/stripe/services/v2/provisioning/payment_profile_service.rb +36 -0
  232. data/lib/stripe/services/v2/provisioning/project_service.rb +21 -0
  233. data/lib/stripe/services/v2/provisioning/provider_connection_request_service.rb +43 -0
  234. data/lib/stripe/services/v2/provisioning/provider_connection_service.rb +32 -0
  235. data/lib/stripe/services/v2/provisioning/resource_service.rb +98 -0
  236. data/lib/stripe/services/v2/provisioning_service.rb +24 -0
  237. data/lib/stripe/services/v2_services.rb +2 -1
  238. data/lib/stripe/services.rb +34 -2
  239. data/lib/stripe/stripe_event_notification_handler.rb +48 -0
  240. data/lib/stripe/version.rb +1 -1
  241. data/lib/stripe/webhook.rb +8 -0
  242. data/rbi/stripe/stripe_client.rbi +1 -1
  243. data/rbi/stripe.rbi +4877 -2053
  244. metadata +70 -5
  245. data/lib/stripe/params/radar/billing_evaluation_create_params.rb +0 -231
  246. data/lib/stripe/resources/radar/billing_evaluation.rb +0 -281
  247. data/lib/stripe/services/radar/billing_evaluation_service.rb +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b3e9493d61acb2af158d611ad82e3dc2cf7b36d07ee5fc0accc2f3dab6c4e13d
4
- data.tar.gz: 91f91213e19c6fee06984cb3eb5158448f5e82d595967c667c93afff11a71a0a
3
+ metadata.gz: 702721575e9e1c914abf91e2b88e1e9e45b60d9223dbfc7edb5d3405522ddf60
4
+ data.tar.gz: 7623a64ad6c2e74d7f54cd40e090c2ac338f8f73042b795aa9acbc8e805bf9db
5
5
  SHA512:
6
- metadata.gz: 5c4c6b3406dbe41f746b7a09415144758b7c6da83e21b83d32decee25fed88facfd46285643bb6ad395e167079cc0b2e9f740024a4d874f8027688c07021e383
7
- data.tar.gz: a204443120957ba91c61f9d7028eb29566e34b51305f912c1580478f987ed075b305a548d091ca2dc58614a85d4c3ca4e34e99c804932b49fb1b81c0152ee72e
6
+ metadata.gz: feffd2f75fd000dccb5ad10b047ccf888a1c89b98d31cf4afc0ba3674f185238f6b4a32c8505570928fd3422a7d46839c94c032107b099894ce495835ac7ee38
7
+ data.tar.gz: db2efeaef02410c8701b1891c8b6df17795c806b012d0aed369422180bf7bab03b37dffb755a0c6ec5bf44946e3f7e3de5f5da76e0bd06779b36e9c7389634a2
@@ -203,7 +203,7 @@ module Stripe
203
203
  req_opts = RequestOptions.extract_opts_from_hash(req_opts)
204
204
 
205
205
  notice = http_resp["stripe-notice"]
206
- warn("WARNING: #{notice}") if notice
206
+ maybe_emit_stripe_notice(notice)
207
207
 
208
208
  resp = interpret_response(http_resp)
209
209
 
@@ -218,6 +218,20 @@ module Stripe
218
218
  v2_deleted_object: method == :delete && api_mode == :v2)
219
219
  end
220
220
 
221
+ private def maybe_emit_stripe_notice(notice, env = ENV)
222
+ return unless notice
223
+
224
+ ai_agent = SystemProfiler.detect_ai_agent(env)
225
+ return if ai_agent.empty? && env.fetch("STRIPE_SUPPRESS_NOTICES", "").downcase == "true"
226
+
227
+ if ai_agent.empty?
228
+ notice += "\nTo suppress Stripe notices in test and sandbox environments, " \
229
+ "set the STRIPE_SUPPRESS_NOTICES environment variable to true."
230
+ end
231
+
232
+ warn("WARNING: #{notice}")
233
+ end
234
+
221
235
  # Execute request without instantiating a new object if the relevant object's name matches the class
222
236
  #
223
237
  # For internal use only. Does not provide a stable API and may be broken
@@ -889,6 +903,8 @@ module Stripe
889
903
 
890
904
  when "invalid_payout_method"
891
905
  InvalidPayoutMethodError.new(error_data[:message], **opts)
906
+ when "merchant_not_gated"
907
+ MerchantNotGatedError.new(error_data[:message], **opts)
892
908
  when "non_zero_balance"
893
909
  NonZeroBalanceError.new(error_data[:message], **opts)
894
910
  when "not_cancelable"
@@ -899,6 +915,8 @@ module Stripe
899
915
  RateLimitError.new(error_data[:message], **opts)
900
916
  when "recipient_not_notifiable"
901
917
  RecipientNotNotifiableError.new(error_data[:message], **opts)
918
+ when "service_unavailable"
919
+ ServiceUnavailableError.new(error_data[:message], **opts)
902
920
  when "temporary_session_expired"
903
921
  TemporarySessionExpiredError.new(error_data[:message], **opts)
904
922
  # switch cases: The end of the section generated from our OpenAPI spec
@@ -1118,6 +1136,7 @@ module Stripe
1118
1136
  %w[CODEX_CI codex_cli],
1119
1137
  %w[CURSOR_AGENT cursor],
1120
1138
  %w[GEMINI_CLI gemini_cli],
1139
+ %w[HERMES_AGENT hermes],
1121
1140
  %w[OPENCLAW_SHELL openclaw],
1122
1141
  %w[OPENCODE open_code],
1123
1142
  # aiAgents: The end of the section generated from our OpenAPI spec
@@ -3,7 +3,7 @@
3
3
 
4
4
  module Stripe
5
5
  module ApiVersion
6
- CURRENT = "2026-08-26.preview"
6
+ CURRENT = "2026-09-23.preview"
7
7
  CURRENT_MAJOR = ""
8
8
  end
9
9
  end
data/lib/stripe/errors.rb CHANGED
@@ -243,6 +243,9 @@ module Stripe
243
243
  class InvalidPayoutMethodError < StripeError
244
244
  end
245
245
 
246
+ class MerchantNotGatedError < StripeError
247
+ end
248
+
246
249
  class NonZeroBalanceError < StripeError
247
250
  end
248
251
 
@@ -258,6 +261,9 @@ module Stripe
258
261
  class RecipientNotNotifiableError < StripeError
259
262
  end
260
263
 
264
+ class ServiceUnavailableError < StripeError
265
+ end
266
+
261
267
  class TemporarySessionExpiredError < StripeError
262
268
  end
263
269
  # class definitions: The end of the section generated from our OpenAPI spec
@@ -305,6 +305,14 @@ module Stripe
305
305
  Events::V2BillingCadenceCreatedEvent.lookup_type => Events::V2BillingCadenceCreatedEvent,
306
306
  Events::V2BillingContractActivatedEvent.lookup_type => Events::V2BillingContractActivatedEvent,
307
307
  Events::V2BillingContractCanceledEvent.lookup_type => Events::V2BillingContractCanceledEvent,
308
+ Events::V2BillingContractCollectionBlockedEvent.lookup_type =>
309
+ Events::V2BillingContractCollectionBlockedEvent,
310
+ Events::V2BillingContractCollectionCurrentEvent.lookup_type =>
311
+ Events::V2BillingContractCollectionCurrentEvent,
312
+ Events::V2BillingContractCollectionPastDueEvent.lookup_type =>
313
+ Events::V2BillingContractCollectionPastDueEvent,
314
+ Events::V2BillingContractCollectionUnpaidEvent.lookup_type =>
315
+ Events::V2BillingContractCollectionUnpaidEvent,
308
316
  Events::V2BillingContractCreatedEvent.lookup_type => Events::V2BillingContractCreatedEvent,
309
317
  Events::V2BillingContractEndedEvent.lookup_type => Events::V2BillingContractEndedEvent,
310
318
  Events::V2BillingContractUpdatedEvent.lookup_type => Events::V2BillingContractUpdatedEvent,
@@ -498,6 +506,16 @@ module Stripe
498
506
  Events::V2CoreHealthWebhookLatencyFiringEvent,
499
507
  Events::V2CoreHealthWebhookLatencyResolvedEvent.lookup_type =>
500
508
  Events::V2CoreHealthWebhookLatencyResolvedEvent,
509
+ Events::V2CoreVaultNetworkTokenActivatedEvent.lookup_type =>
510
+ Events::V2CoreVaultNetworkTokenActivatedEvent,
511
+ Events::V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEvent.lookup_type =>
512
+ Events::V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEvent,
513
+ Events::V2CoreVaultNetworkTokenDeactivatedEvent.lookup_type =>
514
+ Events::V2CoreVaultNetworkTokenDeactivatedEvent,
515
+ Events::V2CoreVaultNetworkTokenDetailsUpdatedEvent.lookup_type =>
516
+ Events::V2CoreVaultNetworkTokenDetailsUpdatedEvent,
517
+ Events::V2CoreVaultNetworkTokenSuspendedEvent.lookup_type =>
518
+ Events::V2CoreVaultNetworkTokenSuspendedEvent,
501
519
  Events::V2DataReportingQueryRunCreatedEvent.lookup_type =>
502
520
  Events::V2DataReportingQueryRunCreatedEvent,
503
521
  Events::V2DataReportingQueryRunFailedEvent.lookup_type =>
@@ -545,6 +563,12 @@ module Stripe
545
563
  Events::V2MoneyManagementFinancialAccountStatementRestatedEvent,
546
564
  Events::V2MoneyManagementFinancialAccountUpdatedEvent.lookup_type =>
547
565
  Events::V2MoneyManagementFinancialAccountUpdatedEvent,
566
+ Events::V2MoneyManagementFinancialAccountWalletExportCompletedEvent.lookup_type =>
567
+ Events::V2MoneyManagementFinancialAccountWalletExportCompletedEvent,
568
+ Events::V2MoneyManagementFinancialAccountWalletExportPendingEvent.lookup_type =>
569
+ Events::V2MoneyManagementFinancialAccountWalletExportPendingEvent,
570
+ Events::V2MoneyManagementFinancialAccountWalletExportReadyEvent.lookup_type =>
571
+ Events::V2MoneyManagementFinancialAccountWalletExportReadyEvent,
548
572
  Events::V2MoneyManagementFinancialAddressActivatedEvent.lookup_type =>
549
573
  Events::V2MoneyManagementFinancialAddressActivatedEvent,
550
574
  Events::V2MoneyManagementFinancialAddressFailedEvent.lookup_type =>
@@ -1107,6 +1131,14 @@ module Stripe
1107
1131
  Events::V2BillingContractActivatedEventNotification,
1108
1132
  Events::V2BillingContractCanceledEventNotification.lookup_type =>
1109
1133
  Events::V2BillingContractCanceledEventNotification,
1134
+ Events::V2BillingContractCollectionBlockedEventNotification.lookup_type =>
1135
+ Events::V2BillingContractCollectionBlockedEventNotification,
1136
+ Events::V2BillingContractCollectionCurrentEventNotification.lookup_type =>
1137
+ Events::V2BillingContractCollectionCurrentEventNotification,
1138
+ Events::V2BillingContractCollectionPastDueEventNotification.lookup_type =>
1139
+ Events::V2BillingContractCollectionPastDueEventNotification,
1140
+ Events::V2BillingContractCollectionUnpaidEventNotification.lookup_type =>
1141
+ Events::V2BillingContractCollectionUnpaidEventNotification,
1110
1142
  Events::V2BillingContractCreatedEventNotification.lookup_type =>
1111
1143
  Events::V2BillingContractCreatedEventNotification,
1112
1144
  Events::V2BillingContractEndedEventNotification.lookup_type =>
@@ -1337,6 +1369,16 @@ module Stripe
1337
1369
  Events::V2CoreHealthWebhookLatencyFiringEventNotification,
1338
1370
  Events::V2CoreHealthWebhookLatencyResolvedEventNotification.lookup_type =>
1339
1371
  Events::V2CoreHealthWebhookLatencyResolvedEventNotification,
1372
+ Events::V2CoreVaultNetworkTokenActivatedEventNotification.lookup_type =>
1373
+ Events::V2CoreVaultNetworkTokenActivatedEventNotification,
1374
+ Events::V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEventNotification.lookup_type =>
1375
+ Events::V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEventNotification,
1376
+ Events::V2CoreVaultNetworkTokenDeactivatedEventNotification.lookup_type =>
1377
+ Events::V2CoreVaultNetworkTokenDeactivatedEventNotification,
1378
+ Events::V2CoreVaultNetworkTokenDetailsUpdatedEventNotification.lookup_type =>
1379
+ Events::V2CoreVaultNetworkTokenDetailsUpdatedEventNotification,
1380
+ Events::V2CoreVaultNetworkTokenSuspendedEventNotification.lookup_type =>
1381
+ Events::V2CoreVaultNetworkTokenSuspendedEventNotification,
1340
1382
  Events::V2DataReportingQueryRunCreatedEventNotification.lookup_type =>
1341
1383
  Events::V2DataReportingQueryRunCreatedEventNotification,
1342
1384
  Events::V2DataReportingQueryRunFailedEventNotification.lookup_type =>
@@ -1393,6 +1435,12 @@ module Stripe
1393
1435
  Events::V2MoneyManagementFinancialAccountStatementRestatedEventNotification,
1394
1436
  Events::V2MoneyManagementFinancialAccountUpdatedEventNotification.lookup_type =>
1395
1437
  Events::V2MoneyManagementFinancialAccountUpdatedEventNotification,
1438
+ Events::V2MoneyManagementFinancialAccountWalletExportCompletedEventNotification.lookup_type =>
1439
+ Events::V2MoneyManagementFinancialAccountWalletExportCompletedEventNotification,
1440
+ Events::V2MoneyManagementFinancialAccountWalletExportPendingEventNotification.lookup_type =>
1441
+ Events::V2MoneyManagementFinancialAccountWalletExportPendingEventNotification,
1442
+ Events::V2MoneyManagementFinancialAccountWalletExportReadyEventNotification.lookup_type =>
1443
+ Events::V2MoneyManagementFinancialAccountWalletExportReadyEventNotification,
1396
1444
  Events::V2MoneyManagementFinancialAddressActivatedEventNotification.lookup_type =>
1397
1445
  Events::V2MoneyManagementFinancialAddressActivatedEventNotification,
1398
1446
  Events::V2MoneyManagementFinancialAddressFailedEventNotification.lookup_type =>
@@ -28,7 +28,9 @@ module Stripe
28
28
  end
29
29
 
30
30
  attr_reader :related_object
31
-
31
+ private def related_object_class
32
+ Stripe::V2::Core::RelatedSingletonObject
33
+ end
32
34
  # Retrieves the Balance related to this EventNotification from the Stripe API. Makes an API request on every call.
33
35
  def fetch_related_object
34
36
  resp = @client.raw_request(
@@ -28,7 +28,9 @@ module Stripe
28
28
  end
29
29
 
30
30
  attr_reader :related_object
31
-
31
+ private def related_object_class
32
+ Stripe::V2::Core::RelatedSingletonObject
33
+ end
32
34
  # Retrieves the BalanceSettings related to this EventNotification from the Stripe API. Makes an API request on every call.
33
35
  def fetch_related_object
34
36
  resp = @client.raw_request(
@@ -28,7 +28,9 @@ module Stripe
28
28
  end
29
29
 
30
30
  attr_reader :related_object
31
-
31
+ private def related_object_class
32
+ Stripe::V2::Core::RelatedSingletonObject
33
+ end
32
34
  # Retrieves the CashBalance related to this EventNotification from the Stripe API. Makes an API request on every call.
33
35
  def fetch_related_object
34
36
  resp = @client.raw_request(
@@ -3,7 +3,7 @@
3
3
 
4
4
  module Stripe
5
5
  module Events
6
- # Occurs when an SetupIntent has successfully setup a payment method.
6
+ # Occurs when a SetupIntent has successfully setup a payment method.
7
7
  class V1SetupIntentSucceededEvent < Stripe::V2::Core::Event
8
8
  def self.lookup_type
9
9
  "v1.setup_intent.succeeded"
@@ -21,7 +21,7 @@ module Stripe
21
21
  attr_reader :related_object
22
22
  end
23
23
 
24
- # Occurs when an SetupIntent has successfully setup a payment method.
24
+ # Occurs when a SetupIntent has successfully setup a payment method.
25
25
  class V1SetupIntentSucceededEventNotification < Stripe::V2::Core::EventNotification
26
26
  def self.lookup_type
27
27
  "v1.setup_intent.succeeded"
@@ -28,7 +28,9 @@ module Stripe
28
28
  end
29
29
 
30
30
  attr_reader :related_object
31
-
31
+ private def related_object_class
32
+ Stripe::V2::Core::RelatedSingletonObject
33
+ end
32
34
  # Retrieves the Settings related to this EventNotification from the Stripe API. Makes an API request on every call.
33
35
  def fetch_related_object
34
36
  resp = @client.raw_request(
@@ -0,0 +1,44 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Events
6
+ # Occurs when a Contract's collection status transitions to blocked.
7
+ class V2BillingContractCollectionBlockedEvent < Stripe::V2::Core::Event
8
+ def self.lookup_type
9
+ "v2.billing.contract.collection_blocked"
10
+ end
11
+
12
+ # Retrieves the related object from the API. Makes an API request on every call.
13
+ def fetch_related_object
14
+ _request(
15
+ method: :get,
16
+ path: related_object.url,
17
+ base_address: :api,
18
+ opts: { stripe_context: context, "Stripe-Request-Trigger": "event=#{id}" }
19
+ )
20
+ end
21
+ attr_reader :related_object
22
+ end
23
+
24
+ # Occurs when a Contract's collection status transitions to blocked.
25
+ class V2BillingContractCollectionBlockedEventNotification < Stripe::V2::Core::EventNotification
26
+ def self.lookup_type
27
+ "v2.billing.contract.collection_blocked"
28
+ end
29
+
30
+ attr_reader :related_object
31
+
32
+ # Retrieves the Contract related to this EventNotification from the Stripe API. Makes an API request on every call.
33
+ def fetch_related_object
34
+ resp = @client.raw_request(
35
+ :get,
36
+ related_object.url,
37
+ opts: { stripe_context: context, "Stripe-Request-Trigger": "event=#{id}" },
38
+ usage: ["fetch_related_object"]
39
+ )
40
+ @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url))
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,44 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Events
6
+ # Occurs when a Contract's collection status transitions to current.
7
+ class V2BillingContractCollectionCurrentEvent < Stripe::V2::Core::Event
8
+ def self.lookup_type
9
+ "v2.billing.contract.collection_current"
10
+ end
11
+
12
+ # Retrieves the related object from the API. Makes an API request on every call.
13
+ def fetch_related_object
14
+ _request(
15
+ method: :get,
16
+ path: related_object.url,
17
+ base_address: :api,
18
+ opts: { stripe_context: context, "Stripe-Request-Trigger": "event=#{id}" }
19
+ )
20
+ end
21
+ attr_reader :related_object
22
+ end
23
+
24
+ # Occurs when a Contract's collection status transitions to current.
25
+ class V2BillingContractCollectionCurrentEventNotification < Stripe::V2::Core::EventNotification
26
+ def self.lookup_type
27
+ "v2.billing.contract.collection_current"
28
+ end
29
+
30
+ attr_reader :related_object
31
+
32
+ # Retrieves the Contract related to this EventNotification from the Stripe API. Makes an API request on every call.
33
+ def fetch_related_object
34
+ resp = @client.raw_request(
35
+ :get,
36
+ related_object.url,
37
+ opts: { stripe_context: context, "Stripe-Request-Trigger": "event=#{id}" },
38
+ usage: ["fetch_related_object"]
39
+ )
40
+ @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url))
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,44 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Events
6
+ # Occurs when a Contract's collection status transitions to past due.
7
+ class V2BillingContractCollectionPastDueEvent < Stripe::V2::Core::Event
8
+ def self.lookup_type
9
+ "v2.billing.contract.collection_past_due"
10
+ end
11
+
12
+ # Retrieves the related object from the API. Makes an API request on every call.
13
+ def fetch_related_object
14
+ _request(
15
+ method: :get,
16
+ path: related_object.url,
17
+ base_address: :api,
18
+ opts: { stripe_context: context, "Stripe-Request-Trigger": "event=#{id}" }
19
+ )
20
+ end
21
+ attr_reader :related_object
22
+ end
23
+
24
+ # Occurs when a Contract's collection status transitions to past due.
25
+ class V2BillingContractCollectionPastDueEventNotification < Stripe::V2::Core::EventNotification
26
+ def self.lookup_type
27
+ "v2.billing.contract.collection_past_due"
28
+ end
29
+
30
+ attr_reader :related_object
31
+
32
+ # Retrieves the Contract related to this EventNotification from the Stripe API. Makes an API request on every call.
33
+ def fetch_related_object
34
+ resp = @client.raw_request(
35
+ :get,
36
+ related_object.url,
37
+ opts: { stripe_context: context, "Stripe-Request-Trigger": "event=#{id}" },
38
+ usage: ["fetch_related_object"]
39
+ )
40
+ @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url))
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,44 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Events
6
+ # Occurs when a Contract's collection status transitions to unpaid.
7
+ class V2BillingContractCollectionUnpaidEvent < Stripe::V2::Core::Event
8
+ def self.lookup_type
9
+ "v2.billing.contract.collection_unpaid"
10
+ end
11
+
12
+ # Retrieves the related object from the API. Makes an API request on every call.
13
+ def fetch_related_object
14
+ _request(
15
+ method: :get,
16
+ path: related_object.url,
17
+ base_address: :api,
18
+ opts: { stripe_context: context, "Stripe-Request-Trigger": "event=#{id}" }
19
+ )
20
+ end
21
+ attr_reader :related_object
22
+ end
23
+
24
+ # Occurs when a Contract's collection status transitions to unpaid.
25
+ class V2BillingContractCollectionUnpaidEventNotification < Stripe::V2::Core::EventNotification
26
+ def self.lookup_type
27
+ "v2.billing.contract.collection_unpaid"
28
+ end
29
+
30
+ attr_reader :related_object
31
+
32
+ # Retrieves the Contract related to this EventNotification from the Stripe API. Makes an API request on every call.
33
+ def fetch_related_object
34
+ resp = @client.raw_request(
35
+ :get,
36
+ related_object.url,
37
+ opts: { stripe_context: context, "Stripe-Request-Trigger": "event=#{id}" },
38
+ usage: ["fetch_related_object"]
39
+ )
40
+ @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url))
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,44 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Events
6
+ # Occurs when a token is re-activated after being suspended.
7
+ class V2CoreVaultNetworkTokenActivatedEvent < Stripe::V2::Core::Event
8
+ def self.lookup_type
9
+ "v2.core.vault.network_token.activated"
10
+ end
11
+
12
+ # Retrieves the related object from the API. Makes an API request on every call.
13
+ def fetch_related_object
14
+ _request(
15
+ method: :get,
16
+ path: related_object.url,
17
+ base_address: :api,
18
+ opts: { stripe_context: context, "Stripe-Request-Trigger": "event=#{id}" }
19
+ )
20
+ end
21
+ attr_reader :related_object
22
+ end
23
+
24
+ # Occurs when a token is re-activated after being suspended.
25
+ class V2CoreVaultNetworkTokenActivatedEventNotification < Stripe::V2::Core::EventNotification
26
+ def self.lookup_type
27
+ "v2.core.vault.network_token.activated"
28
+ end
29
+
30
+ attr_reader :related_object
31
+
32
+ # Retrieves the NetworkToken related to this EventNotification from the Stripe API. Makes an API request on every call.
33
+ def fetch_related_object
34
+ resp = @client.raw_request(
35
+ :get,
36
+ related_object.url,
37
+ opts: { stripe_context: context, "Stripe-Request-Trigger": "event=#{id}" },
38
+ usage: ["fetch_related_object"]
39
+ )
40
+ @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url))
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,48 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Events
6
+ # Occurs when a network token's authorization requirements change.
7
+ # Specifically for Mastercard: Restart any external payment series involving this token
8
+ # with a customer-initiated transaction, in conjunction with a fresh cryptogram.
9
+ class V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEvent < Stripe::V2::Core::Event
10
+ def self.lookup_type
11
+ "v2.core.vault.network_token.authorization_requirements_changed"
12
+ end
13
+
14
+ # Retrieves the related object from the API. Makes an API request on every call.
15
+ def fetch_related_object
16
+ _request(
17
+ method: :get,
18
+ path: related_object.url,
19
+ base_address: :api,
20
+ opts: { stripe_context: context, "Stripe-Request-Trigger": "event=#{id}" }
21
+ )
22
+ end
23
+ attr_reader :related_object
24
+ end
25
+
26
+ # Occurs when a network token's authorization requirements change.
27
+ # Specifically for Mastercard: Restart any external payment series involving this token
28
+ # with a customer-initiated transaction, in conjunction with a fresh cryptogram.
29
+ class V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEventNotification < Stripe::V2::Core::EventNotification
30
+ def self.lookup_type
31
+ "v2.core.vault.network_token.authorization_requirements_changed"
32
+ end
33
+
34
+ attr_reader :related_object
35
+
36
+ # Retrieves the NetworkToken related to this EventNotification from the Stripe API. Makes an API request on every call.
37
+ def fetch_related_object
38
+ resp = @client.raw_request(
39
+ :get,
40
+ related_object.url,
41
+ opts: { stripe_context: context, "Stripe-Request-Trigger": "event=#{id}" },
42
+ usage: ["fetch_related_object"]
43
+ )
44
+ @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url))
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,46 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Events
6
+ # Occurs when a network token is deactivated.
7
+ # This is a terminal state.
8
+ class V2CoreVaultNetworkTokenDeactivatedEvent < Stripe::V2::Core::Event
9
+ def self.lookup_type
10
+ "v2.core.vault.network_token.deactivated"
11
+ end
12
+
13
+ # Retrieves the related object from the API. Makes an API request on every call.
14
+ def fetch_related_object
15
+ _request(
16
+ method: :get,
17
+ path: related_object.url,
18
+ base_address: :api,
19
+ opts: { stripe_context: context, "Stripe-Request-Trigger": "event=#{id}" }
20
+ )
21
+ end
22
+ attr_reader :related_object
23
+ end
24
+
25
+ # Occurs when a network token is deactivated.
26
+ # This is a terminal state.
27
+ class V2CoreVaultNetworkTokenDeactivatedEventNotification < Stripe::V2::Core::EventNotification
28
+ def self.lookup_type
29
+ "v2.core.vault.network_token.deactivated"
30
+ end
31
+
32
+ attr_reader :related_object
33
+
34
+ # Retrieves the NetworkToken related to this EventNotification from the Stripe API. Makes an API request on every call.
35
+ def fetch_related_object
36
+ resp = @client.raw_request(
37
+ :get,
38
+ related_object.url,
39
+ opts: { stripe_context: context, "Stripe-Request-Trigger": "event=#{id}" },
40
+ usage: ["fetch_related_object"]
41
+ )
42
+ @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url))
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,44 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Events
6
+ # Occurs when a network token's details, such as its number or expiration date, are updated.
7
+ class V2CoreVaultNetworkTokenDetailsUpdatedEvent < Stripe::V2::Core::Event
8
+ def self.lookup_type
9
+ "v2.core.vault.network_token.details_updated"
10
+ end
11
+
12
+ # Retrieves the related object from the API. Makes an API request on every call.
13
+ def fetch_related_object
14
+ _request(
15
+ method: :get,
16
+ path: related_object.url,
17
+ base_address: :api,
18
+ opts: { stripe_context: context, "Stripe-Request-Trigger": "event=#{id}" }
19
+ )
20
+ end
21
+ attr_reader :related_object
22
+ end
23
+
24
+ # Occurs when a network token's details, such as its number or expiration date, are updated.
25
+ class V2CoreVaultNetworkTokenDetailsUpdatedEventNotification < Stripe::V2::Core::EventNotification
26
+ def self.lookup_type
27
+ "v2.core.vault.network_token.details_updated"
28
+ end
29
+
30
+ attr_reader :related_object
31
+
32
+ # Retrieves the NetworkToken related to this EventNotification from the Stripe API. Makes an API request on every call.
33
+ def fetch_related_object
34
+ resp = @client.raw_request(
35
+ :get,
36
+ related_object.url,
37
+ opts: { stripe_context: context, "Stripe-Request-Trigger": "event=#{id}" },
38
+ usage: ["fetch_related_object"]
39
+ )
40
+ @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url))
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,44 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Events
6
+ # Occurs when a network token is suspended.
7
+ class V2CoreVaultNetworkTokenSuspendedEvent < Stripe::V2::Core::Event
8
+ def self.lookup_type
9
+ "v2.core.vault.network_token.suspended"
10
+ end
11
+
12
+ # Retrieves the related object from the API. Makes an API request on every call.
13
+ def fetch_related_object
14
+ _request(
15
+ method: :get,
16
+ path: related_object.url,
17
+ base_address: :api,
18
+ opts: { stripe_context: context, "Stripe-Request-Trigger": "event=#{id}" }
19
+ )
20
+ end
21
+ attr_reader :related_object
22
+ end
23
+
24
+ # Occurs when a network token is suspended.
25
+ class V2CoreVaultNetworkTokenSuspendedEventNotification < Stripe::V2::Core::EventNotification
26
+ def self.lookup_type
27
+ "v2.core.vault.network_token.suspended"
28
+ end
29
+
30
+ attr_reader :related_object
31
+
32
+ # Retrieves the NetworkToken related to this EventNotification from the Stripe API. Makes an API request on every call.
33
+ def fetch_related_object
34
+ resp = @client.raw_request(
35
+ :get,
36
+ related_object.url,
37
+ opts: { stripe_context: context, "Stripe-Request-Trigger": "event=#{id}" },
38
+ usage: ["fetch_related_object"]
39
+ )
40
+ @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url))
41
+ end
42
+ end
43
+ end
44
+ end