Merge pull request #1675 from stripe/latest-codegen-beta

Update generated code for beta
This commit is contained in:
stripe-openapi[bot] 2025-09-29 11:55:30 -07:00 committed by GitHub
commit 0a5bc783fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
99 changed files with 1211 additions and 875 deletions

View File

@ -52,7 +52,7 @@ require "stripe/api_resource_test_helpers"
require "stripe/singleton_api_resource"
require "stripe/webhook"
require "stripe/stripe_configuration"
require "stripe/event_notification"
require "stripe/resources/v2/core/event_notification"
# Named API resources
require "stripe/resources"

View File

@ -111,6 +111,9 @@ module Stripe
)
end
# Retrieve by passing id like `retrieve(id)`
# If passing parameters, pass a single map with parameters and the `id` as well.
# For example: retrieve({id: some_id, some_param: some_param_value})
def self.retrieve(id, opts = {})
if name.include?("Stripe::V2")
raise NotImplementedError,

View File

@ -1,72 +0,0 @@
# frozen_string_literal: true
module Stripe
module V2
class EventReasonRequest
attr_reader :id, :idempotency_key
def initialize(event_reason_request_payload = {})
@id = event_reason_request_payload[:id]
@idempotency_key = event_reason_request_payload[:idempotency_key]
end
end
class EventReason
attr_reader :type, :request
def initialize(event_reason_payload = {})
@type = event_reason_payload[:type]
@request = EventReasonRequest.new(event_reason_payload[:request])
end
end
class RelatedObject
attr_reader :id, :type, :url
def initialize(related_object)
@id = related_object[:id]
@type = related_object[:type]
@url = related_object[:url]
end
end
class EventNotification
attr_reader :id, :type, :created, :context, :livemode, :reason
def initialize(event_payload, client)
@id = event_payload[:id]
@type = event_payload[:type]
@created = event_payload[:created]
@livemode = event_payload[:livemode]
@reason = EventReason.new(event_payload[:reason]) if event_payload[:reason]
if event_payload[:context] && !event_payload[:context].empty?
@context = StripeContext.parse(event_payload[:context])
end
# private unless a child declares an attr_reader
@related_object = RelatedObject.new(event_payload[:related_object]) if event_payload[:related_object]
# internal use
@client = client
end
# Retrieves the Event that generated this EventNotification.
def fetch_event
resp = @client.raw_request(:get, "/v2/core/events/#{id}", opts: { stripe_context: context },
usage: ["fetch_event"])
@client.deserialize(resp.http_body, api_mode: :v2)
end
end
class UnknownEventNotification < EventNotification
attr_reader :related_object
def fetch_related_object
return nil if @related_object.nil?
resp = @client.raw_request(:get, related_object.url, opts: { stripe_context: context },
usage: ["fetch_related_object"])
@client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url))
end
end
end
end

View File

@ -119,6 +119,8 @@ module Stripe
Events::V2PaymentsOffSessionPaymentCreatedEvent,
Events::V2PaymentsOffSessionPaymentFailedEvent.lookup_type =>
Events::V2PaymentsOffSessionPaymentFailedEvent,
Events::V2PaymentsOffSessionPaymentRequiresCaptureEvent.lookup_type =>
Events::V2PaymentsOffSessionPaymentRequiresCaptureEvent,
Events::V2PaymentsOffSessionPaymentSucceededEvent.lookup_type =>
Events::V2PaymentsOffSessionPaymentSucceededEvent,
# v2 event types: The end of the section generated from our OpenAPI spec
@ -252,6 +254,8 @@ module Stripe
Events::V2PaymentsOffSessionPaymentCreatedEventNotification,
Events::V2PaymentsOffSessionPaymentFailedEventNotification.lookup_type =>
Events::V2PaymentsOffSessionPaymentFailedEventNotification,
Events::V2PaymentsOffSessionPaymentRequiresCaptureEventNotification.lookup_type =>
Events::V2PaymentsOffSessionPaymentRequiresCaptureEventNotification,
Events::V2PaymentsOffSessionPaymentSucceededEventNotification.lookup_type =>
Events::V2PaymentsOffSessionPaymentSucceededEventNotification,
# event notification types: The end of the section generated from our OpenAPI spec

View File

@ -0,0 +1,19 @@
# frozen_string_literal: true
require "stripe/resources/v2/core/event_notification"
module Stripe
module Events
class UnknownEventNotification < Stripe::V2::Core::EventNotification
attr_reader :related_object
def fetch_related_object
return nil if @related_object.nil?
resp = @client.raw_request(:get, related_object.url, opts: { stripe_context: context },
usage: ["fetch_related_object"])
@client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url))
end
end
end
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when a Meter has invalid async usage events.
class V1BillingMeterErrorReportTriggeredEvent < Stripe::V2::Event
class V1BillingMeterErrorReportTriggeredEvent < Stripe::V2::Core::Event
def self.lookup_type
"v1.billing.meter.error_report_triggered"
end
@ -101,7 +101,7 @@ module Stripe
end
# Occurs when a Meter has invalid async usage events.
class V1BillingMeterErrorReportTriggeredEventNotification < Stripe::V2::EventNotification
class V1BillingMeterErrorReportTriggeredEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v1.billing.meter.error_report_triggered"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when a Meter's id is missing or invalid in async usage events.
class V1BillingMeterNoMeterFoundEvent < Stripe::V2::Event
class V1BillingMeterNoMeterFoundEvent < Stripe::V2::Core::Event
def self.lookup_type
"v1.billing.meter.no_meter_found"
end
@ -91,7 +91,7 @@ module Stripe
end
# Occurs when a Meter's id is missing or invalid in async usage events.
class V1BillingMeterNoMeterFoundEventNotification < Stripe::V2::EventNotification
class V1BillingMeterNoMeterFoundEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v1.billing.meter.no_meter_found"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# This event occurs when a bill setting is updated.
class V2BillingBillSettingUpdatedEvent < Stripe::V2::Event
class V2BillingBillSettingUpdatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.billing.bill_setting.updated"
end
@ -39,7 +39,7 @@ module Stripe
end
# This event occurs when a bill setting is updated.
class V2BillingBillSettingUpdatedEventNotification < Stripe::V2::EventNotification
class V2BillingBillSettingUpdatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.billing.bill_setting.updated"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# This event occurs when an account is closed.
class V2CoreAccountClosedEvent < Stripe::V2::Event
class V2CoreAccountClosedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.core.account.closed"
end
@ -22,7 +22,7 @@ module Stripe
end
# This event occurs when an account is closed.
class V2CoreAccountClosedEventNotification < Stripe::V2::EventNotification
class V2CoreAccountClosedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.core.account.closed"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when an Account is created.
class V2CoreAccountCreatedEvent < Stripe::V2::Event
class V2CoreAccountCreatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.core.account.created"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when an Account is created.
class V2CoreAccountCreatedEventNotification < Stripe::V2::EventNotification
class V2CoreAccountCreatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.core.account.created"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when the status of an Account's customer configuration capability is updated.
class V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent < Stripe::V2::Event
class V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.core.account[configuration.customer].capability_status_updated"
end
@ -41,7 +41,7 @@ module Stripe
end
# Occurs when the status of an Account's customer configuration capability is updated.
class V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventNotification < Stripe::V2::EventNotification
class V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.core.account[configuration.customer].capability_status_updated"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when an Account's customer configuration is updated.
class V2CoreAccountIncludingConfigurationCustomerUpdatedEvent < Stripe::V2::Event
class V2CoreAccountIncludingConfigurationCustomerUpdatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.core.account[configuration.customer].updated"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when an Account's customer configuration is updated.
class V2CoreAccountIncludingConfigurationCustomerUpdatedEventNotification < Stripe::V2::EventNotification
class V2CoreAccountIncludingConfigurationCustomerUpdatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.core.account[configuration.customer].updated"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when the status of an Account's merchant configuration capability is updated.
class V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent < Stripe::V2::Event
class V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.core.account[configuration.merchant].capability_status_updated"
end
@ -41,7 +41,7 @@ module Stripe
end
# Occurs when the status of an Account's merchant configuration capability is updated.
class V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventNotification < Stripe::V2::EventNotification
class V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.core.account[configuration.merchant].capability_status_updated"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when an Account's merchant configuration is updated.
class V2CoreAccountIncludingConfigurationMerchantUpdatedEvent < Stripe::V2::Event
class V2CoreAccountIncludingConfigurationMerchantUpdatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.core.account[configuration.merchant].updated"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when an Account's merchant configuration is updated.
class V2CoreAccountIncludingConfigurationMerchantUpdatedEventNotification < Stripe::V2::EventNotification
class V2CoreAccountIncludingConfigurationMerchantUpdatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.core.account[configuration.merchant].updated"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when the status of an Account's recipient configuration capability is updated.
class V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent < Stripe::V2::Event
class V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.core.account[configuration.recipient].capability_status_updated"
end
@ -41,7 +41,7 @@ module Stripe
end
# Occurs when the status of an Account's recipient configuration capability is updated.
class V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventNotification < Stripe::V2::EventNotification
class V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.core.account[configuration.recipient].capability_status_updated"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when a Recipient's configuration is updated.
class V2CoreAccountIncludingConfigurationRecipientUpdatedEvent < Stripe::V2::Event
class V2CoreAccountIncludingConfigurationRecipientUpdatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.core.account[configuration.recipient].updated"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when a Recipient's configuration is updated.
class V2CoreAccountIncludingConfigurationRecipientUpdatedEventNotification < Stripe::V2::EventNotification
class V2CoreAccountIncludingConfigurationRecipientUpdatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.core.account[configuration.recipient].updated"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when the status of an Account's storer configuration capability is updated.
class V2CoreAccountIncludingConfigurationStorerCapabilityStatusUpdatedEvent < Stripe::V2::Event
class V2CoreAccountIncludingConfigurationStorerCapabilityStatusUpdatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.core.account[configuration.storer].capability_status_updated"
end
@ -41,7 +41,7 @@ module Stripe
end
# Occurs when the status of an Account's storer configuration capability is updated.
class V2CoreAccountIncludingConfigurationStorerCapabilityStatusUpdatedEventNotification < Stripe::V2::EventNotification
class V2CoreAccountIncludingConfigurationStorerCapabilityStatusUpdatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.core.account[configuration.storer].capability_status_updated"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when a Storer's configuration is updated.
class V2CoreAccountIncludingConfigurationStorerUpdatedEvent < Stripe::V2::Event
class V2CoreAccountIncludingConfigurationStorerUpdatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.core.account[configuration.storer].updated"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when a Storer's configuration is updated.
class V2CoreAccountIncludingConfigurationStorerUpdatedEventNotification < Stripe::V2::EventNotification
class V2CoreAccountIncludingConfigurationStorerUpdatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.core.account[configuration.storer].updated"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# This event occurs when account defaults are created or updated.
class V2CoreAccountIncludingDefaultsUpdatedEvent < Stripe::V2::Event
class V2CoreAccountIncludingDefaultsUpdatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.core.account[defaults].updated"
end
@ -22,7 +22,7 @@ module Stripe
end
# This event occurs when account defaults are created or updated.
class V2CoreAccountIncludingDefaultsUpdatedEventNotification < Stripe::V2::EventNotification
class V2CoreAccountIncludingDefaultsUpdatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.core.account[defaults].updated"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when an Identity is updated.
class V2CoreAccountIncludingIdentityUpdatedEvent < Stripe::V2::Event
class V2CoreAccountIncludingIdentityUpdatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.core.account[identity].updated"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when an Identity is updated.
class V2CoreAccountIncludingIdentityUpdatedEventNotification < Stripe::V2::EventNotification
class V2CoreAccountIncludingIdentityUpdatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.core.account[identity].updated"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when an Account's requirements are updated.
class V2CoreAccountIncludingRequirementsUpdatedEvent < Stripe::V2::Event
class V2CoreAccountIncludingRequirementsUpdatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.core.account[requirements].updated"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when an Account's requirements are updated.
class V2CoreAccountIncludingRequirementsUpdatedEventNotification < Stripe::V2::EventNotification
class V2CoreAccountIncludingRequirementsUpdatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.core.account[requirements].updated"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when the generated AccountLink is completed.
class V2CoreAccountLinkReturnedEvent < Stripe::V2::Event
class V2CoreAccountLinkReturnedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.core.account_link.returned"
end
@ -33,7 +33,7 @@ module Stripe
end
# Occurs when the generated AccountLink is completed.
class V2CoreAccountLinkReturnedEventNotification < Stripe::V2::EventNotification
class V2CoreAccountLinkReturnedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.core.account_link.returned"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when a Person is created.
class V2CoreAccountPersonCreatedEvent < Stripe::V2::Event
class V2CoreAccountPersonCreatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.core.account_person.created"
end
@ -39,7 +39,7 @@ module Stripe
end
# Occurs when a Person is created.
class V2CoreAccountPersonCreatedEventNotification < Stripe::V2::EventNotification
class V2CoreAccountPersonCreatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.core.account_person.created"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when a Person is deleted.
class V2CoreAccountPersonDeletedEvent < Stripe::V2::Event
class V2CoreAccountPersonDeletedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.core.account_person.deleted"
end
@ -39,7 +39,7 @@ module Stripe
end
# Occurs when a Person is deleted.
class V2CoreAccountPersonDeletedEventNotification < Stripe::V2::EventNotification
class V2CoreAccountPersonDeletedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.core.account_person.deleted"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when a Person is updated.
class V2CoreAccountPersonUpdatedEvent < Stripe::V2::Event
class V2CoreAccountPersonUpdatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.core.account_person.updated"
end
@ -39,7 +39,7 @@ module Stripe
end
# Occurs when a Person is updated.
class V2CoreAccountPersonUpdatedEventNotification < Stripe::V2::EventNotification
class V2CoreAccountPersonUpdatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.core.account_person.updated"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when an Account is updated.
class V2CoreAccountUpdatedEvent < Stripe::V2::Event
class V2CoreAccountUpdatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.core.account.updated"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when an Account is updated.
class V2CoreAccountUpdatedEventNotification < Stripe::V2::EventNotification
class V2CoreAccountUpdatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.core.account.updated"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# A ping event used to test the connection to an EventDestination.
class V2CoreEventDestinationPingEvent < Stripe::V2::Event
class V2CoreEventDestinationPingEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.core.event_destination.ping"
end
@ -22,7 +22,7 @@ module Stripe
end
# A ping event used to test the connection to an EventDestination.
class V2CoreEventDestinationPingEventNotification < Stripe::V2::EventNotification
class V2CoreEventDestinationPingEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.core.event_destination.ping"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when an Adjustment is created.
class V2MoneyManagementAdjustmentCreatedEvent < Stripe::V2::Event
class V2MoneyManagementAdjustmentCreatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.adjustment.created"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when an Adjustment is created.
class V2MoneyManagementAdjustmentCreatedEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementAdjustmentCreatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.adjustment.created"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when a FinancialAccount is created.
class V2MoneyManagementFinancialAccountCreatedEvent < Stripe::V2::Event
class V2MoneyManagementFinancialAccountCreatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.financial_account.created"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when a FinancialAccount is created.
class V2MoneyManagementFinancialAccountCreatedEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementFinancialAccountCreatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.financial_account.created"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when a FinancialAccount is updated.
class V2MoneyManagementFinancialAccountUpdatedEvent < Stripe::V2::Event
class V2MoneyManagementFinancialAccountUpdatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.financial_account.updated"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when a FinancialAccount is updated.
class V2MoneyManagementFinancialAccountUpdatedEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementFinancialAccountUpdatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.financial_account.updated"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when a FinancialAddress is activated and is ready to receive funds.
class V2MoneyManagementFinancialAddressActivatedEvent < Stripe::V2::Event
class V2MoneyManagementFinancialAddressActivatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.financial_address.activated"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when a FinancialAddress is activated and is ready to receive funds.
class V2MoneyManagementFinancialAddressActivatedEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementFinancialAddressActivatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.financial_address.activated"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when a FinancialAddress fails to activate and can not receive funds.
class V2MoneyManagementFinancialAddressFailedEvent < Stripe::V2::Event
class V2MoneyManagementFinancialAddressFailedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.financial_address.failed"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when a FinancialAddress fails to activate and can not receive funds.
class V2MoneyManagementFinancialAddressFailedEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementFinancialAddressFailedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.financial_address.failed"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when an InboundTransfer's funds are made available.
class V2MoneyManagementInboundTransferAvailableEvent < Stripe::V2::Event
class V2MoneyManagementInboundTransferAvailableEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.inbound_transfer.available"
end
@ -39,7 +39,7 @@ module Stripe
end
# Occurs when an InboundTransfer's funds are made available.
class V2MoneyManagementInboundTransferAvailableEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementInboundTransferAvailableEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.inbound_transfer.available"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when an InboundTransfer fails.
class V2MoneyManagementInboundTransferBankDebitFailedEvent < Stripe::V2::Event
class V2MoneyManagementInboundTransferBankDebitFailedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.inbound_transfer.bank_debit_failed"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when an InboundTransfer fails.
class V2MoneyManagementInboundTransferBankDebitFailedEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementInboundTransferBankDebitFailedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.inbound_transfer.bank_debit_failed"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when an InboundTransfer starts processing.
class V2MoneyManagementInboundTransferBankDebitProcessingEvent < Stripe::V2::Event
class V2MoneyManagementInboundTransferBankDebitProcessingEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.inbound_transfer.bank_debit_processing"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when an InboundTransfer starts processing.
class V2MoneyManagementInboundTransferBankDebitProcessingEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementInboundTransferBankDebitProcessingEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.inbound_transfer.bank_debit_processing"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when an InboundTransfer is queued.
class V2MoneyManagementInboundTransferBankDebitQueuedEvent < Stripe::V2::Event
class V2MoneyManagementInboundTransferBankDebitQueuedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.inbound_transfer.bank_debit_queued"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when an InboundTransfer is queued.
class V2MoneyManagementInboundTransferBankDebitQueuedEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementInboundTransferBankDebitQueuedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.inbound_transfer.bank_debit_queued"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when an InboundTransfer is returned.
class V2MoneyManagementInboundTransferBankDebitReturnedEvent < Stripe::V2::Event
class V2MoneyManagementInboundTransferBankDebitReturnedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.inbound_transfer.bank_debit_returned"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when an InboundTransfer is returned.
class V2MoneyManagementInboundTransferBankDebitReturnedEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementInboundTransferBankDebitReturnedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.inbound_transfer.bank_debit_returned"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when an InboundTransfer succeeds.
class V2MoneyManagementInboundTransferBankDebitSucceededEvent < Stripe::V2::Event
class V2MoneyManagementInboundTransferBankDebitSucceededEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.inbound_transfer.bank_debit_succeeded"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when an InboundTransfer succeeds.
class V2MoneyManagementInboundTransferBankDebitSucceededEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementInboundTransferBankDebitSucceededEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.inbound_transfer.bank_debit_succeeded"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when an OutboundPayment transitions into the canceled state.
class V2MoneyManagementOutboundPaymentCanceledEvent < Stripe::V2::Event
class V2MoneyManagementOutboundPaymentCanceledEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.outbound_payment.canceled"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when an OutboundPayment transitions into the canceled state.
class V2MoneyManagementOutboundPaymentCanceledEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementOutboundPaymentCanceledEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.outbound_payment.canceled"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when an OutboundPayment is created.
class V2MoneyManagementOutboundPaymentCreatedEvent < Stripe::V2::Event
class V2MoneyManagementOutboundPaymentCreatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.outbound_payment.created"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when an OutboundPayment is created.
class V2MoneyManagementOutboundPaymentCreatedEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementOutboundPaymentCreatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.outbound_payment.created"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when an OutboundPayment transitions into the failed state.
class V2MoneyManagementOutboundPaymentFailedEvent < Stripe::V2::Event
class V2MoneyManagementOutboundPaymentFailedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.outbound_payment.failed"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when an OutboundPayment transitions into the failed state.
class V2MoneyManagementOutboundPaymentFailedEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementOutboundPaymentFailedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.outbound_payment.failed"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when an OutboundPayment transitions into the posted state.
class V2MoneyManagementOutboundPaymentPostedEvent < Stripe::V2::Event
class V2MoneyManagementOutboundPaymentPostedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.outbound_payment.posted"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when an OutboundPayment transitions into the posted state.
class V2MoneyManagementOutboundPaymentPostedEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementOutboundPaymentPostedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.outbound_payment.posted"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when an OutboundPayment transitions into the returned state.
class V2MoneyManagementOutboundPaymentReturnedEvent < Stripe::V2::Event
class V2MoneyManagementOutboundPaymentReturnedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.outbound_payment.returned"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when an OutboundPayment transitions into the returned state.
class V2MoneyManagementOutboundPaymentReturnedEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementOutboundPaymentReturnedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.outbound_payment.returned"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when an OutboundPayment is updated.
class V2MoneyManagementOutboundPaymentUpdatedEvent < Stripe::V2::Event
class V2MoneyManagementOutboundPaymentUpdatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.outbound_payment.updated"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when an OutboundPayment is updated.
class V2MoneyManagementOutboundPaymentUpdatedEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementOutboundPaymentUpdatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.outbound_payment.updated"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when an OutboundTransfer transitions into the canceled state.
class V2MoneyManagementOutboundTransferCanceledEvent < Stripe::V2::Event
class V2MoneyManagementOutboundTransferCanceledEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.outbound_transfer.canceled"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when an OutboundTransfer transitions into the canceled state.
class V2MoneyManagementOutboundTransferCanceledEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementOutboundTransferCanceledEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.outbound_transfer.canceled"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when an OutboundTransfer is created.
class V2MoneyManagementOutboundTransferCreatedEvent < Stripe::V2::Event
class V2MoneyManagementOutboundTransferCreatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.outbound_transfer.created"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when an OutboundTransfer is created.
class V2MoneyManagementOutboundTransferCreatedEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementOutboundTransferCreatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.outbound_transfer.created"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when an OutboundTransfer transitions into the failed state.
class V2MoneyManagementOutboundTransferFailedEvent < Stripe::V2::Event
class V2MoneyManagementOutboundTransferFailedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.outbound_transfer.failed"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when an OutboundTransfer transitions into the failed state.
class V2MoneyManagementOutboundTransferFailedEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementOutboundTransferFailedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.outbound_transfer.failed"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when an OutboundTransfer transitions into the posted state.
class V2MoneyManagementOutboundTransferPostedEvent < Stripe::V2::Event
class V2MoneyManagementOutboundTransferPostedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.outbound_transfer.posted"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when an OutboundTransfer transitions into the posted state.
class V2MoneyManagementOutboundTransferPostedEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementOutboundTransferPostedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.outbound_transfer.posted"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when an OutboundTransfer transitions into the returned state.
class V2MoneyManagementOutboundTransferReturnedEvent < Stripe::V2::Event
class V2MoneyManagementOutboundTransferReturnedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.outbound_transfer.returned"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when an OutboundTransfer transitions into the returned state.
class V2MoneyManagementOutboundTransferReturnedEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementOutboundTransferReturnedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.outbound_transfer.returned"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Event that is emitted every time an Outbound Transfer is updated.
class V2MoneyManagementOutboundTransferUpdatedEvent < Stripe::V2::Event
class V2MoneyManagementOutboundTransferUpdatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.outbound_transfer.updated"
end
@ -22,7 +22,7 @@ module Stripe
end
# Event that is emitted every time an Outbound Transfer is updated.
class V2MoneyManagementOutboundTransferUpdatedEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementOutboundTransferUpdatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.outbound_transfer.updated"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when a PayoutMethod is updated.
class V2MoneyManagementPayoutMethodUpdatedEvent < Stripe::V2::Event
class V2MoneyManagementPayoutMethodUpdatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.payout_method.updated"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when a PayoutMethod is updated.
class V2MoneyManagementPayoutMethodUpdatedEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementPayoutMethodUpdatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.payout_method.updated"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when a ReceivedCredit's funds are received and are available in your balance.
class V2MoneyManagementReceivedCreditAvailableEvent < Stripe::V2::Event
class V2MoneyManagementReceivedCreditAvailableEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.received_credit.available"
end
@ -39,7 +39,7 @@ module Stripe
end
# Occurs when a ReceivedCredit's funds are received and are available in your balance.
class V2MoneyManagementReceivedCreditAvailableEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementReceivedCreditAvailableEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.received_credit.available"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when a ReceivedCredit is attempted to your balance and fails. See the status_details for more information.
class V2MoneyManagementReceivedCreditFailedEvent < Stripe::V2::Event
class V2MoneyManagementReceivedCreditFailedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.received_credit.failed"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when a ReceivedCredit is attempted to your balance and fails. See the status_details for more information.
class V2MoneyManagementReceivedCreditFailedEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementReceivedCreditFailedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.received_credit.failed"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when a ReceivedCredit is reversed, returned to the originator, and deducted from your balance.
class V2MoneyManagementReceivedCreditReturnedEvent < Stripe::V2::Event
class V2MoneyManagementReceivedCreditReturnedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.received_credit.returned"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when a ReceivedCredit is reversed, returned to the originator, and deducted from your balance.
class V2MoneyManagementReceivedCreditReturnedEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementReceivedCreditReturnedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.received_credit.returned"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when a ReceivedCredit succeeds.
class V2MoneyManagementReceivedCreditSucceededEvent < Stripe::V2::Event
class V2MoneyManagementReceivedCreditSucceededEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.received_credit.succeeded"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when a ReceivedCredit succeeds.
class V2MoneyManagementReceivedCreditSucceededEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementReceivedCreditSucceededEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.received_credit.succeeded"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when a ReceivedDebit is canceled.
class V2MoneyManagementReceivedDebitCanceledEvent < Stripe::V2::Event
class V2MoneyManagementReceivedDebitCanceledEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.received_debit.canceled"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when a ReceivedDebit is canceled.
class V2MoneyManagementReceivedDebitCanceledEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementReceivedDebitCanceledEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.received_debit.canceled"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when a ReceivedDebit fails.
class V2MoneyManagementReceivedDebitFailedEvent < Stripe::V2::Event
class V2MoneyManagementReceivedDebitFailedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.received_debit.failed"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when a ReceivedDebit fails.
class V2MoneyManagementReceivedDebitFailedEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementReceivedDebitFailedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.received_debit.failed"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when a ReceivedDebit is set to pending.
class V2MoneyManagementReceivedDebitPendingEvent < Stripe::V2::Event
class V2MoneyManagementReceivedDebitPendingEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.received_debit.pending"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when a ReceivedDebit is set to pending.
class V2MoneyManagementReceivedDebitPendingEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementReceivedDebitPendingEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.received_debit.pending"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when a ReceivedDebit succeeds.
class V2MoneyManagementReceivedDebitSucceededEvent < Stripe::V2::Event
class V2MoneyManagementReceivedDebitSucceededEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.received_debit.succeeded"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when a ReceivedDebit succeeds.
class V2MoneyManagementReceivedDebitSucceededEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementReceivedDebitSucceededEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.received_debit.succeeded"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when a ReceivedDebit is updated.
class V2MoneyManagementReceivedDebitUpdatedEvent < Stripe::V2::Event
class V2MoneyManagementReceivedDebitUpdatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.received_debit.updated"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when a ReceivedDebit is updated.
class V2MoneyManagementReceivedDebitUpdatedEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementReceivedDebitUpdatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.received_debit.updated"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when a Transaction is created.
class V2MoneyManagementTransactionCreatedEvent < Stripe::V2::Event
class V2MoneyManagementTransactionCreatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.transaction.created"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when a Transaction is created.
class V2MoneyManagementTransactionCreatedEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementTransactionCreatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.transaction.created"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Occurs when a Transaction is updated.
class V2MoneyManagementTransactionUpdatedEvent < Stripe::V2::Event
class V2MoneyManagementTransactionUpdatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.money_management.transaction.updated"
end
@ -22,7 +22,7 @@ module Stripe
end
# Occurs when a Transaction is updated.
class V2MoneyManagementTransactionUpdatedEventNotification < Stripe::V2::EventNotification
class V2MoneyManagementTransactionUpdatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.money_management.transaction.updated"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Sent after a failed authorization if there are still retries available on the OffSessionPayment.
class V2PaymentsOffSessionPaymentAuthorizationAttemptFailedEvent < Stripe::V2::Event
class V2PaymentsOffSessionPaymentAuthorizationAttemptFailedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.payments.off_session_payment.authorization_attempt_failed"
end
@ -22,7 +22,7 @@ module Stripe
end
# Sent after a failed authorization if there are still retries available on the OffSessionPayment.
class V2PaymentsOffSessionPaymentAuthorizationAttemptFailedEventNotification < Stripe::V2::EventNotification
class V2PaymentsOffSessionPaymentAuthorizationAttemptFailedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.payments.off_session_payment.authorization_attempt_failed"
end

View File

@ -5,7 +5,7 @@ module Stripe
module Events
# Sent when our internal scheduling system kicks off an attempt at authorization, whether it's a
# retry or an initial authorization.
class V2PaymentsOffSessionPaymentAuthorizationAttemptStartedEvent < Stripe::V2::Event
class V2PaymentsOffSessionPaymentAuthorizationAttemptStartedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.payments.off_session_payment.authorization_attempt_started"
end
@ -24,7 +24,7 @@ module Stripe
# Sent when our internal scheduling system kicks off an attempt at authorization, whether it's a
# retry or an initial authorization.
class V2PaymentsOffSessionPaymentAuthorizationAttemptStartedEventNotification < Stripe::V2::EventNotification
class V2PaymentsOffSessionPaymentAuthorizationAttemptStartedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.payments.off_session_payment.authorization_attempt_started"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Sent immediately following a user's call to the Off-Session Payments cancel endpoint.
class V2PaymentsOffSessionPaymentCanceledEvent < Stripe::V2::Event
class V2PaymentsOffSessionPaymentCanceledEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.payments.off_session_payment.canceled"
end
@ -22,7 +22,7 @@ module Stripe
end
# Sent immediately following a user's call to the Off-Session Payments cancel endpoint.
class V2PaymentsOffSessionPaymentCanceledEventNotification < Stripe::V2::EventNotification
class V2PaymentsOffSessionPaymentCanceledEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.payments.off_session_payment.canceled"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Sent immediately following a user's call to the Off-Session Payments create endpoint.
class V2PaymentsOffSessionPaymentCreatedEvent < Stripe::V2::Event
class V2PaymentsOffSessionPaymentCreatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.payments.off_session_payment.created"
end
@ -22,7 +22,7 @@ module Stripe
end
# Sent immediately following a user's call to the Off-Session Payments create endpoint.
class V2PaymentsOffSessionPaymentCreatedEventNotification < Stripe::V2::EventNotification
class V2PaymentsOffSessionPaymentCreatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.payments.off_session_payment.created"
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Sent after a failed authorization if there are no retries remaining, or if the failure is unretryable.
class V2PaymentsOffSessionPaymentFailedEvent < Stripe::V2::Event
class V2PaymentsOffSessionPaymentFailedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.payments.off_session_payment.failed"
end
@ -22,7 +22,7 @@ module Stripe
end
# Sent after a failed authorization if there are no retries remaining, or if the failure is unretryable.
class V2PaymentsOffSessionPaymentFailedEventNotification < Stripe::V2::EventNotification
class V2PaymentsOffSessionPaymentFailedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.payments.off_session_payment.failed"
end

View File

@ -0,0 +1,44 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module Events
# Off-Session payment requires capture event definition.
class V2PaymentsOffSessionPaymentRequiresCaptureEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.payments.off_session_payment.requires_capture"
end
# Retrieves the related object from the API. Makes an API request on every call.
def fetch_related_object
_request(
method: :get,
path: related_object.url,
base_address: :api,
opts: { stripe_context: context }
)
end
attr_reader :related_object
end
# Off-Session payment requires capture event definition.
class V2PaymentsOffSessionPaymentRequiresCaptureEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.payments.off_session_payment.requires_capture"
end
attr_reader :related_object
# Retrieves the OffSessionPayment related to this EventNotification from the Stripe API. Makes an API request on every call.
def fetch_related_object
resp = @client.raw_request(
:get,
related_object.url,
opts: { stripe_context: context },
usage: ["fetch_related_object"]
)
@client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url))
end
end
end
end

View File

@ -4,7 +4,7 @@
module Stripe
module Events
# Sent immediately after a successful authorization.
class V2PaymentsOffSessionPaymentSucceededEvent < Stripe::V2::Event
class V2PaymentsOffSessionPaymentSucceededEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.payments.off_session_payment.succeeded"
end
@ -22,7 +22,7 @@ module Stripe
end
# Sent immediately after a successful authorization.
class V2PaymentsOffSessionPaymentSucceededEventNotification < Stripe::V2::EventNotification
class V2PaymentsOffSessionPaymentSucceededEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.payments.off_session_payment.succeeded"
end

View File

@ -199,10 +199,10 @@ module Stripe
V2::Core::Account.object_name => V2::Core::Account,
V2::Core::AccountLink.object_name => V2::Core::AccountLink,
V2::Core::AccountPerson.object_name => V2::Core::AccountPerson,
V2::Core::Event.object_name => V2::Core::Event,
V2::Core::EventDestination.object_name => V2::Core::EventDestination,
V2::Core::Vault::GbBankAccount.object_name => V2::Core::Vault::GbBankAccount,
V2::Core::Vault::UsBankAccount.object_name => V2::Core::Vault::UsBankAccount,
V2::Event.object_name => V2::Event,
V2::EventDestination.object_name => V2::EventDestination,
V2::FinancialAddressCreditSimulation.object_name => V2::FinancialAddressCreditSimulation,
V2::FinancialAddressGeneratedMicrodeposits.object_name =>
V2::FinancialAddressGeneratedMicrodeposits,

View File

@ -177,11 +177,11 @@ require "stripe/resources/v2/billing/profile"
require "stripe/resources/v2/core/account"
require "stripe/resources/v2/core/account_link"
require "stripe/resources/v2/core/account_person"
require "stripe/resources/v2/core/event"
require "stripe/resources/v2/core/event_destination"
require "stripe/resources/v2/core/vault/gb_bank_account"
require "stripe/resources/v2/core/vault/us_bank_account"
require "stripe/resources/v2/deleted_object"
require "stripe/resources/v2/event"
require "stripe/resources/v2/event_destination"
require "stripe/resources/v2/financial_address_credit_simulation"
require "stripe/resources/v2/financial_address_generated_microdeposits"
require "stripe/resources/v2/money_management/adjustment"
@ -262,4 +262,5 @@ require "stripe/events/v2_payments_off_session_payment_authorization_attempt_sta
require "stripe/events/v2_payments_off_session_payment_canceled_event"
require "stripe/events/v2_payments_off_session_payment_created_event"
require "stripe/events/v2_payments_off_session_payment_failed_event"
require "stripe/events/v2_payments_off_session_payment_requires_capture_event"
require "stripe/events/v2_payments_off_session_payment_succeeded_event"

View File

@ -0,0 +1,67 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module V2
module Core
# Events are generated to keep you informed of activity in your business account. APIs in the /v2 namespace generate [thin events](https://docs.stripe.com/event-destinations#benefits-of-thin-events) which have small, unversioned payloads that include a reference to the ID of the object that has changed. The Events v2 API returns these new thin events. [Retrieve the event object](https://docs.stripe.com/event-destinations#fetch-data) for additional data about the event. Use the related object ID in the event payload to [fetch the API resource](https://docs.stripe.com/event-destinations#retrieve-the-object-associated-with-thin-events) of the object associated with the event. Comparatively, events generated by most API v1 include a versioned snapshot of an API object in their payload.
class Event < APIResource
OBJECT_NAME = "v2.core.event"
def self.object_name
"v2.core.event"
end
class Reason < Stripe::StripeObject
class Request < Stripe::StripeObject
# ID of the API request that caused the event.
attr_reader :id
# The idempotency key transmitted during the request.
attr_reader :idempotency_key
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# Event reason type.
attr_reader :type
# Information on the API request that instigated the event.
attr_reader :request
def self.inner_class_types
@inner_class_types = { request: Request }
end
def self.field_remappings
@field_remappings = {}
end
end
# Authentication context needed to fetch the event or related object.
attr_reader :context
# Time at which the object was created.
attr_reader :created
# Unique identifier for the event.
attr_reader :id
# String representing the object's type. Objects of the same type share the same value of the object field.
attr_reader :object
# Reason for the event.
attr_reader :reason
# The type of the event.
attr_reader :type
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
attr_reader :livemode
def self.inner_class_types
@inner_class_types = { reason: Reason }
end
def self.field_remappings
@field_remappings = {}
end
end
end
end
end

View File

@ -0,0 +1,119 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module V2
module Core
# Set up an event destination to receive events from Stripe across multiple destination types, including [webhook endpoints](https://docs.stripe.com/webhooks) and [Amazon EventBridge](https://docs.stripe.com/event-destinations/eventbridge). Event destinations support receiving [thin events](https://docs.stripe.com/api/v2/events) and [snapshot events](https://docs.stripe.com/api/events).
class EventDestination < APIResource
OBJECT_NAME = "v2.core.event_destination"
def self.object_name
"v2.core.event_destination"
end
class StatusDetails < Stripe::StripeObject
class Disabled < Stripe::StripeObject
# Reason event destination has been disabled.
attr_reader :reason
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# Details about why the event destination has been disabled.
attr_reader :disabled
def self.inner_class_types
@inner_class_types = { disabled: Disabled }
end
def self.field_remappings
@field_remappings = {}
end
end
class AmazonEventbridge < Stripe::StripeObject
# The AWS account ID.
attr_reader :aws_account_id
# The ARN of the AWS event source.
attr_reader :aws_event_source_arn
# The state of the AWS event source.
attr_reader :aws_event_source_status
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
class WebhookEndpoint < Stripe::StripeObject
# The signing secret of the webhook endpoint, only includable on creation.
attr_reader :signing_secret
# The URL of the webhook endpoint, includable.
attr_reader :url
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# Time at which the object was created.
attr_reader :created
# An optional description of what the event destination is used for.
attr_reader :description
# The list of events to enable for this endpoint.
attr_reader :enabled_events
# Payload type of events being subscribed to.
attr_reader :event_payload
# Where events should be routed from.
attr_reader :events_from
# Unique identifier for the object.
attr_reader :id
# Metadata.
attr_reader :metadata
# Event destination name.
attr_reader :name
# String representing the object's type. Objects of the same type share the same value of the object field.
attr_reader :object
# If using the snapshot event payload, the API version events are rendered as.
attr_reader :snapshot_api_version
# Status. It can be set to either enabled or disabled.
attr_reader :status
# Additional information about event destination status.
attr_reader :status_details
# Event destination type.
attr_reader :type
# Time at which the object was last updated.
attr_reader :updated
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
attr_reader :livemode
# Amazon EventBridge configuration.
attr_reader :amazon_eventbridge
# Webhook endpoint configuration.
attr_reader :webhook_endpoint
def self.inner_class_types
@inner_class_types = {
status_details: StatusDetails,
amazon_eventbridge: AmazonEventbridge,
webhook_endpoint: WebhookEndpoint,
}
end
def self.field_remappings
@field_remappings = {}
end
end
end
end
end

View File

@ -0,0 +1,62 @@
# frozen_string_literal: true
module Stripe
module V2
module Core
class EventReasonRequest
attr_reader :id, :idempotency_key
def initialize(event_reason_request_payload = {})
@id = event_reason_request_payload[:id]
@idempotency_key = event_reason_request_payload[:idempotency_key]
end
end
class EventReason
attr_reader :type, :request
def initialize(event_reason_payload = {})
@type = event_reason_payload[:type]
@request = EventReasonRequest.new(event_reason_payload[:request])
end
end
class RelatedObject
attr_reader :id, :type, :url
def initialize(related_object)
@id = related_object[:id]
@type = related_object[:type]
@url = related_object[:url]
end
end
class EventNotification
attr_reader :id, :type, :created, :context, :livemode, :reason
def initialize(event_payload, client)
@id = event_payload[:id]
@type = event_payload[:type]
@created = event_payload[:created]
@livemode = event_payload[:livemode]
@reason = EventReason.new(event_payload[:reason]) if event_payload[:reason]
if event_payload[:context] && !event_payload[:context].empty?
@context = StripeContext.parse(event_payload[:context])
end
# private unless a child declares an attr_reader
@related_object = RelatedObject.new(event_payload[:related_object]) if event_payload[:related_object]
# internal use
@client = client
end
# Retrieves the Event that generated this EventNotification.
def fetch_event
resp = @client.raw_request(:get, "/v2/core/events/#{id}", opts: { stripe_context: context },
usage: ["fetch_event"])
@client.deserialize(resp.http_body, api_mode: :v2)
end
end
end
end
end

View File

@ -1,65 +0,0 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module V2
# Events are generated to keep you informed of activity in your business account. APIs in the /v2 namespace generate [thin events](https://docs.stripe.com/event-destinations#benefits-of-thin-events) which have small, unversioned payloads that include a reference to the ID of the object that has changed. The Events v2 API returns these new thin events. [Retrieve the event object](https://docs.stripe.com/event-destinations#fetch-data) for additional data about the event. Use the related object ID in the event payload to [fetch the API resource](https://docs.stripe.com/event-destinations#retrieve-the-object-associated-with-thin-events) of the object associated with the event. Comparatively, events generated by most API v1 include a versioned snapshot of an API object in their payload.
class Event < APIResource
OBJECT_NAME = "v2.core.event"
def self.object_name
"v2.core.event"
end
class Reason < Stripe::StripeObject
class Request < Stripe::StripeObject
# ID of the API request that caused the event.
attr_reader :id
# The idempotency key transmitted during the request.
attr_reader :idempotency_key
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# Event reason type.
attr_reader :type
# Information on the API request that instigated the event.
attr_reader :request
def self.inner_class_types
@inner_class_types = { request: Request }
end
def self.field_remappings
@field_remappings = {}
end
end
# Authentication context needed to fetch the event or related object.
attr_reader :context
# Time at which the object was created.
attr_reader :created
# Unique identifier for the event.
attr_reader :id
# String representing the object's type. Objects of the same type share the same value of the object field.
attr_reader :object
# Reason for the event.
attr_reader :reason
# The type of the event.
attr_reader :type
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
attr_reader :livemode
def self.inner_class_types
@inner_class_types = { reason: Reason }
end
def self.field_remappings
@field_remappings = {}
end
end
end
end

View File

@ -1,117 +0,0 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module V2
# Set up an event destination to receive events from Stripe across multiple destination types, including [webhook endpoints](https://docs.stripe.com/webhooks) and [Amazon EventBridge](https://docs.stripe.com/event-destinations/eventbridge). Event destinations support receiving [thin events](https://docs.stripe.com/api/v2/events) and [snapshot events](https://docs.stripe.com/api/events).
class EventDestination < APIResource
OBJECT_NAME = "v2.core.event_destination"
def self.object_name
"v2.core.event_destination"
end
class StatusDetails < Stripe::StripeObject
class Disabled < Stripe::StripeObject
# Reason event destination has been disabled.
attr_reader :reason
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# Details about why the event destination has been disabled.
attr_reader :disabled
def self.inner_class_types
@inner_class_types = { disabled: Disabled }
end
def self.field_remappings
@field_remappings = {}
end
end
class AmazonEventbridge < Stripe::StripeObject
# The AWS account ID.
attr_reader :aws_account_id
# The ARN of the AWS event source.
attr_reader :aws_event_source_arn
# The state of the AWS event source.
attr_reader :aws_event_source_status
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
class WebhookEndpoint < Stripe::StripeObject
# The signing secret of the webhook endpoint, only includable on creation.
attr_reader :signing_secret
# The URL of the webhook endpoint, includable.
attr_reader :url
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# Time at which the object was created.
attr_reader :created
# An optional description of what the event destination is used for.
attr_reader :description
# The list of events to enable for this endpoint.
attr_reader :enabled_events
# Payload type of events being subscribed to.
attr_reader :event_payload
# Where events should be routed from.
attr_reader :events_from
# Unique identifier for the object.
attr_reader :id
# Metadata.
attr_reader :metadata
# Event destination name.
attr_reader :name
# String representing the object's type. Objects of the same type share the same value of the object field.
attr_reader :object
# If using the snapshot event payload, the API version events are rendered as.
attr_reader :snapshot_api_version
# Status. It can be set to either enabled or disabled.
attr_reader :status
# Additional information about event destination status.
attr_reader :status_details
# Event destination type.
attr_reader :type
# Time at which the object was last updated.
attr_reader :updated
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
attr_reader :livemode
# Amazon EventBridge configuration.
attr_reader :amazon_eventbridge
# Webhook endpoint configuration.
attr_reader :webhook_endpoint
def self.inner_class_types
@inner_class_types = {
status_details: StatusDetails,
amazon_eventbridge: AmazonEventbridge,
webhook_endpoint: WebhookEndpoint,
}
end
def self.field_remappings
@field_remappings = {}
end
end
end
end

View File

@ -94,6 +94,21 @@ module Stripe
end
end
class Capture < Stripe::StripeObject
# The timestamp when this payment is no longer eligible to be captured.
attr_reader :capture_before
# The method to use to capture the payment.
attr_reader :capture_method
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
class PaymentsOrchestration < Stripe::StripeObject
# True when you want to enable payments orchestration for this off-session payment. False otherwise.
attr_reader :enabled
@ -145,12 +160,18 @@ module Stripe
@field_remappings = {}
end
end
# The amount available to be captured.
attr_reader :amount_capturable
# Provides industry-specific information about the amount.
attr_reader :amount_details
# The “presentment amount” to be collected from the customer.
attr_reader :amount_requested
# The frequency of the underlying payment.
attr_reader :cadence
# Details about the capture configuration for the OffSessionPayment.
attr_reader :capture
# Whether the OffSessionPayment should be captured automatically or manually.
attr_reader :capture_method
# ID of the owning compartment.
attr_reader :compartment_id
# Creation time of the OffSessionPayment. Represented as a RFC 3339 date & time UTC
@ -205,6 +226,7 @@ module Stripe
def self.inner_class_types
@inner_class_types = {
amount_details: AmountDetails,
capture: Capture,
payments_orchestration: PaymentsOrchestration,
retry_details: RetryDetails,
transfer_data: TransferData,

View File

@ -95,23 +95,12 @@ module Stripe
end
end
class MandateData < Stripe::RequestParams
class CustomerAcceptance < Stripe::RequestParams
# The time at which the customer accepted the Mandate.
attr_accessor :accepted_at
# The type of customer acceptance information included with the Mandate.
attr_accessor :type
class Capture < Stripe::RequestParams
# The method to use to capture the payment.
attr_accessor :capture_method
def initialize(accepted_at: nil, type: nil)
@accepted_at = accepted_at
@type = type
end
end
# This hash contains details about the customer acceptance of the Mandate.
attr_accessor :customer_acceptance
def initialize(customer_acceptance: nil)
@customer_acceptance = customer_acceptance
def initialize(capture_method: nil)
@capture_method = capture_method
end
end
@ -182,10 +171,12 @@ module Stripe
attr_accessor :amount_details
# The frequency of the underlying payment.
attr_accessor :cadence
# Details about the capture configuration for the OffSessionPayment.
attr_accessor :capture
# Whether the OffSessionPayment should be captured automatically or manually.
attr_accessor :capture_method
# ID of the Customer to which this OffSessionPayment belongs.
attr_accessor :customer
# This hash contains details about the Mandate to create.
attr_accessor :mandate_data
# Set of [key-value pairs](https://docs.corp.stripe.com/api/metadata) that you can
# attach to an object. This can be useful for storing additional information about
# the object in a structured format. Learn more about
@ -219,8 +210,9 @@ module Stripe
amount: nil,
amount_details: nil,
cadence: nil,
capture: nil,
capture_method: nil,
customer: nil,
mandate_data: nil,
metadata: nil,
on_behalf_of: nil,
payment_method: nil,
@ -235,8 +227,9 @@ module Stripe
@amount = amount
@amount_details = amount_details
@cadence = cadence
@capture = capture
@capture_method = capture_method
@customer = customer
@mandate_data = mandate_data
@metadata = metadata
@on_behalf_of = on_behalf_of
@payment_method = payment_method
@ -253,6 +246,59 @@ module Stripe
class RetrieveParams < Stripe::RequestParams; end
class CancelParams < Stripe::RequestParams; end
class CaptureParams < Stripe::RequestParams
class TransferData < Stripe::RequestParams
# The amount transferred to the destination account. This transfer will occur
# automatically after the payment succeeds. If no amount is specified, by default
# the entire payment amount is transferred to the destination account. The amount
# must be less than or equal to the
# [amount_requested](https://docs.corp.stripe.com/api/v2/off-session-payments/object?api-version=2025-05-28.preview#v2_off_session_payment_object-amount_requested),
# and must be a positive integer representing how much to transfer in the smallest
# currency unit (e.g., 100 cents to charge $1.00).
attr_accessor :amount
# The account (if any) that the payment is attributed to for tax reporting, and
# where funds from the payment are transferred to after payment success.
attr_accessor :destination
def initialize(amount: nil, destination: nil)
@amount = amount
@destination = destination
end
end
# The amount to capture.
attr_accessor :amount_to_capture
# Set of [key-value pairs](https://docs.corp.stripe.com/api/metadata) that you can
# attach to an object. This can be useful for storing additional information about
# the object in a structured format. Learn more about
# [storing information in metadata](https://docs.corp.stripe.com/payments/payment-intents#storing-information-in-metadata).
attr_accessor :metadata
# Text that appears on the customers statement as the statement descriptor for a
# non-card charge. This value overrides the accounts default statement descriptor.
# For information about requirements, including the 22-character limit, see the
# [Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).
attr_accessor :statement_descriptor
# Provides information about a card charge. Concatenated to the accounts
# [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static)
# to form the complete statement descriptor that appears on the customers statement.
attr_accessor :statement_descriptor_suffix
# The data that automatically creates a Transfer after the payment finalizes. Learn more about the use case for [connected accounts](https://docs.corp.stripe.com/payments/connected-accounts).
attr_accessor :transfer_data
def initialize(
amount_to_capture: nil,
metadata: nil,
statement_descriptor: nil,
statement_descriptor_suffix: nil,
transfer_data: nil
)
@amount_to_capture = amount_to_capture
@metadata = metadata
@statement_descriptor = statement_descriptor
@statement_descriptor_suffix = statement_descriptor_suffix
@transfer_data = transfer_data
end
end
# Cancel an OffSessionPayment that has previously been created.
def cancel(id, params = {}, opts = {})
request(
@ -264,6 +310,17 @@ module Stripe
)
end
# Captures an OffSessionPayment that has previously been created.
def capture(id, params = {}, opts = {})
request(
method: :post,
path: format("/v2/payments/off_session_payments/%<id>s/capture", { id: CGI.escape(id) }),
params: params,
opts: opts,
base_address: :api
)
end
# Creates an OffSessionPayment object.
def create(params = {}, opts = {})
request(

View File

@ -1,6 +1,7 @@
# frozen_string_literal: true
require "json"
require "stripe/events/unknown_event_notification"
module Stripe
class StripeClient
@ -67,7 +68,7 @@ module Stripe
parsed = JSON.parse(payload, symbolize_names: true)
cls = Util.event_notification_classes.fetch(parsed[:type], Stripe::V2::UnknownEventNotification)
cls = Util.event_notification_classes.fetch(parsed[:type], Stripe::Events::UnknownEventNotification)
cls.new(parsed, self)
end

View File

@ -46204,7 +46204,7 @@ module Stripe
sig { returns(T.nilable(String)) }
def hosted_invoice_url; end
# Unique identifier for the object. For preview invoices created using the [create preview](https://stripe.com/docs/api/invoices/create_preview) endpoint, this id will be prefixed with `upcoming_in`.
sig { returns(T.nilable(String)) }
sig { returns(String) }
def id; end
# The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null.
sig { returns(T.nilable(String)) }
@ -166294,13 +166294,41 @@ end
# typed: true
module Stripe
module V2
# Set up an event destination to receive events from Stripe across multiple destination types, including [webhook endpoints](https://docs.stripe.com/webhooks) and [Amazon EventBridge](https://docs.stripe.com/event-destinations/eventbridge). Event destinations support receiving [thin events](https://docs.stripe.com/api/v2/events) and [snapshot events](https://docs.stripe.com/api/events).
class EventDestination < APIResource
class StatusDetails < Stripe::StripeObject
class Disabled < Stripe::StripeObject
# Reason event destination has been disabled.
module Core
# Set up an event destination to receive events from Stripe across multiple destination types, including [webhook endpoints](https://docs.stripe.com/webhooks) and [Amazon EventBridge](https://docs.stripe.com/event-destinations/eventbridge). Event destinations support receiving [thin events](https://docs.stripe.com/api/v2/events) and [snapshot events](https://docs.stripe.com/api/events).
class EventDestination < APIResource
class StatusDetails < Stripe::StripeObject
class Disabled < Stripe::StripeObject
# Reason event destination has been disabled.
sig { returns(String) }
def reason; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# Details about why the event destination has been disabled.
sig { returns(T.nilable(Disabled)) }
def disabled; end
def self.inner_class_types
@inner_class_types = {disabled: Disabled}
end
def self.field_remappings
@field_remappings = {}
end
end
class AmazonEventbridge < Stripe::StripeObject
# The AWS account ID.
sig { returns(String) }
def reason; end
def aws_account_id; end
# The ARN of the AWS event source.
sig { returns(String) }
def aws_event_source_arn; end
# The state of the AWS event source.
sig { returns(String) }
def aws_event_source_status; end
def self.inner_class_types
@inner_class_types = {}
end
@ -166308,155 +166336,131 @@ module Stripe
@field_remappings = {}
end
end
# Details about why the event destination has been disabled.
sig { returns(T.nilable(Disabled)) }
def disabled; end
def self.inner_class_types
@inner_class_types = {disabled: Disabled}
class WebhookEndpoint < Stripe::StripeObject
# The signing secret of the webhook endpoint, only includable on creation.
sig { returns(T.nilable(String)) }
def signing_secret; end
# The URL of the webhook endpoint, includable.
sig { returns(T.nilable(String)) }
def url; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
def self.field_remappings
@field_remappings = {}
end
end
class AmazonEventbridge < Stripe::StripeObject
# The AWS account ID.
# Time at which the object was created.
sig { returns(String) }
def aws_account_id; end
# The ARN of the AWS event source.
def created; end
# An optional description of what the event destination is used for.
sig { returns(String) }
def aws_event_source_arn; end
# The state of the AWS event source.
def description; end
# The list of events to enable for this endpoint.
sig { returns(T::Array[String]) }
def enabled_events; end
# Payload type of events being subscribed to.
sig { returns(String) }
def aws_event_source_status; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
class WebhookEndpoint < Stripe::StripeObject
# The signing secret of the webhook endpoint, only includable on creation.
def event_payload; end
# Where events should be routed from.
sig { returns(T.nilable(T::Array[String])) }
def events_from; end
# Unique identifier for the object.
sig { returns(String) }
def id; end
# Metadata.
sig { returns(T.nilable(T::Hash[String, String])) }
def metadata; end
# Event destination name.
sig { returns(String) }
def name; end
# String representing the object's type. Objects of the same type share the same value of the object field.
sig { returns(String) }
def object; end
# If using the snapshot event payload, the API version events are rendered as.
sig { returns(T.nilable(String)) }
def signing_secret; end
# The URL of the webhook endpoint, includable.
sig { returns(T.nilable(String)) }
def url; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
def snapshot_api_version; end
# Status. It can be set to either enabled or disabled.
sig { returns(String) }
def status; end
# Additional information about event destination status.
sig { returns(T.nilable(StatusDetails)) }
def status_details; end
# Event destination type.
sig { returns(String) }
def type; end
# Time at which the object was last updated.
sig { returns(String) }
def updated; end
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
sig { returns(T::Boolean) }
def livemode; end
# Amazon EventBridge configuration.
sig { returns(T.nilable(AmazonEventbridge)) }
def amazon_eventbridge; end
# Webhook endpoint configuration.
sig { returns(T.nilable(WebhookEndpoint)) }
def webhook_endpoint; end
end
# Time at which the object was created.
sig { returns(String) }
def created; end
# An optional description of what the event destination is used for.
sig { returns(String) }
def description; end
# The list of events to enable for this endpoint.
sig { returns(T::Array[String]) }
def enabled_events; end
# Payload type of events being subscribed to.
sig { returns(String) }
def event_payload; end
# Where events should be routed from.
sig { returns(T.nilable(T::Array[String])) }
def events_from; end
# Unique identifier for the object.
sig { returns(String) }
def id; end
# Metadata.
sig { returns(T.nilable(T::Hash[String, String])) }
def metadata; end
# Event destination name.
sig { returns(String) }
def name; end
# String representing the object's type. Objects of the same type share the same value of the object field.
sig { returns(String) }
def object; end
# If using the snapshot event payload, the API version events are rendered as.
sig { returns(T.nilable(String)) }
def snapshot_api_version; end
# Status. It can be set to either enabled or disabled.
sig { returns(String) }
def status; end
# Additional information about event destination status.
sig { returns(T.nilable(StatusDetails)) }
def status_details; end
# Event destination type.
sig { returns(String) }
def type; end
# Time at which the object was last updated.
sig { returns(String) }
def updated; end
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
sig { returns(T::Boolean) }
def livemode; end
# Amazon EventBridge configuration.
sig { returns(T.nilable(AmazonEventbridge)) }
def amazon_eventbridge; end
# Webhook endpoint configuration.
sig { returns(T.nilable(WebhookEndpoint)) }
def webhook_endpoint; end
end
end
end
# typed: true
module Stripe
module V2
# Events are generated to keep you informed of activity in your business account. APIs in the /v2 namespace generate [thin events](https://docs.stripe.com/event-destinations#benefits-of-thin-events) which have small, unversioned payloads that include a reference to the ID of the object that has changed. The Events v2 API returns these new thin events. [Retrieve the event object](https://docs.stripe.com/event-destinations#fetch-data) for additional data about the event. Use the related object ID in the event payload to [fetch the API resource](https://docs.stripe.com/event-destinations#retrieve-the-object-associated-with-thin-events) of the object associated with the event. Comparatively, events generated by most API v1 include a versioned snapshot of an API object in their payload.
class Event < APIResource
class Reason < Stripe::StripeObject
class Request < Stripe::StripeObject
# ID of the API request that caused the event.
module Core
# Events are generated to keep you informed of activity in your business account. APIs in the /v2 namespace generate [thin events](https://docs.stripe.com/event-destinations#benefits-of-thin-events) which have small, unversioned payloads that include a reference to the ID of the object that has changed. The Events v2 API returns these new thin events. [Retrieve the event object](https://docs.stripe.com/event-destinations#fetch-data) for additional data about the event. Use the related object ID in the event payload to [fetch the API resource](https://docs.stripe.com/event-destinations#retrieve-the-object-associated-with-thin-events) of the object associated with the event. Comparatively, events generated by most API v1 include a versioned snapshot of an API object in their payload.
class Event < APIResource
class Reason < Stripe::StripeObject
class Request < Stripe::StripeObject
# ID of the API request that caused the event.
sig { returns(String) }
def id; end
# The idempotency key transmitted during the request.
sig { returns(String) }
def idempotency_key; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# Event reason type.
sig { returns(String) }
def id; end
# The idempotency key transmitted during the request.
sig { returns(String) }
def idempotency_key; end
def type; end
# Information on the API request that instigated the event.
sig { returns(T.nilable(Request)) }
def request; end
def self.inner_class_types
@inner_class_types = {}
@inner_class_types = {request: Request}
end
def self.field_remappings
@field_remappings = {}
end
end
# Event reason type.
# Authentication context needed to fetch the event or related object.
sig { returns(T.nilable(String)) }
def context; end
# Time at which the object was created.
sig { returns(String) }
def created; end
# Unique identifier for the event.
sig { returns(String) }
def id; end
# String representing the object's type. Objects of the same type share the same value of the object field.
sig { returns(String) }
def object; end
# Reason for the event.
sig { returns(T.nilable(Reason)) }
def reason; end
# The type of the event.
sig { returns(String) }
def type; end
# Information on the API request that instigated the event.
sig { returns(T.nilable(Request)) }
def request; end
def self.inner_class_types
@inner_class_types = {request: Request}
end
def self.field_remappings
@field_remappings = {}
end
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
sig { returns(T::Boolean) }
def livemode; end
end
# Authentication context needed to fetch the event or related object.
sig { returns(T.nilable(String)) }
def context; end
# Time at which the object was created.
sig { returns(String) }
def created; end
# Unique identifier for the event.
sig { returns(String) }
def id; end
# String representing the object's type. Objects of the same type share the same value of the object field.
sig { returns(String) }
def object; end
# Reason for the event.
sig { returns(T.nilable(Reason)) }
def reason; end
# The type of the event.
sig { returns(String) }
def type; end
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
sig { returns(T::Boolean) }
def livemode; end
end
end
end
@ -168524,6 +168528,20 @@ module Stripe
@field_remappings = {}
end
end
class Capture < Stripe::StripeObject
# The timestamp when this payment is no longer eligible to be captured.
sig { returns(T.nilable(String)) }
def capture_before; end
# The method to use to capture the payment.
sig { returns(String) }
def capture_method; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
class PaymentsOrchestration < Stripe::StripeObject
# True when you want to enable payments orchestration for this off-session payment. False otherwise.
sig { returns(T::Boolean) }
@ -168573,6 +168591,9 @@ module Stripe
@field_remappings = {}
end
end
# The amount available to be captured.
sig { returns(T.nilable(Stripe::V2::Amount)) }
def amount_capturable; end
# Provides industry-specific information about the amount.
sig { returns(T.nilable(AmountDetails)) }
def amount_details; end
@ -168582,6 +168603,12 @@ module Stripe
# The frequency of the underlying payment.
sig { returns(String) }
def cadence; end
# Details about the capture configuration for the OffSessionPayment.
sig { returns(T.nilable(Capture)) }
def capture; end
# Whether the OffSessionPayment should be captured automatically or manually.
sig { returns(T.nilable(String)) }
def capture_method; end
# ID of the owning compartment.
sig { returns(String) }
def compartment_id; end
@ -294366,7 +294393,7 @@ module Stripe
# Retrieves the details of an event.
sig {
params(id: String, params: T.any(::Stripe::V2::Core::EventService::RetrieveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::Event)
params(id: String, params: T.any(::Stripe::V2::Core::EventService::RetrieveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::Core::Event)
}
def retrieve(id, params = {}, opts = {}); end
end
@ -294575,7 +294602,7 @@ module Stripe
class PingParams < Stripe::RequestParams; end
# Create a new event destination.
sig {
params(params: T.any(::Stripe::V2::Core::EventDestinationService::CreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::EventDestination)
params(params: T.any(::Stripe::V2::Core::EventDestinationService::CreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::Core::EventDestination)
}
def create(params = {}, opts = {}); end
@ -294587,13 +294614,13 @@ module Stripe
# Disable an event destination.
sig {
params(id: String, params: T.any(::Stripe::V2::Core::EventDestinationService::DisableParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::EventDestination)
params(id: String, params: T.any(::Stripe::V2::Core::EventDestinationService::DisableParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::Core::EventDestination)
}
def disable(id, params = {}, opts = {}); end
# Enable an event destination.
sig {
params(id: String, params: T.any(::Stripe::V2::Core::EventDestinationService::EnableParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::EventDestination)
params(id: String, params: T.any(::Stripe::V2::Core::EventDestinationService::EnableParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::Core::EventDestination)
}
def enable(id, params = {}, opts = {}); end
@ -294605,19 +294632,19 @@ module Stripe
# Send a `ping` event to an event destination.
sig {
params(id: String, params: T.any(::Stripe::V2::Core::EventDestinationService::PingParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::Event)
params(id: String, params: T.any(::Stripe::V2::Core::EventDestinationService::PingParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::Core::Event)
}
def ping(id, params = {}, opts = {}); end
# Retrieves the details of an event destination.
sig {
params(id: String, params: T.any(::Stripe::V2::Core::EventDestinationService::RetrieveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::EventDestination)
params(id: String, params: T.any(::Stripe::V2::Core::EventDestinationService::RetrieveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::Core::EventDestination)
}
def retrieve(id, params = {}, opts = {}); end
# Update the details of an event destination.
sig {
params(id: String, params: T.any(::Stripe::V2::Core::EventDestinationService::UpdateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::EventDestination)
params(id: String, params: T.any(::Stripe::V2::Core::EventDestinationService::UpdateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::Core::EventDestination)
}
def update(id, params = {}, opts = {}); end
end
@ -296607,34 +296634,14 @@ module Stripe
}
def initialize(discount_amount: nil, line_items: nil, shipping: nil, tax: nil); end
end
class MandateData < Stripe::RequestParams
class CustomerAcceptance < Stripe::RequestParams
# The time at which the customer accepted the Mandate.
sig { returns(T.nilable(String)) }
def accepted_at; end
sig { params(_accepted_at: T.nilable(String)).returns(T.nilable(String)) }
def accepted_at=(_accepted_at); end
# The type of customer acceptance information included with the Mandate.
sig { returns(String) }
def type; end
sig { params(_type: String).returns(String) }
def type=(_type); end
sig { params(accepted_at: T.nilable(String), type: String).void }
def initialize(accepted_at: nil, type: nil); end
end
# This hash contains details about the customer acceptance of the Mandate.
sig {
returns(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::MandateData::CustomerAcceptance)
}
def customer_acceptance; end
sig {
params(_customer_acceptance: ::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::MandateData::CustomerAcceptance).returns(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::MandateData::CustomerAcceptance)
}
def customer_acceptance=(_customer_acceptance); end
sig {
params(customer_acceptance: ::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::MandateData::CustomerAcceptance).void
}
def initialize(customer_acceptance: nil); end
class Capture < Stripe::RequestParams
# The method to use to capture the payment.
sig { returns(String) }
def capture_method; end
sig { params(_capture_method: String).returns(String) }
def capture_method=(_capture_method); end
sig { params(capture_method: String).void }
def initialize(capture_method: nil); end
end
class PaymentMethodOptions < Stripe::RequestParams
class Card < Stripe::RequestParams
@ -296728,20 +296735,25 @@ module Stripe
def cadence; end
sig { params(_cadence: String).returns(String) }
def cadence=(_cadence); end
# Details about the capture configuration for the OffSessionPayment.
sig {
returns(T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::Capture))
}
def capture; end
sig {
params(_capture: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::Capture)).returns(T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::Capture))
}
def capture=(_capture); end
# Whether the OffSessionPayment should be captured automatically or manually.
sig { returns(T.nilable(String)) }
def capture_method; end
sig { params(_capture_method: T.nilable(String)).returns(T.nilable(String)) }
def capture_method=(_capture_method); end
# ID of the Customer to which this OffSessionPayment belongs.
sig { returns(String) }
def customer; end
sig { params(_customer: String).returns(String) }
def customer=(_customer); end
# This hash contains details about the Mandate to create.
sig {
returns(T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::MandateData))
}
def mandate_data; end
sig {
params(_mandate_data: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::MandateData)).returns(T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::MandateData))
}
def mandate_data=(_mandate_data); end
# Set of [key-value pairs](https://docs.corp.stripe.com/api/metadata) that you can
# attach to an object. This can be useful for storing additional information about
# the object in a structured format. Learn more about
@ -296817,14 +296829,15 @@ module Stripe
}
def transfer_data=(_transfer_data); end
sig {
params(amount: Stripe::V2::Amount, amount_details: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::AmountDetails), cadence: String, customer: String, mandate_data: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::MandateData), metadata: T::Hash[String, String], on_behalf_of: T.nilable(String), payment_method: String, payment_method_options: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::PaymentMethodOptions), payments_orchestration: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::PaymentsOrchestration), retry_details: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::RetryDetails), statement_descriptor: T.nilable(String), statement_descriptor_suffix: T.nilable(String), test_clock: T.nilable(String), transfer_data: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::TransferData)).void
params(amount: Stripe::V2::Amount, amount_details: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::AmountDetails), cadence: String, capture: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::Capture), capture_method: T.nilable(String), customer: String, metadata: T::Hash[String, String], on_behalf_of: T.nilable(String), payment_method: String, payment_method_options: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::PaymentMethodOptions), payments_orchestration: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::PaymentsOrchestration), retry_details: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::RetryDetails), statement_descriptor: T.nilable(String), statement_descriptor_suffix: T.nilable(String), test_clock: T.nilable(String), transfer_data: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::TransferData)).void
}
def initialize(
amount: nil,
amount_details: nil,
cadence: nil,
capture: nil,
capture_method: nil,
customer: nil,
mandate_data: nil,
metadata: nil,
on_behalf_of: nil,
payment_method: nil,
@ -296839,12 +296852,88 @@ module Stripe
end
class RetrieveParams < Stripe::RequestParams; end
class CancelParams < Stripe::RequestParams; end
class CaptureParams < Stripe::RequestParams
class TransferData < Stripe::RequestParams
# The amount transferred to the destination account. This transfer will occur
# automatically after the payment succeeds. If no amount is specified, by default
# the entire payment amount is transferred to the destination account. The amount
# must be less than or equal to the
# [amount_requested](https://docs.corp.stripe.com/api/v2/off-session-payments/object?api-version=2025-05-28.preview#v2_off_session_payment_object-amount_requested),
# and must be a positive integer representing how much to transfer in the smallest
# currency unit (e.g., 100 cents to charge $1.00).
sig { returns(T.nilable(Integer)) }
def amount; end
sig { params(_amount: T.nilable(Integer)).returns(T.nilable(Integer)) }
def amount=(_amount); end
# The account (if any) that the payment is attributed to for tax reporting, and
# where funds from the payment are transferred to after payment success.
sig { returns(String) }
def destination; end
sig { params(_destination: String).returns(String) }
def destination=(_destination); end
sig { params(amount: T.nilable(Integer), destination: String).void }
def initialize(amount: nil, destination: nil); end
end
# The amount to capture.
sig { returns(Integer) }
def amount_to_capture; end
sig { params(_amount_to_capture: Integer).returns(Integer) }
def amount_to_capture=(_amount_to_capture); end
# Set of [key-value pairs](https://docs.corp.stripe.com/api/metadata) that you can
# attach to an object. This can be useful for storing additional information about
# the object in a structured format. Learn more about
# [storing information in metadata](https://docs.corp.stripe.com/payments/payment-intents#storing-information-in-metadata).
sig { returns(T::Hash[String, String]) }
def metadata; end
sig { params(_metadata: T::Hash[String, String]).returns(T::Hash[String, String]) }
def metadata=(_metadata); end
# Text that appears on the customers statement as the statement descriptor for a
# non-card charge. This value overrides the accounts default statement descriptor.
# For information about requirements, including the 22-character limit, see the
# [Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).
sig { returns(T.nilable(String)) }
def statement_descriptor; end
sig { params(_statement_descriptor: T.nilable(String)).returns(T.nilable(String)) }
def statement_descriptor=(_statement_descriptor); end
# Provides information about a card charge. Concatenated to the accounts
# [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static)
# to form the complete statement descriptor that appears on the customers statement.
sig { returns(T.nilable(String)) }
def statement_descriptor_suffix; end
sig { params(_statement_descriptor_suffix: T.nilable(String)).returns(T.nilable(String)) }
def statement_descriptor_suffix=(_statement_descriptor_suffix); end
# The data that automatically creates a Transfer after the payment finalizes. Learn more about the use case for [connected accounts](https://docs.corp.stripe.com/payments/connected-accounts).
sig {
returns(T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CaptureParams::TransferData))
}
def transfer_data; end
sig {
params(_transfer_data: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CaptureParams::TransferData)).returns(T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CaptureParams::TransferData))
}
def transfer_data=(_transfer_data); end
sig {
params(amount_to_capture: Integer, metadata: T::Hash[String, String], statement_descriptor: T.nilable(String), statement_descriptor_suffix: T.nilable(String), transfer_data: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CaptureParams::TransferData)).void
}
def initialize(
amount_to_capture: nil,
metadata: nil,
statement_descriptor: nil,
statement_descriptor_suffix: nil,
transfer_data: nil
); end
end
# Cancel an OffSessionPayment that has previously been created.
sig {
params(id: String, params: T.any(::Stripe::V2::Payments::OffSessionPaymentService::CancelParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::Payments::OffSessionPayment)
}
def cancel(id, params = {}, opts = {}); end
# Captures an OffSessionPayment that has previously been created.
sig {
params(id: String, params: T.any(::Stripe::V2::Payments::OffSessionPaymentService::CaptureParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::Payments::OffSessionPayment)
}
def capture(id, params = {}, opts = {}); end
# Creates an OffSessionPayment object.
sig {
params(params: T.any(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::Payments::OffSessionPayment)

View File

@ -1,41 +0,0 @@
# frozen_string_literal: true
# typed: true
module Stripe
module V2
class EventReasonRequest
sig { returns(String) }
def id; end
sig { returns(String) }
def idempotency_key; end
sig { params(event_reason_request_payload: T::Hash[T.untyped, T.untyped]).void }
def initialize(event_reason_request_payload = {}); end
end
class EventReason
sig { returns(String) }
def type; end
sig { returns(::Stripe::V2::EventReasonRequest) }
def request; end
sig { params(event_reason_payload: T::Hash[T.untyped, T.untyped]).void }
def initialize(event_reason_payload = {}); end
end
class EventNotification
sig { returns(String) }
def id; end
sig { returns(String) }
def type; end
sig { returns(String) }
def created; end
sig { returns(T.nilable(String)) }
def context; end
sig { returns(T::Boolean) }
def livemode; end
sig { returns(T.nilable(::Stripe::V2::EventReason)) }
def reason; end
end
end
end

View File

@ -1098,7 +1098,7 @@ module Stripe
sig { returns(T.nilable(String)) }
def hosted_invoice_url; end
# Unique identifier for the object. For preview invoices created using the [create preview](https://stripe.com/docs/api/invoices/create_preview) endpoint, this id will be prefixed with `upcoming_in`.
sig { returns(T.nilable(String)) }
sig { returns(String) }
def id; end
# The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null.
sig { returns(T.nilable(String)) }

View File

@ -0,0 +1,62 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
# typed: true
module Stripe
module V2
module Core
# Events are generated to keep you informed of activity in your business account. APIs in the /v2 namespace generate [thin events](https://docs.stripe.com/event-destinations#benefits-of-thin-events) which have small, unversioned payloads that include a reference to the ID of the object that has changed. The Events v2 API returns these new thin events. [Retrieve the event object](https://docs.stripe.com/event-destinations#fetch-data) for additional data about the event. Use the related object ID in the event payload to [fetch the API resource](https://docs.stripe.com/event-destinations#retrieve-the-object-associated-with-thin-events) of the object associated with the event. Comparatively, events generated by most API v1 include a versioned snapshot of an API object in their payload.
class Event < APIResource
class Reason < Stripe::StripeObject
class Request < Stripe::StripeObject
# ID of the API request that caused the event.
sig { returns(String) }
def id; end
# The idempotency key transmitted during the request.
sig { returns(String) }
def idempotency_key; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# Event reason type.
sig { returns(String) }
def type; end
# Information on the API request that instigated the event.
sig { returns(T.nilable(Request)) }
def request; end
def self.inner_class_types
@inner_class_types = {request: Request}
end
def self.field_remappings
@field_remappings = {}
end
end
# Authentication context needed to fetch the event or related object.
sig { returns(T.nilable(String)) }
def context; end
# Time at which the object was created.
sig { returns(String) }
def created; end
# Unique identifier for the event.
sig { returns(String) }
def id; end
# String representing the object's type. Objects of the same type share the same value of the object field.
sig { returns(String) }
def object; end
# Reason for the event.
sig { returns(T.nilable(Reason)) }
def reason; end
# The type of the event.
sig { returns(String) }
def type; end
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
sig { returns(T::Boolean) }
def livemode; end
end
end
end
end

View File

@ -0,0 +1,117 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
# typed: true
module Stripe
module V2
module Core
# Set up an event destination to receive events from Stripe across multiple destination types, including [webhook endpoints](https://docs.stripe.com/webhooks) and [Amazon EventBridge](https://docs.stripe.com/event-destinations/eventbridge). Event destinations support receiving [thin events](https://docs.stripe.com/api/v2/events) and [snapshot events](https://docs.stripe.com/api/events).
class EventDestination < APIResource
class StatusDetails < Stripe::StripeObject
class Disabled < Stripe::StripeObject
# Reason event destination has been disabled.
sig { returns(String) }
def reason; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# Details about why the event destination has been disabled.
sig { returns(T.nilable(Disabled)) }
def disabled; end
def self.inner_class_types
@inner_class_types = {disabled: Disabled}
end
def self.field_remappings
@field_remappings = {}
end
end
class AmazonEventbridge < Stripe::StripeObject
# The AWS account ID.
sig { returns(String) }
def aws_account_id; end
# The ARN of the AWS event source.
sig { returns(String) }
def aws_event_source_arn; end
# The state of the AWS event source.
sig { returns(String) }
def aws_event_source_status; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
class WebhookEndpoint < Stripe::StripeObject
# The signing secret of the webhook endpoint, only includable on creation.
sig { returns(T.nilable(String)) }
def signing_secret; end
# The URL of the webhook endpoint, includable.
sig { returns(T.nilable(String)) }
def url; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# Time at which the object was created.
sig { returns(String) }
def created; end
# An optional description of what the event destination is used for.
sig { returns(String) }
def description; end
# The list of events to enable for this endpoint.
sig { returns(T::Array[String]) }
def enabled_events; end
# Payload type of events being subscribed to.
sig { returns(String) }
def event_payload; end
# Where events should be routed from.
sig { returns(T.nilable(T::Array[String])) }
def events_from; end
# Unique identifier for the object.
sig { returns(String) }
def id; end
# Metadata.
sig { returns(T.nilable(T::Hash[String, String])) }
def metadata; end
# Event destination name.
sig { returns(String) }
def name; end
# String representing the object's type. Objects of the same type share the same value of the object field.
sig { returns(String) }
def object; end
# If using the snapshot event payload, the API version events are rendered as.
sig { returns(T.nilable(String)) }
def snapshot_api_version; end
# Status. It can be set to either enabled or disabled.
sig { returns(String) }
def status; end
# Additional information about event destination status.
sig { returns(T.nilable(StatusDetails)) }
def status_details; end
# Event destination type.
sig { returns(String) }
def type; end
# Time at which the object was last updated.
sig { returns(String) }
def updated; end
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
sig { returns(T::Boolean) }
def livemode; end
# Amazon EventBridge configuration.
sig { returns(T.nilable(AmazonEventbridge)) }
def amazon_eventbridge; end
# Webhook endpoint configuration.
sig { returns(T.nilable(WebhookEndpoint)) }
def webhook_endpoint; end
end
end
end
end

View File

@ -0,0 +1,43 @@
# frozen_string_literal: true
# typed: true
module Stripe
module V2
module Core
class EventReasonRequest
sig { returns(String) }
def id; end
sig { returns(String) }
def idempotency_key; end
sig { params(event_reason_request_payload: T::Hash[T.untyped, T.untyped]).void }
def initialize(event_reason_request_payload = {}); end
end
class EventReason
sig { returns(String) }
def type; end
sig { returns(::Stripe::V2::Core::EventReasonRequest) }
def request; end
sig { params(event_reason_payload: T::Hash[T.untyped, T.untyped]).void }
def initialize(event_reason_payload = {}); end
end
class EventNotification
sig { returns(String) }
def id; end
sig { returns(String) }
def type; end
sig { returns(String) }
def created; end
sig { returns(T.nilable(String)) }
def context; end
sig { returns(T::Boolean) }
def livemode; end
sig { returns(T.nilable(::Stripe::V2::Core::EventReason)) }
def reason; end
end
end
end
end

View File

@ -1,60 +0,0 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
# typed: true
module Stripe
module V2
# Events are generated to keep you informed of activity in your business account. APIs in the /v2 namespace generate [thin events](https://docs.stripe.com/event-destinations#benefits-of-thin-events) which have small, unversioned payloads that include a reference to the ID of the object that has changed. The Events v2 API returns these new thin events. [Retrieve the event object](https://docs.stripe.com/event-destinations#fetch-data) for additional data about the event. Use the related object ID in the event payload to [fetch the API resource](https://docs.stripe.com/event-destinations#retrieve-the-object-associated-with-thin-events) of the object associated with the event. Comparatively, events generated by most API v1 include a versioned snapshot of an API object in their payload.
class Event < APIResource
class Reason < Stripe::StripeObject
class Request < Stripe::StripeObject
# ID of the API request that caused the event.
sig { returns(String) }
def id; end
# The idempotency key transmitted during the request.
sig { returns(String) }
def idempotency_key; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# Event reason type.
sig { returns(String) }
def type; end
# Information on the API request that instigated the event.
sig { returns(T.nilable(Request)) }
def request; end
def self.inner_class_types
@inner_class_types = {request: Request}
end
def self.field_remappings
@field_remappings = {}
end
end
# Authentication context needed to fetch the event or related object.
sig { returns(T.nilable(String)) }
def context; end
# Time at which the object was created.
sig { returns(String) }
def created; end
# Unique identifier for the event.
sig { returns(String) }
def id; end
# String representing the object's type. Objects of the same type share the same value of the object field.
sig { returns(String) }
def object; end
# Reason for the event.
sig { returns(T.nilable(Reason)) }
def reason; end
# The type of the event.
sig { returns(String) }
def type; end
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
sig { returns(T::Boolean) }
def livemode; end
end
end
end

View File

@ -1,115 +0,0 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
# typed: true
module Stripe
module V2
# Set up an event destination to receive events from Stripe across multiple destination types, including [webhook endpoints](https://docs.stripe.com/webhooks) and [Amazon EventBridge](https://docs.stripe.com/event-destinations/eventbridge). Event destinations support receiving [thin events](https://docs.stripe.com/api/v2/events) and [snapshot events](https://docs.stripe.com/api/events).
class EventDestination < APIResource
class StatusDetails < Stripe::StripeObject
class Disabled < Stripe::StripeObject
# Reason event destination has been disabled.
sig { returns(String) }
def reason; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# Details about why the event destination has been disabled.
sig { returns(T.nilable(Disabled)) }
def disabled; end
def self.inner_class_types
@inner_class_types = {disabled: Disabled}
end
def self.field_remappings
@field_remappings = {}
end
end
class AmazonEventbridge < Stripe::StripeObject
# The AWS account ID.
sig { returns(String) }
def aws_account_id; end
# The ARN of the AWS event source.
sig { returns(String) }
def aws_event_source_arn; end
# The state of the AWS event source.
sig { returns(String) }
def aws_event_source_status; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
class WebhookEndpoint < Stripe::StripeObject
# The signing secret of the webhook endpoint, only includable on creation.
sig { returns(T.nilable(String)) }
def signing_secret; end
# The URL of the webhook endpoint, includable.
sig { returns(T.nilable(String)) }
def url; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# Time at which the object was created.
sig { returns(String) }
def created; end
# An optional description of what the event destination is used for.
sig { returns(String) }
def description; end
# The list of events to enable for this endpoint.
sig { returns(T::Array[String]) }
def enabled_events; end
# Payload type of events being subscribed to.
sig { returns(String) }
def event_payload; end
# Where events should be routed from.
sig { returns(T.nilable(T::Array[String])) }
def events_from; end
# Unique identifier for the object.
sig { returns(String) }
def id; end
# Metadata.
sig { returns(T.nilable(T::Hash[String, String])) }
def metadata; end
# Event destination name.
sig { returns(String) }
def name; end
# String representing the object's type. Objects of the same type share the same value of the object field.
sig { returns(String) }
def object; end
# If using the snapshot event payload, the API version events are rendered as.
sig { returns(T.nilable(String)) }
def snapshot_api_version; end
# Status. It can be set to either enabled or disabled.
sig { returns(String) }
def status; end
# Additional information about event destination status.
sig { returns(T.nilable(StatusDetails)) }
def status_details; end
# Event destination type.
sig { returns(String) }
def type; end
# Time at which the object was last updated.
sig { returns(String) }
def updated; end
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
sig { returns(T::Boolean) }
def livemode; end
# Amazon EventBridge configuration.
sig { returns(T.nilable(AmazonEventbridge)) }
def amazon_eventbridge; end
# Webhook endpoint configuration.
sig { returns(T.nilable(WebhookEndpoint)) }
def webhook_endpoint; end
end
end
end

View File

@ -92,6 +92,20 @@ module Stripe
@field_remappings = {}
end
end
class Capture < Stripe::StripeObject
# The timestamp when this payment is no longer eligible to be captured.
sig { returns(T.nilable(String)) }
def capture_before; end
# The method to use to capture the payment.
sig { returns(String) }
def capture_method; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
class PaymentsOrchestration < Stripe::StripeObject
# True when you want to enable payments orchestration for this off-session payment. False otherwise.
sig { returns(T::Boolean) }
@ -141,6 +155,9 @@ module Stripe
@field_remappings = {}
end
end
# The amount available to be captured.
sig { returns(T.nilable(Stripe::V2::Amount)) }
def amount_capturable; end
# Provides industry-specific information about the amount.
sig { returns(T.nilable(AmountDetails)) }
def amount_details; end
@ -150,6 +167,12 @@ module Stripe
# The frequency of the underlying payment.
sig { returns(String) }
def cadence; end
# Details about the capture configuration for the OffSessionPayment.
sig { returns(T.nilable(Capture)) }
def capture; end
# Whether the OffSessionPayment should be captured automatically or manually.
sig { returns(T.nilable(String)) }
def capture_method; end
# ID of the owning compartment.
sig { returns(String) }
def compartment_id; end

View File

@ -203,7 +203,7 @@ module Stripe
class PingParams < Stripe::RequestParams; end
# Create a new event destination.
sig {
params(params: T.any(::Stripe::V2::Core::EventDestinationService::CreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::EventDestination)
params(params: T.any(::Stripe::V2::Core::EventDestinationService::CreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::Core::EventDestination)
}
def create(params = {}, opts = {}); end
@ -215,13 +215,13 @@ module Stripe
# Disable an event destination.
sig {
params(id: String, params: T.any(::Stripe::V2::Core::EventDestinationService::DisableParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::EventDestination)
params(id: String, params: T.any(::Stripe::V2::Core::EventDestinationService::DisableParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::Core::EventDestination)
}
def disable(id, params = {}, opts = {}); end
# Enable an event destination.
sig {
params(id: String, params: T.any(::Stripe::V2::Core::EventDestinationService::EnableParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::EventDestination)
params(id: String, params: T.any(::Stripe::V2::Core::EventDestinationService::EnableParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::Core::EventDestination)
}
def enable(id, params = {}, opts = {}); end
@ -233,19 +233,19 @@ module Stripe
# Send a `ping` event to an event destination.
sig {
params(id: String, params: T.any(::Stripe::V2::Core::EventDestinationService::PingParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::Event)
params(id: String, params: T.any(::Stripe::V2::Core::EventDestinationService::PingParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::Core::Event)
}
def ping(id, params = {}, opts = {}); end
# Retrieves the details of an event destination.
sig {
params(id: String, params: T.any(::Stripe::V2::Core::EventDestinationService::RetrieveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::EventDestination)
params(id: String, params: T.any(::Stripe::V2::Core::EventDestinationService::RetrieveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::Core::EventDestination)
}
def retrieve(id, params = {}, opts = {}); end
# Update the details of an event destination.
sig {
params(id: String, params: T.any(::Stripe::V2::Core::EventDestinationService::UpdateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::EventDestination)
params(id: String, params: T.any(::Stripe::V2::Core::EventDestinationService::UpdateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::Core::EventDestination)
}
def update(id, params = {}, opts = {}); end
end

View File

@ -31,7 +31,7 @@ module Stripe
# Retrieves the details of an event.
sig {
params(id: String, params: T.any(::Stripe::V2::Core::EventService::RetrieveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::Event)
params(id: String, params: T.any(::Stripe::V2::Core::EventService::RetrieveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::Core::Event)
}
def retrieve(id, params = {}, opts = {}); end
end

View File

@ -140,34 +140,14 @@ module Stripe
}
def initialize(discount_amount: nil, line_items: nil, shipping: nil, tax: nil); end
end
class MandateData < Stripe::RequestParams
class CustomerAcceptance < Stripe::RequestParams
# The time at which the customer accepted the Mandate.
sig { returns(T.nilable(String)) }
def accepted_at; end
sig { params(_accepted_at: T.nilable(String)).returns(T.nilable(String)) }
def accepted_at=(_accepted_at); end
# The type of customer acceptance information included with the Mandate.
sig { returns(String) }
def type; end
sig { params(_type: String).returns(String) }
def type=(_type); end
sig { params(accepted_at: T.nilable(String), type: String).void }
def initialize(accepted_at: nil, type: nil); end
end
# This hash contains details about the customer acceptance of the Mandate.
sig {
returns(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::MandateData::CustomerAcceptance)
}
def customer_acceptance; end
sig {
params(_customer_acceptance: ::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::MandateData::CustomerAcceptance).returns(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::MandateData::CustomerAcceptance)
}
def customer_acceptance=(_customer_acceptance); end
sig {
params(customer_acceptance: ::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::MandateData::CustomerAcceptance).void
}
def initialize(customer_acceptance: nil); end
class Capture < Stripe::RequestParams
# The method to use to capture the payment.
sig { returns(String) }
def capture_method; end
sig { params(_capture_method: String).returns(String) }
def capture_method=(_capture_method); end
sig { params(capture_method: String).void }
def initialize(capture_method: nil); end
end
class PaymentMethodOptions < Stripe::RequestParams
class Card < Stripe::RequestParams
@ -261,20 +241,25 @@ module Stripe
def cadence; end
sig { params(_cadence: String).returns(String) }
def cadence=(_cadence); end
# Details about the capture configuration for the OffSessionPayment.
sig {
returns(T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::Capture))
}
def capture; end
sig {
params(_capture: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::Capture)).returns(T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::Capture))
}
def capture=(_capture); end
# Whether the OffSessionPayment should be captured automatically or manually.
sig { returns(T.nilable(String)) }
def capture_method; end
sig { params(_capture_method: T.nilable(String)).returns(T.nilable(String)) }
def capture_method=(_capture_method); end
# ID of the Customer to which this OffSessionPayment belongs.
sig { returns(String) }
def customer; end
sig { params(_customer: String).returns(String) }
def customer=(_customer); end
# This hash contains details about the Mandate to create.
sig {
returns(T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::MandateData))
}
def mandate_data; end
sig {
params(_mandate_data: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::MandateData)).returns(T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::MandateData))
}
def mandate_data=(_mandate_data); end
# Set of [key-value pairs](https://docs.corp.stripe.com/api/metadata) that you can
# attach to an object. This can be useful for storing additional information about
# the object in a structured format. Learn more about
@ -350,14 +335,15 @@ module Stripe
}
def transfer_data=(_transfer_data); end
sig {
params(amount: Stripe::V2::Amount, amount_details: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::AmountDetails), cadence: String, customer: String, mandate_data: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::MandateData), metadata: T::Hash[String, String], on_behalf_of: T.nilable(String), payment_method: String, payment_method_options: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::PaymentMethodOptions), payments_orchestration: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::PaymentsOrchestration), retry_details: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::RetryDetails), statement_descriptor: T.nilable(String), statement_descriptor_suffix: T.nilable(String), test_clock: T.nilable(String), transfer_data: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::TransferData)).void
params(amount: Stripe::V2::Amount, amount_details: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::AmountDetails), cadence: String, capture: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::Capture), capture_method: T.nilable(String), customer: String, metadata: T::Hash[String, String], on_behalf_of: T.nilable(String), payment_method: String, payment_method_options: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::PaymentMethodOptions), payments_orchestration: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::PaymentsOrchestration), retry_details: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::RetryDetails), statement_descriptor: T.nilable(String), statement_descriptor_suffix: T.nilable(String), test_clock: T.nilable(String), transfer_data: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams::TransferData)).void
}
def initialize(
amount: nil,
amount_details: nil,
cadence: nil,
capture: nil,
capture_method: nil,
customer: nil,
mandate_data: nil,
metadata: nil,
on_behalf_of: nil,
payment_method: nil,
@ -372,12 +358,88 @@ module Stripe
end
class RetrieveParams < Stripe::RequestParams; end
class CancelParams < Stripe::RequestParams; end
class CaptureParams < Stripe::RequestParams
class TransferData < Stripe::RequestParams
# The amount transferred to the destination account. This transfer will occur
# automatically after the payment succeeds. If no amount is specified, by default
# the entire payment amount is transferred to the destination account. The amount
# must be less than or equal to the
# [amount_requested](https://docs.corp.stripe.com/api/v2/off-session-payments/object?api-version=2025-05-28.preview#v2_off_session_payment_object-amount_requested),
# and must be a positive integer representing how much to transfer in the smallest
# currency unit (e.g., 100 cents to charge $1.00).
sig { returns(T.nilable(Integer)) }
def amount; end
sig { params(_amount: T.nilable(Integer)).returns(T.nilable(Integer)) }
def amount=(_amount); end
# The account (if any) that the payment is attributed to for tax reporting, and
# where funds from the payment are transferred to after payment success.
sig { returns(String) }
def destination; end
sig { params(_destination: String).returns(String) }
def destination=(_destination); end
sig { params(amount: T.nilable(Integer), destination: String).void }
def initialize(amount: nil, destination: nil); end
end
# The amount to capture.
sig { returns(Integer) }
def amount_to_capture; end
sig { params(_amount_to_capture: Integer).returns(Integer) }
def amount_to_capture=(_amount_to_capture); end
# Set of [key-value pairs](https://docs.corp.stripe.com/api/metadata) that you can
# attach to an object. This can be useful for storing additional information about
# the object in a structured format. Learn more about
# [storing information in metadata](https://docs.corp.stripe.com/payments/payment-intents#storing-information-in-metadata).
sig { returns(T::Hash[String, String]) }
def metadata; end
sig { params(_metadata: T::Hash[String, String]).returns(T::Hash[String, String]) }
def metadata=(_metadata); end
# Text that appears on the customers statement as the statement descriptor for a
# non-card charge. This value overrides the accounts default statement descriptor.
# For information about requirements, including the 22-character limit, see the
# [Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors).
sig { returns(T.nilable(String)) }
def statement_descriptor; end
sig { params(_statement_descriptor: T.nilable(String)).returns(T.nilable(String)) }
def statement_descriptor=(_statement_descriptor); end
# Provides information about a card charge. Concatenated to the accounts
# [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static)
# to form the complete statement descriptor that appears on the customers statement.
sig { returns(T.nilable(String)) }
def statement_descriptor_suffix; end
sig { params(_statement_descriptor_suffix: T.nilable(String)).returns(T.nilable(String)) }
def statement_descriptor_suffix=(_statement_descriptor_suffix); end
# The data that automatically creates a Transfer after the payment finalizes. Learn more about the use case for [connected accounts](https://docs.corp.stripe.com/payments/connected-accounts).
sig {
returns(T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CaptureParams::TransferData))
}
def transfer_data; end
sig {
params(_transfer_data: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CaptureParams::TransferData)).returns(T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CaptureParams::TransferData))
}
def transfer_data=(_transfer_data); end
sig {
params(amount_to_capture: Integer, metadata: T::Hash[String, String], statement_descriptor: T.nilable(String), statement_descriptor_suffix: T.nilable(String), transfer_data: T.nilable(::Stripe::V2::Payments::OffSessionPaymentService::CaptureParams::TransferData)).void
}
def initialize(
amount_to_capture: nil,
metadata: nil,
statement_descriptor: nil,
statement_descriptor_suffix: nil,
transfer_data: nil
); end
end
# Cancel an OffSessionPayment that has previously been created.
sig {
params(id: String, params: T.any(::Stripe::V2::Payments::OffSessionPaymentService::CancelParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::Payments::OffSessionPayment)
}
def cancel(id, params = {}, opts = {}); end
# Captures an OffSessionPayment that has previously been created.
sig {
params(id: String, params: T.any(::Stripe::V2::Payments::OffSessionPaymentService::CaptureParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::Payments::OffSessionPayment)
}
def capture(id, params = {}, opts = {}); end
# Creates an OffSessionPayment object.
sig {
params(params: T.any(::Stripe::V2::Payments::OffSessionPaymentService::CreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::V2::Payments::OffSessionPayment)

View File

@ -10,7 +10,7 @@ module Stripe
secret: String,
tolerance: T.nilable(Integer)
)
.returns(::Stripe::V2::EventNotification)
.returns(::Stripe::V2::Core::EventNotification)
end
def parse_event_notification(payload, sig_header, secret, tolerance:); end
end

View File

@ -35,7 +35,7 @@ Gem::Specification.new do |s|
# Handwritten RBIs
# TODO(helenye): http://go/j/DEVSDK-2769
%r{\Arbi/stripe/stripe_client.rbi\z},
%r{\Arbi/stripe/event_notification.rbi\z}
%r{\Arbi/stripe/resources/v2/core/event_notification.rbi\z}
)
s.files = `git ls-files`.split("\n").grep(included)
s.bindir = "exe"

View File

@ -927,13 +927,13 @@ module Stripe
context "v2 resources" do
should "raise an NotImplementedError on resource_url" do
assert_raises NotImplementedError do
Stripe::V2::Event.resource_url
Stripe::V2::Core::Event.resource_url
end
end
should "raise an NotImplementedError on retrieve" do
assert_raises NotImplementedError do
Stripe::V2::Event.retrieve("acct_123")
Stripe::V2::Core::Event.retrieve("acct_123")
end
end

View File

@ -1554,11 +1554,7 @@ module Stripe
assert_requested :get, "#{Stripe::DEFAULT_API_BASE}/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx"
end
should "Test customers sources post" do
payment_source = Stripe::Customer.update_source(
"cus_123",
"card_123",
{ account_holder_name: "Kamil" }
)
payment_source = Stripe::Customer.update_source("cus_123", "card_123", { name: "Kamil" })
assert_requested :post, "#{Stripe.api_base}/v1/customers/cus_123/sources/card_123"
end
should "Test customers sources post (service)" do
@ -1568,11 +1564,7 @@ module Stripe
).to_return(body: "{}")
client = Stripe::StripeClient.new("sk_test_123")
result = client.v1.customers.payment_sources.update(
"cus_123",
"card_123",
{ account_holder_name: "Kamil" }
)
result = client.v1.customers.payment_sources.update("cus_123", "card_123", { name: "Kamil" })
assert_requested :post, "#{Stripe::DEFAULT_API_BASE}/v1/customers/cus_123/sources/card_123"
end
should "Test customers sources post 2" do
@ -8874,6 +8866,25 @@ module Stripe
off_session_payment = client.v2.payments.off_session_payments.cancel("id_123")
assert_requested :post, "#{Stripe::DEFAULT_API_BASE}/v2/payments/off_session_payments/id_123/cancel"
end
should "Test v2 payments off session payment post 3 (service)" do
stub_request(
:post,
"#{Stripe::DEFAULT_API_BASE}/v2/payments/off_session_payments/id_123/capture"
).to_return(
body: '{"amount_requested":{"currency":"USD","value":47},"cadence":"unscheduled","compartment_id":"compartment_id","created":"1970-01-12T21:42:34.472Z","customer":"customer","id":"obj_123","livemode":true,"metadata":{"key":"metadata"},"object":"v2.payments.off_session_payment","payment_method":"payment_method","payments_orchestration":{"enabled":true},"retry_details":{"attempts":542738246,"retry_strategy":"scheduled"},"status":"pending"}',
status: 200
)
client = Stripe::StripeClient.new("sk_test_123")
off_session_payment = client.v2.payments.off_session_payments.capture(
"id_123",
{
amount_to_capture: 1_374_310_455,
metadata: { key: "metadata" },
}
)
assert_requested :post, "#{Stripe::DEFAULT_API_BASE}/v2/payments/off_session_payments/id_123/capture"
end
should "Test v2 test helpers financial address post (service)" do
stub_request(
:post,

View File

@ -158,7 +158,7 @@ module Stripe
assert_equal nil, req.headers["Content-Type"]
assert resp.is_a?(Stripe::V2::Event)
assert resp.is_a?(Stripe::V2::Core::Event)
assert_equal "sk_test_123", resp.instance_variable_get(:@opts)[:api_key]
assert_equal 200, resp.last_response.http_status
end
@ -380,7 +380,7 @@ module Stripe
obj = @client.deserialize(expected_body, api_mode: :v2)
assert_equal obj.class, Stripe::V2::Event
assert_equal obj.class, Stripe::V2::Core::Event
assert_equal obj.id, "evt_123"
end
end

View File

@ -377,7 +377,7 @@ module Stripe
context: "workspace/account/customer",
}
notification = Stripe::V2::EventNotification.new(event_payload, client)
notification = Stripe::V2::Core::EventNotification.new(event_payload, client)
assert_not_nil notification.context
assert_equal "workspace/account/customer", notification.context.to_s
@ -395,7 +395,7 @@ module Stripe
context: nil,
}
notification = Stripe::V2::EventNotification.new(event_payload, client)
notification = Stripe::V2::Core::EventNotification.new(event_payload, client)
assert_nil notification.context
end
@ -410,7 +410,7 @@ module Stripe
context: "",
}
notification = Stripe::V2::EventNotification.new(event_payload, client)
notification = Stripe::V2::Core::EventNotification.new(event_payload, client)
assert_nil notification.context
end

View File

@ -95,7 +95,7 @@ module Stripe
context ".event_signing" do
should "parse v2 events" do
event = parse_signed_event(@v2_push_payload)
assert event.is_a?(Stripe::V2::EventNotification)
assert event.is_a?(Stripe::V2::Core::EventNotification)
assert_equal "evt_234", event.id
assert_equal "v1.billing.meter.error_report_triggered", event.type
assert_equal "2022-02-15T00:27:45.330Z", event.created
@ -104,9 +104,9 @@ module Stripe
should "parse v2 events with livemode and reason" do
event = parse_signed_event(@v2_push_payload_with_livemode_and_reason)
assert event.is_a?(Stripe::V2::EventNotification)
assert event.related_object.is_a?(Stripe::V2::RelatedObject)
assert event.reason.is_a?(Stripe::V2::EventReason)
assert event.is_a?(Stripe::V2::Core::EventNotification)
assert event.related_object.is_a?(Stripe::V2::Core::RelatedObject)
assert event.reason.is_a?(Stripe::V2::Core::EventReason)
assert_equal "evt_234", event.id
assert_equal "v1.billing.meter.error_report_triggered", event.type
@ -158,7 +158,7 @@ module Stripe
should "parse unknown events" do
event_notif = parse_signed_event(@v2_payload_fake_event)
assert event_notif.instance_of?(Stripe::V2::UnknownEventNotification)
assert event_notif.instance_of?(Stripe::Events::UnknownEventNotification)
stub_request(:get, "#{Stripe::DEFAULT_API_BASE}/v2/core/events/evt_234")
.to_return(body: {
@ -169,7 +169,7 @@ module Stripe
}.to_json)
event = event_notif.fetch_event
assert event.instance_of?(Stripe::V2::Event)
assert event.instance_of?(Stripe::V2::Core::Event)
end
end
end

View File

@ -199,7 +199,7 @@ module Stripe
.to_return(body: JSON.generate(data: [{ id: 2, object: "v2.core.event" }, { id: 3, object: "v2.core.event" }, { id: 4, object: "v2.core.event" }], next_page_url: nil))
list.each do |obj|
assert_instance_of(Stripe::V2::Event, obj)
assert_instance_of(Stripe::V2::Core::Event, obj)
end
end