diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a3d79b9c..e781c277e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## 19.5.0 - 2026-08-10 +* [#1932](https://github.com/stripe/stripe-ruby/pull/1932) Handle break in auto-paging blocks + - Rescues `LocalJumpError` to prevent crash when calling `break` inside an `auto_paging_each` +* [#1927](https://github.com/stripe/stripe-ruby/pull/1927) Surface `object` property on `EventNotification` +* [#1918](https://github.com/stripe/stripe-ruby/pull/1918) add/adjust event parsing helpers + + - Added methods that return their respective `Event`/`EventNotification` class instances without verifying authenticity. Use them when you've previously verified an event (e.g. you verified, put the event in a queue, and are now processing). Supports events from [AWS EventBridge](https://docs.stripe.com/event-destinations/eventbridge) and [Azure Event Grid](https://docs.stripe.com/event-destinations/eventgrid) natively. + - `Webhook#construct_event_without_verification(payload)` + - `StripeClient#parse_event_notification_without_verification(payload)` +* [#1924](https://github.com/stripe/stripe-ruby/pull/1924) Discard the connection when a request is interrupted + - Fix connection reuse after a request is interrupted by a non-StandardError exception (e.g. from rack-timeout), which could cause subsequent requests to receive a previous request's response + ## 19.5.0-alpha.2 - 2026-08-05 * [#1920](https://github.com/stripe/stripe-ruby/pull/1920) Update generated code for private-preview * Add support for new resource `Billing::FeedbackOptions` diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index 1b3017c05..c3a97bb1b 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -85839f80afcaccd622aa30bf53a414cdffbd57bc \ No newline at end of file +1e95a9c21695d1f28bf9bf64ed7c83a05749b1e8 \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index dea428aab..a4918c596 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2369 \ No newline at end of file +v2396 \ No newline at end of file diff --git a/lib/stripe.rb b/lib/stripe.rb index 64dba0e7d..3c046c921 100644 --- a/lib/stripe.rb +++ b/lib/stripe.rb @@ -34,6 +34,7 @@ require "stripe/object_types" require "stripe/event_types" require "stripe/request_options" +require "stripe/v2_type_coercion" require "stripe/request_params" require "stripe/stripe_context" require "stripe/util" diff --git a/lib/stripe/api_requestor.rb b/lib/stripe/api_requestor.rb index c13c4a83f..43ea47446 100644 --- a/lib/stripe/api_requestor.rb +++ b/lib/stripe/api_requestor.rb @@ -875,6 +875,8 @@ def self.maybe_gc_connection_managers FinancialAccountNotOpenError.new(error_data[:message], **opts) when "fx_quote_expired" FxQuoteExpiredError.new(error_data[:message], **opts) + when "fx_quote_needs_refresh" + FxQuoteNeedsRefreshError.new(error_data[:message], **opts) when "insufficient_funds" InsufficientFundsError.new(error_data[:message], **opts) when "invalid_payment_method" diff --git a/lib/stripe/api_version.rb b/lib/stripe/api_version.rb index 72f39626e..009706744 100644 --- a/lib/stripe/api_version.rb +++ b/lib/stripe/api_version.rb @@ -3,7 +3,7 @@ module Stripe module ApiVersion - CURRENT = "2026-07-29.preview" + CURRENT = "2026-08-12.preview" CURRENT_MAJOR = "" end end diff --git a/lib/stripe/errors.rb b/lib/stripe/errors.rb index 538dd6cfb..8f1d7c8bf 100644 --- a/lib/stripe/errors.rb +++ b/lib/stripe/errors.rb @@ -210,6 +210,9 @@ class FinancialAccountNotOpenError < StripeError class FxQuoteExpiredError < StripeError end + class FxQuoteNeedsRefreshError < StripeError + end + class InsufficientFundsError < StripeError end diff --git a/lib/stripe/event_types.rb b/lib/stripe/event_types.rb index e0f295822..5f39c7a57 100644 --- a/lib/stripe/event_types.rb +++ b/lib/stripe/event_types.rb @@ -23,10 +23,19 @@ def self.v2_event_types_to_classes Events::V1ApplicationFeeRefundUpdatedEvent, Events::V1ApplicationFeeRefundedEvent.lookup_type => Events::V1ApplicationFeeRefundedEvent, Events::V1BalanceAvailableEvent.lookup_type => Events::V1BalanceAvailableEvent, + Events::V1BalanceSettingsUpdatedEvent.lookup_type => Events::V1BalanceSettingsUpdatedEvent, Events::V1BillingAlertTriggeredEvent.lookup_type => Events::V1BillingAlertTriggeredEvent, + Events::V1BillingCreditBalanceTransactionCreatedEvent.lookup_type => + Events::V1BillingCreditBalanceTransactionCreatedEvent, + Events::V1BillingCreditGrantCreatedEvent.lookup_type => Events::V1BillingCreditGrantCreatedEvent, + Events::V1BillingCreditGrantUpdatedEvent.lookup_type => Events::V1BillingCreditGrantUpdatedEvent, + Events::V1BillingMeterCreatedEvent.lookup_type => Events::V1BillingMeterCreatedEvent, + Events::V1BillingMeterDeactivatedEvent.lookup_type => Events::V1BillingMeterDeactivatedEvent, Events::V1BillingMeterErrorReportTriggeredEvent.lookup_type => Events::V1BillingMeterErrorReportTriggeredEvent, Events::V1BillingMeterNoMeterFoundEvent.lookup_type => Events::V1BillingMeterNoMeterFoundEvent, + Events::V1BillingMeterReactivatedEvent.lookup_type => Events::V1BillingMeterReactivatedEvent, + Events::V1BillingMeterUpdatedEvent.lookup_type => Events::V1BillingMeterUpdatedEvent, Events::V1BillingPortalConfigurationCreatedEvent.lookup_type => Events::V1BillingPortalConfigurationCreatedEvent, Events::V1BillingPortalConfigurationUpdatedEvent.lookup_type => @@ -97,12 +106,16 @@ def self.v2_event_types_to_classes Events::V1EntitlementsActiveEntitlementSummaryUpdatedEvent.lookup_type => Events::V1EntitlementsActiveEntitlementSummaryUpdatedEvent, Events::V1FileCreatedEvent.lookup_type => Events::V1FileCreatedEvent, + Events::V1FinancialConnectionsAccountAccountNumbersUpdatedEvent.lookup_type => + Events::V1FinancialConnectionsAccountAccountNumbersUpdatedEvent, Events::V1FinancialConnectionsAccountCreatedEvent.lookup_type => Events::V1FinancialConnectionsAccountCreatedEvent, Events::V1FinancialConnectionsAccountDeactivatedEvent.lookup_type => Events::V1FinancialConnectionsAccountDeactivatedEvent, Events::V1FinancialConnectionsAccountDisconnectedEvent.lookup_type => Events::V1FinancialConnectionsAccountDisconnectedEvent, + Events::V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEvent.lookup_type => + Events::V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEvent, Events::V1FinancialConnectionsAccountReactivatedEvent.lookup_type => Events::V1FinancialConnectionsAccountReactivatedEvent, Events::V1FinancialConnectionsAccountRefreshedBalanceEvent.lookup_type => @@ -111,6 +124,12 @@ def self.v2_event_types_to_classes Events::V1FinancialConnectionsAccountRefreshedOwnershipEvent, Events::V1FinancialConnectionsAccountRefreshedTransactionsEvent.lookup_type => Events::V1FinancialConnectionsAccountRefreshedTransactionsEvent, + Events::V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEvent.lookup_type => + Events::V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEvent, + Events::V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEvent.lookup_type => + Events::V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEvent, + Events::V1FinancialConnectionsAccountUpcomingDeactivationEvent.lookup_type => + Events::V1FinancialConnectionsAccountUpcomingDeactivationEvent, Events::V1IdentityVerificationSessionCanceledEvent.lookup_type => Events::V1IdentityVerificationSessionCanceledEvent, Events::V1IdentityVerificationSessionCreatedEvent.lookup_type => @@ -133,6 +152,8 @@ def self.v2_event_types_to_classes Events::V1InvoicePaidEvent.lookup_type => Events::V1InvoicePaidEvent, Events::V1InvoicePaymentActionRequiredEvent.lookup_type => Events::V1InvoicePaymentActionRequiredEvent, + Events::V1InvoicePaymentAttemptRequiredEvent.lookup_type => + Events::V1InvoicePaymentAttemptRequiredEvent, Events::V1InvoicePaymentFailedEvent.lookup_type => Events::V1InvoicePaymentFailedEvent, Events::V1InvoicePaymentPaidEvent.lookup_type => Events::V1InvoicePaymentPaidEvent, Events::V1InvoicePaymentSucceededEvent.lookup_type => Events::V1InvoicePaymentSucceededEvent, @@ -703,12 +724,28 @@ def self.event_notification_types_to_classes Events::V1ApplicationFeeRefundedEventNotification, Events::V1BalanceAvailableEventNotification.lookup_type => Events::V1BalanceAvailableEventNotification, + Events::V1BalanceSettingsUpdatedEventNotification.lookup_type => + Events::V1BalanceSettingsUpdatedEventNotification, Events::V1BillingAlertTriggeredEventNotification.lookup_type => Events::V1BillingAlertTriggeredEventNotification, + Events::V1BillingCreditBalanceTransactionCreatedEventNotification.lookup_type => + Events::V1BillingCreditBalanceTransactionCreatedEventNotification, + Events::V1BillingCreditGrantCreatedEventNotification.lookup_type => + Events::V1BillingCreditGrantCreatedEventNotification, + Events::V1BillingCreditGrantUpdatedEventNotification.lookup_type => + Events::V1BillingCreditGrantUpdatedEventNotification, + Events::V1BillingMeterCreatedEventNotification.lookup_type => + Events::V1BillingMeterCreatedEventNotification, + Events::V1BillingMeterDeactivatedEventNotification.lookup_type => + Events::V1BillingMeterDeactivatedEventNotification, Events::V1BillingMeterErrorReportTriggeredEventNotification.lookup_type => Events::V1BillingMeterErrorReportTriggeredEventNotification, Events::V1BillingMeterNoMeterFoundEventNotification.lookup_type => Events::V1BillingMeterNoMeterFoundEventNotification, + Events::V1BillingMeterReactivatedEventNotification.lookup_type => + Events::V1BillingMeterReactivatedEventNotification, + Events::V1BillingMeterUpdatedEventNotification.lookup_type => + Events::V1BillingMeterUpdatedEventNotification, Events::V1BillingPortalConfigurationCreatedEventNotification.lookup_type => Events::V1BillingPortalConfigurationCreatedEventNotification, Events::V1BillingPortalConfigurationUpdatedEventNotification.lookup_type => @@ -803,12 +840,16 @@ def self.event_notification_types_to_classes Events::V1EntitlementsActiveEntitlementSummaryUpdatedEventNotification.lookup_type => Events::V1EntitlementsActiveEntitlementSummaryUpdatedEventNotification, Events::V1FileCreatedEventNotification.lookup_type => Events::V1FileCreatedEventNotification, + Events::V1FinancialConnectionsAccountAccountNumbersUpdatedEventNotification.lookup_type => + Events::V1FinancialConnectionsAccountAccountNumbersUpdatedEventNotification, Events::V1FinancialConnectionsAccountCreatedEventNotification.lookup_type => Events::V1FinancialConnectionsAccountCreatedEventNotification, Events::V1FinancialConnectionsAccountDeactivatedEventNotification.lookup_type => Events::V1FinancialConnectionsAccountDeactivatedEventNotification, Events::V1FinancialConnectionsAccountDisconnectedEventNotification.lookup_type => Events::V1FinancialConnectionsAccountDisconnectedEventNotification, + Events::V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEventNotification.lookup_type => + Events::V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEventNotification, Events::V1FinancialConnectionsAccountReactivatedEventNotification.lookup_type => Events::V1FinancialConnectionsAccountReactivatedEventNotification, Events::V1FinancialConnectionsAccountRefreshedBalanceEventNotification.lookup_type => @@ -817,6 +858,12 @@ def self.event_notification_types_to_classes Events::V1FinancialConnectionsAccountRefreshedOwnershipEventNotification, Events::V1FinancialConnectionsAccountRefreshedTransactionsEventNotification.lookup_type => Events::V1FinancialConnectionsAccountRefreshedTransactionsEventNotification, + Events::V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEventNotification.lookup_type => + Events::V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEventNotification, + Events::V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEventNotification.lookup_type => + Events::V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEventNotification, + Events::V1FinancialConnectionsAccountUpcomingDeactivationEventNotification.lookup_type => + Events::V1FinancialConnectionsAccountUpcomingDeactivationEventNotification, Events::V1IdentityVerificationSessionCanceledEventNotification.lookup_type => Events::V1IdentityVerificationSessionCanceledEventNotification, Events::V1IdentityVerificationSessionCreatedEventNotification.lookup_type => @@ -843,6 +890,8 @@ def self.event_notification_types_to_classes Events::V1InvoicePaidEventNotification.lookup_type => Events::V1InvoicePaidEventNotification, Events::V1InvoicePaymentActionRequiredEventNotification.lookup_type => Events::V1InvoicePaymentActionRequiredEventNotification, + Events::V1InvoicePaymentAttemptRequiredEventNotification.lookup_type => + Events::V1InvoicePaymentAttemptRequiredEventNotification, Events::V1InvoicePaymentFailedEventNotification.lookup_type => Events::V1InvoicePaymentFailedEventNotification, Events::V1InvoicePaymentPaidEventNotification.lookup_type => diff --git a/lib/stripe/events/v1_balance_settings_updated_event.rb b/lib/stripe/events/v1_balance_settings_updated_event.rb new file mode 100644 index 000000000..3b8aa708d --- /dev/null +++ b/lib/stripe/events/v1_balance_settings_updated_event.rb @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs whenever a balance settings status or property has changed. + class V1BalanceSettingsUpdatedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v1.balance_settings.updated" + 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, "Stripe-Request-Trigger": "event=#{id}" } + ) + end + attr_reader :related_object + end + + # Occurs whenever a balance settings status or property has changed. + class V1BalanceSettingsUpdatedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v1.balance_settings.updated" + end + + attr_reader :related_object + + # Retrieves the BalanceSettings 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, "Stripe-Request-Trigger": "event=#{id}" }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v1_billing_credit_balance_transaction_created_event.rb b/lib/stripe/events/v1_billing_credit_balance_transaction_created_event.rb new file mode 100644 index 000000000..7479ba561 --- /dev/null +++ b/lib/stripe/events/v1_billing_credit_balance_transaction_created_event.rb @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when a credit balance transaction is created. + class V1BillingCreditBalanceTransactionCreatedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v1.billing.credit_balance_transaction.created" + 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, "Stripe-Request-Trigger": "event=#{id}" } + ) + end + attr_reader :related_object + end + + # Occurs when a credit balance transaction is created. + class V1BillingCreditBalanceTransactionCreatedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v1.billing.credit_balance_transaction.created" + end + + attr_reader :related_object + + # Retrieves the CreditBalanceTransaction 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, "Stripe-Request-Trigger": "event=#{id}" }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v1_billing_credit_grant_created_event.rb b/lib/stripe/events/v1_billing_credit_grant_created_event.rb new file mode 100644 index 000000000..3afb06c06 --- /dev/null +++ b/lib/stripe/events/v1_billing_credit_grant_created_event.rb @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when a credit grant is created. + class V1BillingCreditGrantCreatedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v1.billing.credit_grant.created" + 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, "Stripe-Request-Trigger": "event=#{id}" } + ) + end + attr_reader :related_object + end + + # Occurs when a credit grant is created. + class V1BillingCreditGrantCreatedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v1.billing.credit_grant.created" + end + + attr_reader :related_object + + # Retrieves the CreditGrant 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, "Stripe-Request-Trigger": "event=#{id}" }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v1_billing_credit_grant_updated_event.rb b/lib/stripe/events/v1_billing_credit_grant_updated_event.rb new file mode 100644 index 000000000..50fa65d39 --- /dev/null +++ b/lib/stripe/events/v1_billing_credit_grant_updated_event.rb @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when a credit grant is updated. + class V1BillingCreditGrantUpdatedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v1.billing.credit_grant.updated" + 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, "Stripe-Request-Trigger": "event=#{id}" } + ) + end + attr_reader :related_object + end + + # Occurs when a credit grant is updated. + class V1BillingCreditGrantUpdatedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v1.billing.credit_grant.updated" + end + + attr_reader :related_object + + # Retrieves the CreditGrant 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, "Stripe-Request-Trigger": "event=#{id}" }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v1_billing_meter_created_event.rb b/lib/stripe/events/v1_billing_meter_created_event.rb new file mode 100644 index 000000000..1dde3a548 --- /dev/null +++ b/lib/stripe/events/v1_billing_meter_created_event.rb @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when a meter is created. + class V1BillingMeterCreatedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v1.billing.meter.created" + 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, "Stripe-Request-Trigger": "event=#{id}" } + ) + end + attr_reader :related_object + end + + # Occurs when a meter is created. + class V1BillingMeterCreatedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v1.billing.meter.created" + end + + attr_reader :related_object + + # Retrieves the Meter 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, "Stripe-Request-Trigger": "event=#{id}" }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v1_billing_meter_deactivated_event.rb b/lib/stripe/events/v1_billing_meter_deactivated_event.rb new file mode 100644 index 000000000..827e20c2f --- /dev/null +++ b/lib/stripe/events/v1_billing_meter_deactivated_event.rb @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when a meter is deactivated. + class V1BillingMeterDeactivatedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v1.billing.meter.deactivated" + 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, "Stripe-Request-Trigger": "event=#{id}" } + ) + end + attr_reader :related_object + end + + # Occurs when a meter is deactivated. + class V1BillingMeterDeactivatedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v1.billing.meter.deactivated" + end + + attr_reader :related_object + + # Retrieves the Meter 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, "Stripe-Request-Trigger": "event=#{id}" }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v1_billing_meter_reactivated_event.rb b/lib/stripe/events/v1_billing_meter_reactivated_event.rb new file mode 100644 index 000000000..4064c27af --- /dev/null +++ b/lib/stripe/events/v1_billing_meter_reactivated_event.rb @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when a meter is reactivated. + class V1BillingMeterReactivatedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v1.billing.meter.reactivated" + 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, "Stripe-Request-Trigger": "event=#{id}" } + ) + end + attr_reader :related_object + end + + # Occurs when a meter is reactivated. + class V1BillingMeterReactivatedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v1.billing.meter.reactivated" + end + + attr_reader :related_object + + # Retrieves the Meter 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, "Stripe-Request-Trigger": "event=#{id}" }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v1_billing_meter_updated_event.rb b/lib/stripe/events/v1_billing_meter_updated_event.rb new file mode 100644 index 000000000..a5970774b --- /dev/null +++ b/lib/stripe/events/v1_billing_meter_updated_event.rb @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when a meter is updated. + class V1BillingMeterUpdatedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v1.billing.meter.updated" + 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, "Stripe-Request-Trigger": "event=#{id}" } + ) + end + attr_reader :related_object + end + + # Occurs when a meter is updated. + class V1BillingMeterUpdatedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v1.billing.meter.updated" + end + + attr_reader :related_object + + # Retrieves the Meter 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, "Stripe-Request-Trigger": "event=#{id}" }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v1_customer_subscription_trial_will_end_event.rb b/lib/stripe/events/v1_customer_subscription_trial_will_end_event.rb index 5e332181a..b62e86206 100644 --- a/lib/stripe/events/v1_customer_subscription_trial_will_end_event.rb +++ b/lib/stripe/events/v1_customer_subscription_trial_will_end_event.rb @@ -3,7 +3,7 @@ module Stripe module Events - # Occurs three days before a subscription's trial period is scheduled to end, or when a trial is ended immediately (using `trial_end=now`). + # Occurs three days before a subscription's trial period is scheduled to end, or immediately when a trial is ended early (for example, with `trial_end=now` or when a Customer Portal plan change ends a trial). If a trial is shortened so that fewer than three days remain, this event can fire immediately, including during the same transaction that collects payment. Before sending payment-reminder communications from this webhook, check the subscription status and latest invoice to determine whether payment has already been collected. class V1CustomerSubscriptionTrialWillEndEvent < Stripe::V2::Core::Event def self.lookup_type "v1.customer.subscription.trial_will_end" @@ -21,7 +21,7 @@ def fetch_related_object attr_reader :related_object end - # Occurs three days before a subscription's trial period is scheduled to end, or when a trial is ended immediately (using `trial_end=now`). + # Occurs three days before a subscription's trial period is scheduled to end, or immediately when a trial is ended early (for example, with `trial_end=now` or when a Customer Portal plan change ends a trial). If a trial is shortened so that fewer than three days remain, this event can fire immediately, including during the same transaction that collects payment. Before sending payment-reminder communications from this webhook, check the subscription status and latest invoice to determine whether payment has already been collected. class V1CustomerSubscriptionTrialWillEndEventNotification < Stripe::V2::Core::EventNotification def self.lookup_type "v1.customer.subscription.trial_will_end" diff --git a/lib/stripe/events/v1_financial_connections_account_account_numbers_updated_event.rb b/lib/stripe/events/v1_financial_connections_account_account_numbers_updated_event.rb new file mode 100644 index 000000000..2c340a74d --- /dev/null +++ b/lib/stripe/events/v1_financial_connections_account_account_numbers_updated_event.rb @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when a Financial Connections account's account numbers are updated. + class V1FinancialConnectionsAccountAccountNumbersUpdatedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v1.financial_connections.account.account_numbers_updated" + 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, "Stripe-Request-Trigger": "event=#{id}" } + ) + end + attr_reader :related_object + end + + # Occurs when a Financial Connections account's account numbers are updated. + class V1FinancialConnectionsAccountAccountNumbersUpdatedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v1.financial_connections.account.account_numbers_updated" + end + + attr_reader :related_object + + # Retrieves the Account 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, "Stripe-Request-Trigger": "event=#{id}" }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v1_financial_connections_account_expected_deactivation_date_updated_event.rb b/lib/stripe/events/v1_financial_connections_account_expected_deactivation_date_updated_event.rb new file mode 100644 index 000000000..930e6cce3 --- /dev/null +++ b/lib/stripe/events/v1_financial_connections_account_expected_deactivation_date_updated_event.rb @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when a Financial Connections account's `expected_deactivation_date` changes. + class V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v1.financial_connections.account.expected_deactivation_date_updated" + 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, "Stripe-Request-Trigger": "event=#{id}" } + ) + end + attr_reader :related_object + end + + # Occurs when a Financial Connections account's `expected_deactivation_date` changes. + class V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v1.financial_connections.account.expected_deactivation_date_updated" + end + + attr_reader :related_object + + # Retrieves the Account 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, "Stripe-Request-Trigger": "event=#{id}" }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v1_financial_connections_account_supported_payment_method_types_updated_event.rb b/lib/stripe/events/v1_financial_connections_account_supported_payment_method_types_updated_event.rb new file mode 100644 index 000000000..8e465c8ca --- /dev/null +++ b/lib/stripe/events/v1_financial_connections_account_supported_payment_method_types_updated_event.rb @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when the supported_payment_method_types array on a Financial Connections account changes. + class V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEvent < Stripe::V2::Core::Event + def self.lookup_type + "v1.financial_connections.account.supported_payment_method_types_updated" + 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, "Stripe-Request-Trigger": "event=#{id}" } + ) + end + attr_reader :related_object + end + + # Occurs when the supported_payment_method_types array on a Financial Connections account changes. + class V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v1.financial_connections.account.supported_payment_method_types_updated" + end + + attr_reader :related_object + + # Retrieves the Account 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, "Stripe-Request-Trigger": "event=#{id}" }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v1_financial_connections_account_upcoming_account_number_expiry_event.rb b/lib/stripe/events/v1_financial_connections_account_upcoming_account_number_expiry_event.rb new file mode 100644 index 000000000..0cb72d7dc --- /dev/null +++ b/lib/stripe/events/v1_financial_connections_account_upcoming_account_number_expiry_event.rb @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when an Account's tokenized account number is about to expire. + class V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEvent < Stripe::V2::Core::Event + def self.lookup_type + "v1.financial_connections.account.upcoming_account_number_expiry" + 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, "Stripe-Request-Trigger": "event=#{id}" } + ) + end + attr_reader :related_object + end + + # Occurs when an Account's tokenized account number is about to expire. + class V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v1.financial_connections.account.upcoming_account_number_expiry" + end + + attr_reader :related_object + + # Retrieves the Account 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, "Stripe-Request-Trigger": "event=#{id}" }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v1_financial_connections_account_upcoming_deactivation_event.rb b/lib/stripe/events/v1_financial_connections_account_upcoming_deactivation_event.rb new file mode 100644 index 000000000..3a17f73e5 --- /dev/null +++ b/lib/stripe/events/v1_financial_connections_account_upcoming_deactivation_event.rb @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when a Financial Connections account is about to become `inactive`. + class V1FinancialConnectionsAccountUpcomingDeactivationEvent < Stripe::V2::Core::Event + def self.lookup_type + "v1.financial_connections.account.upcoming_deactivation" + 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, "Stripe-Request-Trigger": "event=#{id}" } + ) + end + attr_reader :related_object + end + + # Occurs when a Financial Connections account is about to become `inactive`. + class V1FinancialConnectionsAccountUpcomingDeactivationEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v1.financial_connections.account.upcoming_deactivation" + end + + attr_reader :related_object + + # Retrieves the Account 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, "Stripe-Request-Trigger": "event=#{id}" }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v1_invoice_payment_attempt_required_event.rb b/lib/stripe/events/v1_invoice_payment_attempt_required_event.rb new file mode 100644 index 000000000..be9b34acd --- /dev/null +++ b/lib/stripe/events/v1_invoice_payment_attempt_required_event.rb @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Events + # Occurs when an invoice requires a payment using a payment method that cannot be processed by Stripe. + class V1InvoicePaymentAttemptRequiredEvent < Stripe::V2::Core::Event + def self.lookup_type + "v1.invoice.payment_attempt_required" + 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, "Stripe-Request-Trigger": "event=#{id}" } + ) + end + attr_reader :related_object + end + + # Occurs when an invoice requires a payment using a payment method that cannot be processed by Stripe. + class V1InvoicePaymentAttemptRequiredEventNotification < Stripe::V2::Core::EventNotification + def self.lookup_type + "v1.invoice.payment_attempt_required" + end + + attr_reader :related_object + + # Retrieves the Invoice 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, "Stripe-Request-Trigger": "event=#{id}" }, + usage: ["fetch_related_object"] + ) + @client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url)) + end + end + end +end diff --git a/lib/stripe/events/v2_core_health_authorization_rate_drop_firing_event.rb b/lib/stripe/events/v2_core_health_authorization_rate_drop_firing_event.rb index 5720af1b7..972bf7b2b 100644 --- a/lib/stripe/events/v2_core_health_authorization_rate_drop_firing_event.rb +++ b/lib/stripe/events/v2_core_health_authorization_rate_drop_firing_event.rb @@ -12,6 +12,8 @@ def self.lookup_type class V2CoreHealthAuthorizationRateDropFiringEventData < ::Stripe::StripeObject class Impact < ::Stripe::StripeObject class Dimension < ::Stripe::StripeObject + # The acquirer dimension. + attr_reader :acquirer # The issuer dimension. attr_reader :issuer # The type of the dimension. diff --git a/lib/stripe/events/v2_core_health_authorization_rate_drop_resolved_event.rb b/lib/stripe/events/v2_core_health_authorization_rate_drop_resolved_event.rb index 57f7b3a23..ccb74f4ff 100644 --- a/lib/stripe/events/v2_core_health_authorization_rate_drop_resolved_event.rb +++ b/lib/stripe/events/v2_core_health_authorization_rate_drop_resolved_event.rb @@ -12,6 +12,8 @@ def self.lookup_type class V2CoreHealthAuthorizationRateDropResolvedEventData < ::Stripe::StripeObject class Impact < ::Stripe::StripeObject class Dimension < ::Stripe::StripeObject + # The acquirer dimension. + attr_reader :acquirer # The issuer dimension. attr_reader :issuer # The type of the dimension. diff --git a/lib/stripe/list_object.rb b/lib/stripe/list_object.rb index 7d0e01ff9..4e207bacc 100644 --- a/lib/stripe/list_object.rb +++ b/lib/stripe/list_object.rb @@ -85,6 +85,10 @@ def auto_paging_each(&blk) end break if page.empty? + rescue LocalJumpError => e + raise unless e.reason == :break + + break end end diff --git a/lib/stripe/object_types.rb b/lib/stripe/object_types.rb index c2e82f04f..298e7dccb 100644 --- a/lib/stripe/object_types.rb +++ b/lib/stripe/object_types.rb @@ -323,6 +323,7 @@ def self.v2_object_names_to_classes V2::Signals::AccountEvaluation.object_name => V2::Signals::AccountEvaluation, V2::Signals::AccountSignal.object_name => V2::Signals::AccountSignal, V2::Tax::ManualRule.object_name => V2::Tax::ManualRule, + V2::Tax::OperationsResolveAddressResult.object_name => V2::Tax::OperationsResolveAddressResult, # v2 object classes: The end of the section generated from our OpenAPI spec } end diff --git a/lib/stripe/params.rb b/lib/stripe/params.rb index e82112be6..497c2bc13 100644 --- a/lib/stripe/params.rb +++ b/lib/stripe/params.rb @@ -1203,7 +1203,9 @@ module MoneyManagement autoload :OutboundTransferListParams, "stripe/params/v2/money_management/outbound_transfer_list_params" autoload :OutboundTransferRetrieveParams, "stripe/params/v2/money_management/outbound_transfer_retrieve_params" autoload :PayoutIntentCancelParams, "stripe/params/v2/money_management/payout_intent_cancel_params" + autoload :PayoutIntentConfirmParams, "stripe/params/v2/money_management/payout_intent_confirm_params" autoload :PayoutIntentCreateParams, "stripe/params/v2/money_management/payout_intent_create_params" + autoload :PayoutIntentFxQuoteParams, "stripe/params/v2/money_management/payout_intent_fx_quote_params" autoload :PayoutIntentListParams, "stripe/params/v2/money_management/payout_intent_list_params" autoload :PayoutIntentRetrieveParams, "stripe/params/v2/money_management/payout_intent_retrieve_params" autoload :PayoutIntentUpdateParams, "stripe/params/v2/money_management/payout_intent_update_params" @@ -1315,6 +1317,7 @@ module Tax autoload :ManualRuleListParams, "stripe/params/v2/tax/manual_rule_list_params" autoload :ManualRuleRetrieveParams, "stripe/params/v2/tax/manual_rule_retrieve_params" autoload :ManualRuleUpdateParams, "stripe/params/v2/tax/manual_rule_update_params" + autoload :OperationResolveAddressParams, "stripe/params/v2/tax/operation_resolve_address_params" end module TestHelpers @@ -2310,7 +2313,9 @@ module Stripe stripe/params/v2/money_management/outbound_transfer_list_params stripe/params/v2/money_management/outbound_transfer_retrieve_params stripe/params/v2/money_management/payout_intent_cancel_params + stripe/params/v2/money_management/payout_intent_confirm_params stripe/params/v2/money_management/payout_intent_create_params + stripe/params/v2/money_management/payout_intent_fx_quote_params stripe/params/v2/money_management/payout_intent_list_params stripe/params/v2/money_management/payout_intent_retrieve_params stripe/params/v2/money_management/payout_intent_update_params @@ -2376,6 +2381,7 @@ module Stripe stripe/params/v2/tax/manual_rule_list_params stripe/params/v2/tax/manual_rule_retrieve_params stripe/params/v2/tax/manual_rule_update_params + stripe/params/v2/tax/operation_resolve_address_params stripe/params/v2/test_helpers/financial_address_credit_params stripe/params/v2/test_helpers/financial_address_generate_microdeposits_params stripe/params/v2/test_helpers/money_management_recipient_verifications_params diff --git a/lib/stripe/params/customer_balance_transaction_create_params.rb b/lib/stripe/params/customer_balance_transaction_create_params.rb index 7aa8dbf22..a8e3bbfc3 100644 --- a/lib/stripe/params/customer_balance_transaction_create_params.rb +++ b/lib/stripe/params/customer_balance_transaction_create_params.rb @@ -3,8 +3,18 @@ module Stripe class CustomerBalanceTransactionCreateParams < ::Stripe::RequestParams + class AppliedToInvoice < ::Stripe::RequestParams + # The ID of the open invoice to apply the customer's balance credit to. + attr_accessor :invoice + + def initialize(invoice: nil) + @invoice = invoice + end + end # The integer amount in **cents (or local equivalent)** to apply to the customer's credit balance. attr_accessor :amount + # Required when `type` is `applied_to_invoice`. Identifies the open invoice to apply the customer's balance credit to. + attr_accessor :applied_to_invoice # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Specifies the [`invoice_credit_balance`](https://docs.stripe.com/api/customers/object#customer_object-invoice_credit_balance) that this transaction will apply to. If the customer's `currency` is not set, it will be updated to this value. attr_accessor :currency # An arbitrary string attached to the object. Often useful for displaying to users. @@ -13,13 +23,25 @@ class CustomerBalanceTransactionCreateParams < ::Stripe::RequestParams attr_accessor :expand # Set of [key-value pairs](https://docs.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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. attr_accessor :metadata + # The type of customer balance transaction. Defaults to `adjustment`, which updates the customer's credit balance directly. Set to `applied_to_invoice` to apply the customer's existing credit balance to a specific open invoice. + attr_accessor :type - def initialize(amount: nil, currency: nil, description: nil, expand: nil, metadata: nil) + def initialize( + amount: nil, + applied_to_invoice: nil, + currency: nil, + description: nil, + expand: nil, + metadata: nil, + type: nil + ) @amount = amount + @applied_to_invoice = applied_to_invoice @currency = currency @description = description @expand = expand @metadata = metadata + @type = type end end end diff --git a/lib/stripe/params/issuing/cardholder_create_params.rb b/lib/stripe/params/issuing/cardholder_create_params.rb index 965017188..5d11dd8ef 100644 --- a/lib/stripe/params/issuing/cardholder_create_params.rb +++ b/lib/stripe/params/issuing/cardholder_create_params.rb @@ -205,7 +205,7 @@ def initialize( # The cardholder's phone number. This will be transformed to [E.164](https://en.wikipedia.org/wiki/E.164) if it is not provided in that format already. This is required for all cardholders who will be creating EU cards. # While phone number is optional if the cardholder will not be creating EU cards, note that this cardholder will not be eligible for 3DS without a phone number. See the [3D Secure documentation](https://docs.stripe.com/issuing/3d-secure#when-is-3d-secure-applied) for more details. attr_accessor :phone_number - # The cardholder’s preferred locales (languages), ordered by preference. Locales can be `da`, `de`, `en`, `es`, `fr`, `it`, `pl`, or `sv`. + # The cardholder’s preferred locales (languages), ordered by preference. Locales can be `de`, `en`, `es`, `fr`, or `it`. # This changes the language of the [3D Secure flow](https://docs.stripe.com/issuing/3d-secure) and one-time password messages sent to the cardholder. attr_accessor :preferred_locales # Rules that control spending across this cardholder's cards. Refer to our [documentation](https://docs.stripe.com/issuing/controls/spending-controls) for more details. diff --git a/lib/stripe/params/issuing/cardholder_update_params.rb b/lib/stripe/params/issuing/cardholder_update_params.rb index e15bd6b3d..a92081343 100644 --- a/lib/stripe/params/issuing/cardholder_update_params.rb +++ b/lib/stripe/params/issuing/cardholder_update_params.rb @@ -204,7 +204,7 @@ def initialize( attr_accessor :name # The cardholder's phone number. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://docs.stripe.com/issuing/3d-secure) for more details. attr_accessor :phone_number - # The cardholder’s preferred locales (languages), ordered by preference. Locales can be `da`, `de`, `en`, `es`, `fr`, `it`, `pl`, or `sv`. + # The cardholder’s preferred locales (languages), ordered by preference. Locales can be `de`, `en`, `es`, `fr`, or `it`. # This changes the language of the [3D Secure flow](https://docs.stripe.com/issuing/3d-secure) and one-time password messages sent to the cardholder. attr_accessor :preferred_locales # Rules that control spending across this cardholder's cards. Refer to our [documentation](https://docs.stripe.com/issuing/controls/spending-controls) for more details. diff --git a/lib/stripe/params/payment_attempt_record_report_failed_params.rb b/lib/stripe/params/payment_attempt_record_report_failed_params.rb index 021d2dee3..f8ec99a6e 100644 --- a/lib/stripe/params/payment_attempt_record_report_failed_params.rb +++ b/lib/stripe/params/payment_attempt_record_report_failed_params.rb @@ -21,9 +21,12 @@ def initialize(address_line1_check: nil, address_postal_code_check: nil, cvc_che end # Verification checks performed on the card. attr_accessor :checks + # Decline code from the card network for the failed payment. + attr_accessor :network_decline_code - def initialize(checks: nil) + def initialize(checks: nil, network_decline_code: nil) @checks = checks + @network_decline_code = network_decline_code end end # Information about the card payment method used to make this payment. @@ -60,7 +63,7 @@ def initialize(custom: nil, type: nil) attr_accessor :expand # When the reported payment failed. Measured in seconds since the Unix epoch. attr_accessor :failed_at - # The failure code for this payment attempt. Must be one of `payment_method_customer_decline` or `payment_method_provider_unknown_outcome`. + # The failure code for this payment attempt. Must be one of `payment_method_customer_decline`, `payment_method_provider_unknown_outcome`, `authentication_failure`, `expired_payment_method`, `incorrect_cvc`, `incorrect_number`, `incorrect_postal_code`, `insufficient_funds`, `processing_error`, or `payment_method_restricted`. attr_accessor :failure_code # Set of [key-value pairs](https://docs.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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. attr_accessor :metadata diff --git a/lib/stripe/params/payment_record_report_payment_attempt_failed_params.rb b/lib/stripe/params/payment_record_report_payment_attempt_failed_params.rb index a42ed5c1c..5fa5e29af 100644 --- a/lib/stripe/params/payment_record_report_payment_attempt_failed_params.rb +++ b/lib/stripe/params/payment_record_report_payment_attempt_failed_params.rb @@ -21,9 +21,12 @@ def initialize(address_line1_check: nil, address_postal_code_check: nil, cvc_che end # Verification checks performed on the card. attr_accessor :checks + # Decline code from the card network for the failed payment. + attr_accessor :network_decline_code - def initialize(checks: nil) + def initialize(checks: nil, network_decline_code: nil) @checks = checks + @network_decline_code = network_decline_code end end # Information about the card payment method used to make this payment. @@ -60,7 +63,7 @@ def initialize(custom: nil, type: nil) attr_accessor :expand # When the reported payment failed. Measured in seconds since the Unix epoch. attr_accessor :failed_at - # The failure code for this payment attempt. Must be one of `payment_method_customer_decline` or `payment_method_provider_unknown_outcome`. + # The failure code for this payment attempt. Must be one of `payment_method_customer_decline`, `payment_method_provider_unknown_outcome`, `authentication_failure`, `expired_payment_method`, `incorrect_cvc`, `incorrect_number`, `incorrect_postal_code`, `insufficient_funds`, `processing_error`, or `payment_method_restricted`. attr_accessor :failure_code # Set of [key-value pairs](https://docs.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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. attr_accessor :metadata diff --git a/lib/stripe/params/payment_record_report_payment_attempt_params.rb b/lib/stripe/params/payment_record_report_payment_attempt_params.rb index 85070a120..ade271901 100644 --- a/lib/stripe/params/payment_record_report_payment_attempt_params.rb +++ b/lib/stripe/params/payment_record_report_payment_attempt_params.rb @@ -25,7 +25,7 @@ def initialize(custom: nil, type: nil) end # When the reported payment failed. Measured in seconds since the Unix epoch. attr_accessor :failed_at - # The failure code for this payment attempt. Must be one of `payment_method_customer_decline` or `payment_method_provider_unknown_outcome`. + # The failure code for this payment attempt. Must be one of `payment_method_customer_decline`, `payment_method_provider_unknown_outcome`, `authentication_failure`, `expired_payment_method`, `incorrect_cvc`, `incorrect_number`, `incorrect_postal_code`, `insufficient_funds`, `processing_error`, or `payment_method_restricted`. attr_accessor :failure_code # Payment evaluations associated with this reported payment. attr_accessor :payment_evaluations diff --git a/lib/stripe/params/payment_record_report_payment_params.rb b/lib/stripe/params/payment_record_report_payment_params.rb index 8a694ba2e..ca592a8ef 100644 --- a/lib/stripe/params/payment_record_report_payment_params.rb +++ b/lib/stripe/params/payment_record_report_payment_params.rb @@ -55,7 +55,7 @@ def initialize(custom: nil, type: nil) end # When the reported payment failed. Measured in seconds since the Unix epoch. attr_accessor :failed_at - # The failure code for this payment attempt. Must be one of `payment_method_customer_decline` or `payment_method_provider_unknown_outcome`. + # The failure code for this payment attempt. Must be one of `payment_method_customer_decline`, `payment_method_provider_unknown_outcome`, `authentication_failure`, `expired_payment_method`, `incorrect_cvc`, `incorrect_number`, `incorrect_postal_code`, `insufficient_funds`, `processing_error`, or `payment_method_restricted`. attr_accessor :failure_code # Payment evaluations associated with this reported payment. attr_accessor :payment_evaluations diff --git a/lib/stripe/params/subscription_schedule_create_params.rb b/lib/stripe/params/subscription_schedule_create_params.rb index eeb681bde..03f20784e 100644 --- a/lib/stripe/params/subscription_schedule_create_params.rb +++ b/lib/stripe/params/subscription_schedule_create_params.rb @@ -323,7 +323,7 @@ def initialize(duration: nil, timestamp: nil, type: nil) class Settings < ::Stripe::RequestParams # Controls the billing cycle anchor when the subscription resumes. attr_accessor :billing_cycle_anchor - # Controls whether Stripe attempts payment on the resumption invoice and how payment affects the subscription's status. The default is `resume_on_payment_attempt`. + # Controls whether Stripe attempts payment on the resumption invoice and how payment affects the subscription's status. The default is `resume_on_payment_success`. attr_accessor :payment_behavior # Determines how to handle prorations when the subscription resumes. The default is `create_prorations`. attr_accessor :proration_behavior @@ -1115,7 +1115,7 @@ def initialize(iterations: nil, update_behavior: nil) attr_accessor :from_subscription # Set of [key-value pairs](https://docs.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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. attr_accessor :metadata - # Sets the pause schedules for the subscription schedule. Each entry configures when and how the subscription pauses and optionally when and how it resumes. + # Configures the subscription's pause behavior and, optionally, its resume behavior. Only one entry is supported. attr_accessor :pause_schedules # List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. attr_accessor :phases diff --git a/lib/stripe/params/subscription_schedule_update_params.rb b/lib/stripe/params/subscription_schedule_update_params.rb index 214f31cf6..324261a9d 100644 --- a/lib/stripe/params/subscription_schedule_update_params.rb +++ b/lib/stripe/params/subscription_schedule_update_params.rb @@ -303,7 +303,7 @@ def initialize(duration: nil, timestamp: nil, type: nil) class Settings < ::Stripe::RequestParams # Controls the billing cycle anchor when the subscription resumes. attr_accessor :billing_cycle_anchor - # Controls whether Stripe attempts payment on the resumption invoice and how payment affects the subscription's status. The default is `resume_on_payment_attempt`. + # Controls whether Stripe attempts payment on the resumption invoice and how payment affects the subscription's status. The default is `resume_on_payment_success`. attr_accessor :payment_behavior # Determines how to handle prorations when the subscription resumes. The default is `create_prorations`. attr_accessor :proration_behavior @@ -1091,7 +1091,7 @@ def initialize(iterations: nil, update_behavior: nil) attr_accessor :expand # Set of [key-value pairs](https://docs.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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. attr_accessor :metadata - # Sets the pause schedules for the subscription schedule. Include a `key` to update an existing entry or omit it to add a new one. Pass `""` to clear all entries or `[]` to leave them unchanged. + # Configures the subscription's pause behavior and, optionally, its resume behavior. Only one entry is supported. Include a key to update an existing entry. Omit to leave an existing pause schedule unchanged, or pass "" to clear it. attr_accessor :pause_schedules # List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. Note that past phases can be omitted. attr_accessor :phases diff --git a/lib/stripe/params/v2/core/account_create_params.rb b/lib/stripe/params/v2/core/account_create_params.rb index 4a6344a08..be3c828b6 100644 --- a/lib/stripe/params/v2/core/account_create_params.rb +++ b/lib/stripe/params/v2/core/account_create_params.rb @@ -541,7 +541,7 @@ def initialize(capabilities: nil) class Customer < ::Stripe::RequestParams class AutomaticIndirectTax < ::Stripe::RequestParams - # Describes the customer's tax exemption status, which is `none`, `exempt`, or `reverse`. When set to reverse, invoice and receipt PDFs include the following text: “Reverse charge”. + # Describes the customer's tax exemption status, which is `none`, `exempt`, or `reverse`. When set to reverse, invoice and receipt PDFs include the following text: "Reverse charge". attr_accessor :exempt # A recent IP address of the customer used for tax reporting and tax location inference. attr_accessor :ip_address @@ -5436,23 +5436,23 @@ def initialize(files: nil, signer: nil, type: nil) @type = type end end - # One or more documents that support the bank account ownership verification requirement. Must be a document associated with the account’s primary active bank account that displays the last 4 digits of the account number, either a statement or a check. + # One or more documents that support the bank account ownership verification requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a check. attr_accessor :bank_account_ownership_verification - # One or more documents that demonstrate proof of a company’s license to operate. + # One or more documents that demonstrate proof of a company's license to operate. attr_accessor :company_license - # One or more documents showing the company’s Memorandum of Association. + # One or more documents showing the company's Memorandum of Association. attr_accessor :company_memorandum_of_association - # Certain countries only: One or more documents showing the ministerial decree legalizing the company’s establishment. + # Certain countries only: One or more documents showing the ministerial decree legalizing the company's establishment. attr_accessor :company_ministerial_decree - # One or more documents that demonstrate proof of a company’s registration with the appropriate local authorities. + # One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. attr_accessor :company_registration_verification - # One or more documents that demonstrate proof of a company’s tax ID. + # One or more documents that demonstrate proof of a company's tax ID. attr_accessor :company_tax_id_verification # A document verifying the business. attr_accessor :primary_verification # One or more documents that demonstrate proof of address. attr_accessor :proof_of_address - # One or more documents showing the company’s proof of registration with the national business registry. + # One or more documents showing the company's proof of registration with the national business registry. attr_accessor :proof_of_registration # One or more documents that demonstrate proof of ultimate beneficial ownership. attr_accessor :proof_of_ultimate_beneficial_ownership @@ -5884,13 +5884,13 @@ def initialize(files: nil, type: nil) end # One or more documents that demonstrate proof that this person is authorized to represent the company. attr_accessor :company_authorization - # One or more documents showing the person’s passport page with photo and personal data. + # One or more documents showing the person's passport page with photo and personal data. attr_accessor :passport # An identifying document showing the person's name, either a passport or local ID card. attr_accessor :primary_verification # A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. attr_accessor :secondary_verification - # One or more documents showing the person’s visa required for living in the country where they are residing. + # One or more documents showing the person's visa required for living in the country where they are residing. attr_accessor :visa def initialize( @@ -5925,7 +5925,7 @@ class Relationship < ::Stripe::RequestParams attr_accessor :director # Whether the person has significant responsibility to control, manage, or direct the organization. attr_accessor :executive - # Whether the person is an owner of the account’s identity. + # Whether the person is an owner of the account's identity. attr_accessor :owner # The percent owned by the person of the account's legal entity. attr_accessor :percent_ownership diff --git a/lib/stripe/params/v2/core/account_token_create_params.rb b/lib/stripe/params/v2/core/account_token_create_params.rb index 7851b1eb3..c9318e67f 100644 --- a/lib/stripe/params/v2/core/account_token_create_params.rb +++ b/lib/stripe/params/v2/core/account_token_create_params.rb @@ -588,17 +588,17 @@ def initialize(files: nil, signer: nil, type: nil) @type = type end end - # One or more documents that support the bank account ownership verification requirement. Must be a document associated with the account’s primary active bank account that displays the last 4 digits of the account number, either a statement or a check. + # One or more documents that support the bank account ownership verification requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a check. attr_accessor :bank_account_ownership_verification - # One or more documents that demonstrate proof of a company’s license to operate. + # One or more documents that demonstrate proof of a company's license to operate. attr_accessor :company_license - # One or more documents showing the company’s Memorandum of Association. + # One or more documents showing the company's Memorandum of Association. attr_accessor :company_memorandum_of_association - # Certain countries only: One or more documents showing the ministerial decree legalizing the company’s establishment. + # Certain countries only: One or more documents showing the ministerial decree legalizing the company's establishment. attr_accessor :company_ministerial_decree - # One or more documents that demonstrate proof of a company’s registration with the appropriate local authorities. + # One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. attr_accessor :company_registration_verification - # One or more documents that demonstrate proof of a company’s tax ID. + # One or more documents that demonstrate proof of a company's tax ID. attr_accessor :company_tax_id_verification # A document verifying the business. attr_accessor :primary_verification @@ -1036,13 +1036,13 @@ def initialize(files: nil, type: nil) end # One or more documents that demonstrate proof that this person is authorized to represent the company. attr_accessor :company_authorization - # One or more documents showing the person’s passport page with photo and personal data. + # One or more documents showing the person's passport page with photo and personal data. attr_accessor :passport # An identifying document showing the person's name, either a passport or local ID card. attr_accessor :primary_verification # A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. attr_accessor :secondary_verification - # One or more documents showing the person’s visa required for living in the country where they are residing. + # One or more documents showing the person's visa required for living in the country where they are residing. attr_accessor :visa def initialize( @@ -1077,7 +1077,7 @@ class Relationship < ::Stripe::RequestParams attr_accessor :director # Whether the person has significant responsibility to control, manage, or direct the organization. attr_accessor :executive - # Whether the person is an owner of the account’s identity. + # Whether the person is an owner of the account's identity. attr_accessor :owner # The percent owned by the person of the account's legal entity. attr_accessor :percent_ownership diff --git a/lib/stripe/params/v2/core/account_update_params.rb b/lib/stripe/params/v2/core/account_update_params.rb index 5e01005d7..55bbe3080 100644 --- a/lib/stripe/params/v2/core/account_update_params.rb +++ b/lib/stripe/params/v2/core/account_update_params.rb @@ -5468,17 +5468,17 @@ def initialize(files: nil, signer: nil, type: nil) @type = type end end - # One or more documents that support the bank account ownership verification requirement. Must be a document associated with the account’s primary active bank account that displays the last 4 digits of the account number, either a statement or a check. + # One or more documents that support the bank account ownership verification requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a check. attr_accessor :bank_account_ownership_verification - # One or more documents that demonstrate proof of a company’s license to operate. + # One or more documents that demonstrate proof of a company's license to operate. attr_accessor :company_license - # One or more documents showing the company’s Memorandum of Association. + # One or more documents showing the company's Memorandum of Association. attr_accessor :company_memorandum_of_association - # Certain countries only: One or more documents showing the ministerial decree legalizing the company’s establishment. + # Certain countries only: One or more documents showing the ministerial decree legalizing the company's establishment. attr_accessor :company_ministerial_decree - # One or more documents that demonstrate proof of a company’s registration with the appropriate local authorities. + # One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. attr_accessor :company_registration_verification - # One or more documents that demonstrate proof of a company’s tax ID. + # One or more documents that demonstrate proof of a company's tax ID. attr_accessor :company_tax_id_verification # A document verifying the business. attr_accessor :primary_verification @@ -5916,13 +5916,13 @@ def initialize(files: nil, type: nil) end # One or more documents that demonstrate proof that this person is authorized to represent the company. attr_accessor :company_authorization - # One or more documents showing the person’s passport page with photo and personal data. + # One or more documents showing the person's passport page with photo and personal data. attr_accessor :passport # An identifying document showing the person's name, either a passport or local ID card. attr_accessor :primary_verification # A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. attr_accessor :secondary_verification - # One or more documents showing the person’s visa required for living in the country where they are residing. + # One or more documents showing the person's visa required for living in the country where they are residing. attr_accessor :visa def initialize( @@ -5957,7 +5957,7 @@ class Relationship < ::Stripe::RequestParams attr_accessor :director # Whether the person has significant responsibility to control, manage, or direct the organization. attr_accessor :executive - # Whether the person is an owner of the account’s identity. + # Whether the person is an owner of the account's identity. attr_accessor :owner # The percent owned by the person of the account's legal entity. attr_accessor :percent_ownership diff --git a/lib/stripe/params/v2/core/accounts/person_create_params.rb b/lib/stripe/params/v2/core/accounts/person_create_params.rb index 2972a523a..2b4a5c055 100644 --- a/lib/stripe/params/v2/core/accounts/person_create_params.rb +++ b/lib/stripe/params/v2/core/accounts/person_create_params.rb @@ -220,13 +220,13 @@ def initialize(files: nil, type: nil) end # One or more documents that demonstrate proof that this person is authorized to represent the company. attr_accessor :company_authorization - # One or more documents showing the person’s passport page with photo and personal data. + # One or more documents showing the person's passport page with photo and personal data. attr_accessor :passport # An identifying document showing the person's name, either a passport or local ID card. attr_accessor :primary_verification # A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. attr_accessor :secondary_verification - # One or more documents showing the person’s visa required for living in the country where they are residing. + # One or more documents showing the person's visa required for living in the country where they are residing. attr_accessor :visa def initialize( diff --git a/lib/stripe/params/v2/core/accounts/person_token_create_params.rb b/lib/stripe/params/v2/core/accounts/person_token_create_params.rb index 001edaea8..5588c044b 100644 --- a/lib/stripe/params/v2/core/accounts/person_token_create_params.rb +++ b/lib/stripe/params/v2/core/accounts/person_token_create_params.rb @@ -214,13 +214,13 @@ def initialize(files: nil, type: nil) end # One or more documents that demonstrate proof that this person is authorized to represent the company. attr_accessor :company_authorization - # One or more documents showing the person’s passport page with photo and personal data. + # One or more documents showing the person's passport page with photo and personal data. attr_accessor :passport # An identifying document showing the person's name, either a passport or local ID card. attr_accessor :primary_verification # A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. attr_accessor :secondary_verification - # One or more documents showing the person’s visa required for living in the country where they are residing. + # One or more documents showing the person's visa required for living in the country where they are residing. attr_accessor :visa def initialize( diff --git a/lib/stripe/params/v2/core/accounts/person_update_params.rb b/lib/stripe/params/v2/core/accounts/person_update_params.rb index 342f2a9e4..4901eb600 100644 --- a/lib/stripe/params/v2/core/accounts/person_update_params.rb +++ b/lib/stripe/params/v2/core/accounts/person_update_params.rb @@ -220,13 +220,13 @@ def initialize(files: nil, type: nil) end # One or more documents that demonstrate proof that this person is authorized to represent the company. attr_accessor :company_authorization - # One or more documents showing the person’s passport page with photo and personal data. + # One or more documents showing the person's passport page with photo and personal data. attr_accessor :passport # An identifying document showing the person's name, either a passport or local ID card. attr_accessor :primary_verification # A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. attr_accessor :secondary_verification - # One or more documents showing the person’s visa required for living in the country where they are residing. + # One or more documents showing the person's visa required for living in the country where they are residing. attr_accessor :visa def initialize( diff --git a/lib/stripe/params/v2/money_management/payout_intent_confirm_params.rb b/lib/stripe/params/v2/money_management/payout_intent_confirm_params.rb new file mode 100644 index 000000000..74b039948 --- /dev/null +++ b/lib/stripe/params/v2/money_management/payout_intent_confirm_params.rb @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module V2 + module MoneyManagement + class PayoutIntentConfirmParams < ::Stripe::RequestParams; end + end + end +end diff --git a/lib/stripe/params/v2/money_management/payout_intent_create_params.rb b/lib/stripe/params/v2/money_management/payout_intent_create_params.rb index 601c9d13b..05d0c02a7 100644 --- a/lib/stripe/params/v2/money_management/payout_intent_create_params.rb +++ b/lib/stripe/params/v2/money_management/payout_intent_create_params.rb @@ -98,6 +98,8 @@ def initialize( end # The monetary amount to be sent. attr_accessor :amount + # Controls whether the intent requires explicit confirmation before transitioning to pending. Defaults to automatic. + attr_accessor :confirmation_method # An arbitrary string attached to the PayoutIntent. Often useful for displaying to users. attr_accessor :description # The FinancialAccount that funds are pulled from. @@ -115,6 +117,7 @@ def initialize( def initialize( amount: nil, + confirmation_method: nil, description: nil, from: nil, metadata: nil, @@ -124,6 +127,7 @@ def initialize( to: nil ) @amount = amount + @confirmation_method = confirmation_method @description = description @from = from @metadata = metadata diff --git a/lib/stripe/params/v2/money_management/payout_intent_fx_quote_params.rb b/lib/stripe/params/v2/money_management/payout_intent_fx_quote_params.rb new file mode 100644 index 000000000..678c2ee37 --- /dev/null +++ b/lib/stripe/params/v2/money_management/payout_intent_fx_quote_params.rb @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module V2 + module MoneyManagement + class PayoutIntentFxQuoteParams < ::Stripe::RequestParams; end + end + end +end diff --git a/lib/stripe/params/v2/payments/off_session_payment_capture_params.rb b/lib/stripe/params/v2/payments/off_session_payment_capture_params.rb index 4dd75d86b..efeeed899 100644 --- a/lib/stripe/params/v2/payments/off_session_payment_capture_params.rb +++ b/lib/stripe/params/v2/payments/off_session_payment_capture_params.rb @@ -141,8 +141,8 @@ def initialize(amount: nil) attr_accessor :metadata # Provides industry-specific information about the payment. attr_accessor :payment_details - # Text that appears on the customer’s statement as the statement descriptor for a - # non-card charge. This value overrides the account’s default statement descriptor. + # Text that appears on the customer's statement as the statement descriptor for a + # non-card charge. This value overrides the account's default statement descriptor. # For information about requirements, including the 22-character limit, see the # [Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). attr_accessor :statement_descriptor diff --git a/lib/stripe/params/v2/payments/off_session_payment_create_params.rb b/lib/stripe/params/v2/payments/off_session_payment_create_params.rb index e68c2a9de..df2092c39 100644 --- a/lib/stripe/params/v2/payments/off_session_payment_create_params.rb +++ b/lib/stripe/params/v2/payments/off_session_payment_create_params.rb @@ -267,7 +267,7 @@ def initialize(amount: nil, destination: nil) @destination = destination end end - # The “presentment amount” to be collected from the customer. + # The "presentment amount" to be collected from the customer. attr_accessor :amount # Provides industry-specific information about the amount. attr_accessor :amount_details @@ -301,14 +301,14 @@ def initialize(amount: nil, destination: nil) attr_accessor :payments_orchestration # Details about the OffSessionPayment retries. attr_accessor :retry_details - # Text that appears on the customer’s statement as the statement descriptor for a - # non-card charge. This value overrides the account’s default statement descriptor. + # Text that appears on the customer's statement as the statement descriptor for a + # non-card charge. This value overrides the account's default statement descriptor. # For information about requirements, including the 22-character limit, see the # [Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). attr_accessor :statement_descriptor - # Provides information about a card charge. Concatenated to the account’s + # Provides information about a card charge. Concatenated to the account's # [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) - # to form the complete statement descriptor that appears on the customer’s statement. + # to form the complete statement descriptor that appears on the customer's statement. attr_accessor :statement_descriptor_suffix # Provides a way to schedule deferred payments for cards and debits, in YYYY-MM-DD format. attr_accessor :target_date diff --git a/lib/stripe/params/v2/tax/operation_resolve_address_params.rb b/lib/stripe/params/v2/tax/operation_resolve_address_params.rb new file mode 100644 index 000000000..d1bbd32ec --- /dev/null +++ b/lib/stripe/params/v2/tax/operation_resolve_address_params.rb @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module V2 + module Tax + class OperationResolveAddressParams < ::Stripe::RequestParams + class Address < ::Stripe::RequestParams + # The city. + attr_accessor :city + # The two-letter country code. + attr_accessor :country + # The first line of the street address. + attr_accessor :line1 + # The postal code. + attr_accessor :postal_code + # The state or province. + attr_accessor :state + + def initialize(city: nil, country: nil, line1: nil, postal_code: nil, state: nil) + @city = city + @country = country + @line1 = line1 + @postal_code = postal_code + @state = state + end + end + # The address to resolve. + attr_accessor :address + + def initialize(address: nil) + @address = address + end + end + end + end +end diff --git a/lib/stripe/request_params.rb b/lib/stripe/request_params.rb index 58682c28b..75df69ae9 100644 --- a/lib/stripe/request_params.rb +++ b/lib/stripe/request_params.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true # typed: true -require "bigdecimal" - module Stripe # For internal use only. Does not provide a stable API and may be broken # with future non-major changes. @@ -64,61 +62,8 @@ def self.field_encodings @field_encodings ||= {} end - # Recursively coerce a value based on its field encoding schema. - # Handles :int64_string leaves, { kind: :object, fields: ... } nesting, - # and { kind: :array, element: ... } for arrays. def self.coerce_value(value, encoding) - return value if value.nil? - - case encoding - when :int64_string - coerce_int64_string(value) - when :decimal_string - coerce_decimal_string(value) - when Hash - coerce_composite(value, encoding) - else - value - end - end - - private_class_method def self.coerce_int64_string(value) - case value - when Integer then value.to_s - when Array then value.map { |v| v.is_a?(Integer) ? v.to_s : v } - else value - end - end - - private_class_method def self.coerce_decimal_string(value) - case value - when BigDecimal then value.to_s("F") - when Integer, Float then value.to_s - when Array then value.map { |v| coerce_decimal_string(v) } - else value - end - end - - private_class_method def self.coerce_composite(value, encoding) - case encoding[:kind] - when :object - coerce_object(value, encoding[:fields] || {}) - when :array - return value unless value.is_a?(Array) - - value.map { |v| coerce_value(v, encoding[:element]) } - else - value - end - end - - private_class_method def self.coerce_object(value, fields_schema) - return value unless value.is_a?(Hash) - - value.each_with_object({}) do |(k, v), result| - field_encoding = fields_schema[k.to_sym] - result[k] = field_encoding ? coerce_value(v, field_encoding) : v - end + V2TypeCoercion.coerce_value(value, encoding, direction: :encode) end # Coerce a plain Hash using this class's field_encodings. diff --git a/lib/stripe/resources.rb b/lib/stripe/resources.rb index 791e41f6a..7fa38e047 100644 --- a/lib/stripe/resources.rb +++ b/lib/stripe/resources.rb @@ -194,13 +194,31 @@ module Events autoload :V1ApplicationFeeRefundUpdatedEventNotification, "stripe/events/v1_application_fee_refund_updated_event" autoload :V1BalanceAvailableEvent, "stripe/events/v1_balance_available_event" autoload :V1BalanceAvailableEventNotification, "stripe/events/v1_balance_available_event" + autoload :V1BalanceSettingsUpdatedEvent, "stripe/events/v1_balance_settings_updated_event" + autoload :V1BalanceSettingsUpdatedEventNotification, "stripe/events/v1_balance_settings_updated_event" autoload :V1BillingAlertTriggeredEvent, "stripe/events/v1_billing_alert_triggered_event" autoload :V1BillingAlertTriggeredEventNotification, "stripe/events/v1_billing_alert_triggered_event" + autoload :V1BillingCreditBalanceTransactionCreatedEvent, + "stripe/events/v1_billing_credit_balance_transaction_created_event" + autoload :V1BillingCreditBalanceTransactionCreatedEventNotification, + "stripe/events/v1_billing_credit_balance_transaction_created_event" + autoload :V1BillingCreditGrantCreatedEvent, "stripe/events/v1_billing_credit_grant_created_event" + autoload :V1BillingCreditGrantCreatedEventNotification, "stripe/events/v1_billing_credit_grant_created_event" + autoload :V1BillingCreditGrantUpdatedEvent, "stripe/events/v1_billing_credit_grant_updated_event" + autoload :V1BillingCreditGrantUpdatedEventNotification, "stripe/events/v1_billing_credit_grant_updated_event" + autoload :V1BillingMeterCreatedEvent, "stripe/events/v1_billing_meter_created_event" + autoload :V1BillingMeterCreatedEventNotification, "stripe/events/v1_billing_meter_created_event" + autoload :V1BillingMeterDeactivatedEvent, "stripe/events/v1_billing_meter_deactivated_event" + autoload :V1BillingMeterDeactivatedEventNotification, "stripe/events/v1_billing_meter_deactivated_event" autoload :V1BillingMeterErrorReportTriggeredEvent, "stripe/events/v1_billing_meter_error_report_triggered_event" autoload :V1BillingMeterErrorReportTriggeredEventNotification, "stripe/events/v1_billing_meter_error_report_triggered_event" autoload :V1BillingMeterNoMeterFoundEvent, "stripe/events/v1_billing_meter_no_meter_found_event" autoload :V1BillingMeterNoMeterFoundEventNotification, "stripe/events/v1_billing_meter_no_meter_found_event" + autoload :V1BillingMeterReactivatedEvent, "stripe/events/v1_billing_meter_reactivated_event" + autoload :V1BillingMeterReactivatedEventNotification, "stripe/events/v1_billing_meter_reactivated_event" + autoload :V1BillingMeterUpdatedEvent, "stripe/events/v1_billing_meter_updated_event" + autoload :V1BillingMeterUpdatedEventNotification, "stripe/events/v1_billing_meter_updated_event" autoload :V1BillingPortalConfigurationCreatedEvent, "stripe/events/v1_billing_portal_configuration_created_event" autoload :V1BillingPortalConfigurationCreatedEventNotification, "stripe/events/v1_billing_portal_configuration_created_event" @@ -320,6 +338,10 @@ module Events "stripe/events/v1_entitlements_active_entitlement_summary_updated_event" autoload :V1FileCreatedEvent, "stripe/events/v1_file_created_event" autoload :V1FileCreatedEventNotification, "stripe/events/v1_file_created_event" + autoload :V1FinancialConnectionsAccountAccountNumbersUpdatedEvent, + "stripe/events/v1_financial_connections_account_account_numbers_updated_event" + autoload :V1FinancialConnectionsAccountAccountNumbersUpdatedEventNotification, + "stripe/events/v1_financial_connections_account_account_numbers_updated_event" autoload :V1FinancialConnectionsAccountCreatedEvent, "stripe/events/v1_financial_connections_account_created_event" autoload :V1FinancialConnectionsAccountCreatedEventNotification, "stripe/events/v1_financial_connections_account_created_event" @@ -331,6 +353,10 @@ module Events "stripe/events/v1_financial_connections_account_disconnected_event" autoload :V1FinancialConnectionsAccountDisconnectedEventNotification, "stripe/events/v1_financial_connections_account_disconnected_event" + autoload :V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEvent, + "stripe/events/v1_financial_connections_account_expected_deactivation_date_updated_event" + autoload :V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEventNotification, + "stripe/events/v1_financial_connections_account_expected_deactivation_date_updated_event" autoload :V1FinancialConnectionsAccountReactivatedEvent, "stripe/events/v1_financial_connections_account_reactivated_event" autoload :V1FinancialConnectionsAccountReactivatedEventNotification, @@ -347,6 +373,18 @@ module Events "stripe/events/v1_financial_connections_account_refreshed_transactions_event" autoload :V1FinancialConnectionsAccountRefreshedTransactionsEventNotification, "stripe/events/v1_financial_connections_account_refreshed_transactions_event" + autoload :V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEvent, + "stripe/events/v1_financial_connections_account_supported_payment_method_types_updated_event" + autoload :V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEventNotification, + "stripe/events/v1_financial_connections_account_supported_payment_method_types_updated_event" + autoload :V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEvent, + "stripe/events/v1_financial_connections_account_upcoming_account_number_expiry_event" + autoload :V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEventNotification, + "stripe/events/v1_financial_connections_account_upcoming_account_number_expiry_event" + autoload :V1FinancialConnectionsAccountUpcomingDeactivationEvent, + "stripe/events/v1_financial_connections_account_upcoming_deactivation_event" + autoload :V1FinancialConnectionsAccountUpcomingDeactivationEventNotification, + "stripe/events/v1_financial_connections_account_upcoming_deactivation_event" autoload :V1IdentityVerificationSessionCanceledEvent, "stripe/events/v1_identity_verification_session_canceled_event" autoload :V1IdentityVerificationSessionCanceledEventNotification, @@ -392,6 +430,9 @@ module Events autoload :V1InvoicePaidEventNotification, "stripe/events/v1_invoice_paid_event" autoload :V1InvoicePaymentActionRequiredEvent, "stripe/events/v1_invoice_payment_action_required_event" autoload :V1InvoicePaymentActionRequiredEventNotification, "stripe/events/v1_invoice_payment_action_required_event" + autoload :V1InvoicePaymentAttemptRequiredEvent, "stripe/events/v1_invoice_payment_attempt_required_event" + autoload :V1InvoicePaymentAttemptRequiredEventNotification, + "stripe/events/v1_invoice_payment_attempt_required_event" autoload :V1InvoicePaymentFailedEvent, "stripe/events/v1_invoice_payment_failed_event" autoload :V1InvoicePaymentFailedEventNotification, "stripe/events/v1_invoice_payment_failed_event" autoload :V1InvoicePaymentPaidEvent, "stripe/events/v1_invoice_payment_paid_event" @@ -1631,6 +1672,7 @@ module Signals module Tax autoload :ManualRule, "stripe/resources/v2/tax/manual_rule" + autoload :OperationsResolveAddressResult, "stripe/resources/v2/tax/operations_resolve_address_result" end end end @@ -1932,6 +1974,7 @@ module Stripe stripe/resources/v2/signals/account_evaluation stripe/resources/v2/signals/account_signal stripe/resources/v2/tax/manual_rule + stripe/resources/v2/tax/operations_resolve_address_result stripe/resources/webhook_endpoint stripe/events/v1_account_application_authorized_event stripe/events/v1_account_application_deauthorized_event @@ -1944,9 +1987,17 @@ module Stripe stripe/events/v1_application_fee_refund_updated_event stripe/events/v1_application_fee_refunded_event stripe/events/v1_balance_available_event + stripe/events/v1_balance_settings_updated_event stripe/events/v1_billing_alert_triggered_event + stripe/events/v1_billing_credit_balance_transaction_created_event + stripe/events/v1_billing_credit_grant_created_event + stripe/events/v1_billing_credit_grant_updated_event + stripe/events/v1_billing_meter_created_event + stripe/events/v1_billing_meter_deactivated_event stripe/events/v1_billing_meter_error_report_triggered_event stripe/events/v1_billing_meter_no_meter_found_event + stripe/events/v1_billing_meter_reactivated_event + stripe/events/v1_billing_meter_updated_event stripe/events/v1_billing_portal_configuration_created_event stripe/events/v1_billing_portal_configuration_updated_event stripe/events/v1_billing_portal_session_created_event @@ -1999,13 +2050,18 @@ module Stripe stripe/events/v1_customer_updated_event stripe/events/v1_entitlements_active_entitlement_summary_updated_event stripe/events/v1_file_created_event + stripe/events/v1_financial_connections_account_account_numbers_updated_event stripe/events/v1_financial_connections_account_created_event stripe/events/v1_financial_connections_account_deactivated_event stripe/events/v1_financial_connections_account_disconnected_event + stripe/events/v1_financial_connections_account_expected_deactivation_date_updated_event stripe/events/v1_financial_connections_account_reactivated_event stripe/events/v1_financial_connections_account_refreshed_balance_event stripe/events/v1_financial_connections_account_refreshed_ownership_event stripe/events/v1_financial_connections_account_refreshed_transactions_event + stripe/events/v1_financial_connections_account_supported_payment_method_types_updated_event + stripe/events/v1_financial_connections_account_upcoming_account_number_expiry_event + stripe/events/v1_financial_connections_account_upcoming_deactivation_event stripe/events/v1_identity_verification_session_canceled_event stripe/events/v1_identity_verification_session_created_event stripe/events/v1_identity_verification_session_processing_event @@ -2021,6 +2077,7 @@ module Stripe stripe/events/v1_invoice_overpaid_event stripe/events/v1_invoice_paid_event stripe/events/v1_invoice_payment_action_required_event + stripe/events/v1_invoice_payment_attempt_required_event stripe/events/v1_invoice_payment_failed_event stripe/events/v1_invoice_payment_paid_event stripe/events/v1_invoice_payment_succeeded_event diff --git a/lib/stripe/resources/account.rb b/lib/stripe/resources/account.rb index 9b8e15ca1..dd7423d66 100644 --- a/lib/stripe/resources/account.rb +++ b/lib/stripe/resources/account.rb @@ -256,7 +256,7 @@ class Capabilities < ::Stripe::StripeObject attr_reader :sepa_bank_transfer_payments # The status of the SEPA Direct Debits payments capability of the account, or whether the account can directly process SEPA Direct Debits charges. attr_reader :sepa_debit_payments - # The status of the Sequra capability of the account, or whether the account can directly process Sequra payments. + # The status of the SeQura capability of the account, or whether the account can directly process SeQura payments. attr_reader :sequra_payments # The status of the ShopeePay capability of the account, or whether the account can directly process ShopeePay payments. attr_reader :shopeepay_payments diff --git a/lib/stripe/resources/billing_portal/session.rb b/lib/stripe/resources/billing_portal/session.rb index 16bd737f6..0e2f3f297 100644 --- a/lib/stripe/resources/billing_portal/session.rb +++ b/lib/stripe/resources/billing_portal/session.rb @@ -68,6 +68,16 @@ def self.field_remappings end end + class CustomerUpdate < ::Stripe::StripeObject + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + class SubscriptionCancel < ::Stripe::StripeObject class Retention < ::Stripe::StripeObject class CouponOffer < ::Stripe::StripeObject @@ -171,6 +181,8 @@ def self.field_remappings end # Attribute for field after_completion attr_reader :after_completion + # Configuration when `flow.type=customer_update`. + attr_reader :customer_update # Configuration when `flow.type=subscription_cancel`. attr_reader :subscription_cancel # Configuration when `flow.type=subscription_update`. @@ -183,6 +195,7 @@ def self.field_remappings def self.inner_class_types @inner_class_types = { after_completion: AfterCompletion, + customer_update: CustomerUpdate, subscription_cancel: SubscriptionCancel, subscription_update: SubscriptionUpdate, subscription_update_confirm: SubscriptionUpdateConfirm, diff --git a/lib/stripe/resources/charge.rb b/lib/stripe/resources/charge.rb index 6bdb82709..52cfae2e5 100644 --- a/lib/stripe/resources/charge.rb +++ b/lib/stripe/resources/charge.rb @@ -1611,8 +1611,8 @@ class Link < ::Stripe::StripeObject # Two-letter ISO code representing the funding source country beneath the Link payment. # You could use this attribute to get a sense of international fees. attr_reader :country - # The pricing bundle applied to this Link payment at confirmation time. Maps to a bundle in your Stripe pricing contract and on Stripe's published pricing page. Omitted if bundle lookup failed at confirmation time. - attr_reader :pricing_group + # The funding source group applied to this Link payment at confirmation time. Maps to a bundle in your Stripe pricing contract and on Stripe's published pricing page. Omitted if group lookup failed at confirmation time. + attr_reader :funding_source_group def self.inner_class_types @inner_class_types = {} @@ -1932,7 +1932,7 @@ class Pix < ::Stripe::StripeObject attr_reader :bank_transaction_id # Uniquely identifies this particular Pix account. You can use this attribute to check whether two Pix accounts are the same. attr_reader :fingerprint - # ID of the multi use Mandate generated by the PaymentIntent + # ID of the multi use Mandate generated by the PaymentIntent or SetupIntent. attr_reader :mandate def self.inner_class_types @@ -2117,7 +2117,7 @@ def self.field_remappings end class Sequra < ::Stripe::StripeObject - # The Sequra transaction ID associated with this payment. + # The SeQura transaction ID associated with this payment. attr_reader :transaction_id def self.inner_class_types @@ -2237,7 +2237,7 @@ def self.field_remappings end class Twint < ::Stripe::StripeObject - # ID of the multi use Mandate generated by the PaymentIntent + # ID of the multi use Mandate generated by the PaymentIntent or SetupIntent. attr_reader :mandate def self.inner_class_types diff --git a/lib/stripe/resources/climate/order.rb b/lib/stripe/resources/climate/order.rb index cbabecf13..08740357a 100644 --- a/lib/stripe/resources/climate/order.rb +++ b/lib/stripe/resources/climate/order.rb @@ -94,7 +94,7 @@ def self.field_remappings attr_reader :delivered_at # Details about the delivery of carbon removal for this order. attr_reader :delivery_details - # The year this order is expected to be delivered. + # The year this order is expected to be delivered. If the year is in the past, the order is a spot purchase and will be delivered within 30 days of purchase. attr_reader :expected_delivery_year # Unique identifier for the object. attr_reader :id diff --git a/lib/stripe/resources/climate/product.rb b/lib/stripe/resources/climate/product.rb index 5a41caa87..8bafd2eca 100644 --- a/lib/stripe/resources/climate/product.rb +++ b/lib/stripe/resources/climate/product.rb @@ -33,7 +33,7 @@ def self.field_remappings attr_reader :created # Current prices for a metric ton of carbon removal in a currency's smallest unit. attr_reader :current_prices_per_metric_ton - # The year in which the carbon removal is expected to be delivered. + # The year in which the carbon removal is expected to be delivered. If the year is in the past, this represents spot inventory with guaranteed delivery. attr_reader :delivery_year # Unique identifier for the object. For convenience, Climate product IDs are human-readable strings # that start with `climsku_`. See [carbon removal inventory](https://stripe.com/docs/climate/orders/carbon-removal-inventory) diff --git a/lib/stripe/resources/crypto/onramp_session.rb b/lib/stripe/resources/crypto/onramp_session.rb index bcac93434..239979791 100644 --- a/lib/stripe/resources/crypto/onramp_session.rb +++ b/lib/stripe/resources/crypto/onramp_session.rb @@ -52,6 +52,8 @@ def self.field_remappings attr_reader :base_network # A bitcoin address attr_reader :bitcoin + # A Celo address + attr_reader :celo # The end customer's crypto wallet destination tag (for each network) to use for this transaction. attr_reader :destination_tags # An ethereum address diff --git a/lib/stripe/resources/customer_session.rb b/lib/stripe/resources/customer_session.rb index d6668993e..2a3c72da3 100644 --- a/lib/stripe/resources/customer_session.rb +++ b/lib/stripe/resources/customer_session.rb @@ -30,6 +30,19 @@ def self.field_remappings end end + class CustomerPortal < ::Stripe::StripeObject + # Whether the customer portal is enabled. + attr_reader :enabled + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + class CustomerSheet < ::Stripe::StripeObject class Features < ::Stripe::StripeObject # A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the customer sheet displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list. @@ -198,6 +211,8 @@ def self.field_remappings end # This hash contains whether the buy button is enabled. attr_reader :buy_button + # This hash contains whether the customer portal is enabled. + attr_reader :customer_portal # This hash contains whether the customer sheet is enabled and the features it supports. attr_reader :customer_sheet # This hash contains whether the mobile payment element is enabled and the features it supports. @@ -212,6 +227,7 @@ def self.field_remappings def self.inner_class_types @inner_class_types = { buy_button: BuyButton, + customer_portal: CustomerPortal, customer_sheet: CustomerSheet, mobile_payment_element: MobilePaymentElement, payment_element: PaymentElement, diff --git a/lib/stripe/resources/financial_connections/account.rb b/lib/stripe/resources/financial_connections/account.rb index 5e4f9ef4c..6898b5f26 100644 --- a/lib/stripe/resources/financial_connections/account.rb +++ b/lib/stripe/resources/financial_connections/account.rb @@ -128,6 +128,44 @@ def self.field_remappings end end + class ClassificationState < ::Stripe::StripeObject + # The taxonomy classification status for this account. One of 'pending' or 'completed'. + attr_reader :status + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + + class EnrichmentState < ::Stripe::StripeObject + class Merchant < ::Stripe::StripeObject + # The merchant enrichment status for this account. One of 'pending' or 'completed'. + attr_reader :status + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + # The enrichment status for merchant name normalization. + attr_reader :merchant + + def self.inner_class_types + @inner_class_types = { merchant: Merchant } + end + + def self.field_remappings + @field_remappings = {} + end + end + class InferredBalancesRefresh < ::Stripe::StripeObject # The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch. attr_reader :last_attempted_at @@ -238,10 +276,14 @@ def self.field_remappings attr_reader :balance_refresh # The type of the account. Account category is further divided in `subcategory`. attr_reader :category + # Per-taxonomy processing state for this account. One entry per subscribed taxonomy. + attr_reader :classification_state # Time at which the object was created. Measured in seconds since the Unix epoch. attr_reader :created # A human-readable name that has been assigned to this account, either by the account holder or by the institution. attr_reader :display_name + # The state of merchant name enrichment for this account. + attr_reader :enrichment_state # Unique identifier for the object. attr_reader :id # The state of the most recent attempt to refresh the account's inferred balance history. @@ -404,6 +446,8 @@ def self.inner_class_types account_numbers: AccountNumber, balance: Balance, balance_refresh: BalanceRefresh, + classification_state: ClassificationState, + enrichment_state: EnrichmentState, inferred_balances_refresh: InferredBalancesRefresh, ownership_refresh: OwnershipRefresh, status_details: StatusDetails, diff --git a/lib/stripe/resources/financial_connections/session.rb b/lib/stripe/resources/financial_connections/session.rb index dddb370d1..24cb85db7 100644 --- a/lib/stripe/resources/financial_connections/session.rb +++ b/lib/stripe/resources/financial_connections/session.rb @@ -36,6 +36,8 @@ class Filters < ::Stripe::StripeObject attr_reader :account_subcategories # List of countries from which to filter accounts. attr_reader :countries + # Country from which to filter accounts. + attr_reader :country # Stripe ID of the institution with which the customer should be directed to log in. attr_reader :institution # Whether the Session should require that linked accounts support payments and retrieve account numbers before completion. diff --git a/lib/stripe/resources/financial_connections/transaction.rb b/lib/stripe/resources/financial_connections/transaction.rb index 246d4eb11..947533e68 100644 --- a/lib/stripe/resources/financial_connections/transaction.rb +++ b/lib/stripe/resources/financial_connections/transaction.rb @@ -12,6 +12,83 @@ def self.object_name "financial_connections.transaction" end + class Classification < ::Stripe::StripeObject + class MoneyMovement < ::Stripe::StripeObject + # Stripe's confidence in this classification. + attr_reader :confidence_level + # The detailed category label for this transaction. + attr_reader :detailed_label + # The primary category label for this transaction. + attr_reader :primary_label + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + + class PersonalFinance < ::Stripe::StripeObject + # Stripe's confidence in this classification. + attr_reader :confidence_level + # The detailed category label for this transaction. + attr_reader :detailed_label + # The primary category label for this transaction. + attr_reader :primary_label + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + # Money movement classification labels for this transaction. + attr_reader :money_movement + # Personal finance classification labels for this transaction. + attr_reader :personal_finance + # The taxonomy type for this classification entry. + attr_reader :type + + def self.inner_class_types + @inner_class_types = { money_movement: MoneyMovement, personal_finance: PersonalFinance } + end + + def self.field_remappings + @field_remappings = {} + end + end + + class Enrichments < ::Stripe::StripeObject + class Merchant < ::Stripe::StripeObject + # Stripe's confidence in the enriched merchant name. + attr_reader :confidence_level + # The normalized merchant name for this transaction. + attr_reader :name + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + # Attribute for field merchant + attr_reader :merchant + + def self.inner_class_types + @inner_class_types = { merchant: Merchant } + end + + def self.field_remappings + @field_remappings = {} + end + end + class StatusTransitions < ::Stripe::StripeObject # Time at which this transaction posted. Measured in seconds since the Unix epoch. attr_reader :posted_at @@ -30,10 +107,14 @@ def self.field_remappings attr_reader :account # The amount of this transaction, in cents (or local equivalent). attr_reader :amount + # Classification labels for this transaction, one entry per subscribed use case. + attr_reader :classifications # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). attr_reader :currency # The description of this transaction. attr_reader :description + # Enriched merchant information for this transaction. + attr_reader :enrichments # Unique identifier for the object. attr_reader :id # If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. @@ -62,7 +143,11 @@ def self.list(params = {}, opts = {}) end def self.inner_class_types - @inner_class_types = { status_transitions: StatusTransitions } + @inner_class_types = { + classifications: Classification, + enrichments: Enrichments, + status_transitions: StatusTransitions, + } end def self.field_remappings diff --git a/lib/stripe/resources/invoice.rb b/lib/stripe/resources/invoice.rb index 8c615893a..b69f65e91 100644 --- a/lib/stripe/resources/invoice.rb +++ b/lib/stripe/resources/invoice.rb @@ -164,6 +164,23 @@ def self.field_remappings end end + class CustomerBalance < ::Stripe::StripeObject + # The total amount of customer balance applied to this invoice (automatically + manually). + attr_reader :applied_balance + # The amount of customer balance automatically applied during invoice finalization. + attr_reader :automatically_applied_balance + # The total amount of customer balance manually applied after finalization. + attr_reader :manually_applied_balance + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + class CustomerShipping < ::Stripe::StripeObject class Address < ::Stripe::StripeObject # City, district, suburb, town, or village. @@ -474,6 +491,16 @@ def self.field_remappings end end + class Billie < ::Stripe::StripeObject + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + class Bizum < ::Stripe::StripeObject def self.inner_class_types @inner_class_types = {} @@ -740,6 +767,8 @@ def self.field_remappings attr_reader :acss_debit # If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. attr_reader :bancontact + # If paying by `billie`, this sub-hash contains details about the Billie payment method options to pass to the invoice’s PaymentIntent. + attr_reader :billie # If paying by `bizum`, this sub-hash contains details about the Bizum payment method options to pass to the invoice’s PaymentIntent. attr_reader :bizum # If paying by `blik`, this sub-hash contains details about the Blik payment method options to pass to the invoice’s PaymentIntent. @@ -771,6 +800,7 @@ def self.inner_class_types @inner_class_types = { acss_debit: AcssDebit, bancontact: Bancontact, + billie: Billie, bizum: Bizum, blik: Blik, card: Card, @@ -1113,6 +1143,8 @@ def self.field_remappings attr_reader :customer_account # The customer's address. Until the invoice is finalized, this field will equal `customer.address`. Once the invoice is finalized, this field will no longer be updated. attr_reader :customer_address + # The customer balance amounts applied to this invoice. + attr_reader :customer_balance # The customer's email. Until the invoice is finalized, this field will equal `customer.email`. Once the invoice is finalized, this field will no longer be updated. attr_reader :customer_email # The customer's name. Until the invoice is finalized, this field will equal `customer.name`. Once the invoice is finalized, this field will no longer be updated. @@ -1532,6 +1564,7 @@ def self.inner_class_types confirmation_secret: ConfirmationSecret, custom_fields: CustomField, customer_address: CustomerAddress, + customer_balance: CustomerBalance, customer_shipping: CustomerShipping, customer_tax_ids: CustomerTaxId, from_invoice: FromInvoice, diff --git a/lib/stripe/resources/issuing/authorization.rb b/lib/stripe/resources/issuing/authorization.rb index a17dbb9c3..ac60d5d61 100644 --- a/lib/stripe/resources/issuing/authorization.rb +++ b/lib/stripe/resources/issuing/authorization.rb @@ -613,12 +613,75 @@ def self.field_remappings @field_remappings = {} end end + + class HoldAmount < ::Stripe::StripeObject + # Three-letter ISO currency code. + attr_reader :currency + # The amount in the smallest currency unit. + attr_reader :value + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + + class HoldAmountDetails < ::Stripe::StripeObject + class Network < ::Stripe::StripeObject + # Three-letter ISO currency code. + attr_reader :currency + # The amount in the smallest currency unit. + attr_reader :value + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + + class Reserve < ::Stripe::StripeObject + # Three-letter ISO currency code. + attr_reader :currency + # The amount in the smallest currency unit. + attr_reader :value + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + # Attribute for field network + attr_reader :network + # The reserve amount held for this authorization. Present for certain MCCs that may have overcaptures. + attr_reader :reserve + + def self.inner_class_types + @inner_class_types = { network: Network, reserve: Reserve } + end + + def self.field_remappings + @field_remappings = {} + end + end # The additional amount Stripe will hold if the authorization is approved, in the card's [currency](https://docs.stripe.com/api#issuing_authorization_object-pending-request-currency) and in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). attr_reader :amount # Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). attr_reader :amount_details # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). attr_reader :currency + # The total amount to be held for this authorization request. + attr_reader :hold_amount + # Breakdown of the amounts contributing to hold_amount. + attr_reader :hold_amount_details # If set `true`, you may provide [amount](https://docs.stripe.com/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. attr_reader :is_amount_controllable # The amount the merchant is requesting to be authorized in the `merchant_currency`. The amount is in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). @@ -629,7 +692,11 @@ def self.field_remappings attr_reader :network_risk_score def self.inner_class_types - @inner_class_types = { amount_details: AmountDetails } + @inner_class_types = { + amount_details: AmountDetails, + hold_amount: HoldAmount, + hold_amount_details: HoldAmountDetails, + } end def self.field_remappings @@ -666,6 +733,65 @@ def self.field_remappings end end + class HoldAmount < ::Stripe::StripeObject + # Three-letter ISO currency code. + attr_reader :currency + # The amount in the smallest currency unit. + attr_reader :value + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + + class HoldAmountDetails < ::Stripe::StripeObject + class Network < ::Stripe::StripeObject + # Three-letter ISO currency code. + attr_reader :currency + # The amount in the smallest currency unit. + attr_reader :value + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + + class Reserve < ::Stripe::StripeObject + # Three-letter ISO currency code. + attr_reader :currency + # The amount in the smallest currency unit. + attr_reader :value + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + # Attribute for field network + attr_reader :network + # The reserve amount held for this authorization. Present for certain MCCs that may have overcaptures. + attr_reader :reserve + + def self.inner_class_types + @inner_class_types = { network: Network, reserve: Reserve } + end + + def self.field_remappings + @field_remappings = {} + end + end + class NetworkData < ::Stripe::StripeObject class TraceId < ::Stripe::StripeObject # The unique reference number within the specified financial network on the specified network date. @@ -706,6 +832,10 @@ def self.field_remappings attr_reader :created # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). attr_reader :currency + # The total amount that was held for this authorization request. + attr_reader :hold_amount + # Breakdown of the amounts contributing to hold_amount. + attr_reader :hold_amount_details # The `pending_request.merchant_amount` at the time of the request, presented in the `merchant_currency` and in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). attr_reader :merchant_amount # The currency that was collected by the merchant and presented to the cardholder for the authorization. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). @@ -722,7 +852,12 @@ def self.field_remappings attr_reader :requested_at def self.inner_class_types - @inner_class_types = { amount_details: AmountDetails, network_data: NetworkData } + @inner_class_types = { + amount_details: AmountDetails, + hold_amount: HoldAmount, + hold_amount_details: HoldAmountDetails, + network_data: NetworkData, + } end def self.field_remappings diff --git a/lib/stripe/resources/issuing/cardholder.rb b/lib/stripe/resources/issuing/cardholder.rb index 80cd6dd3f..c34bd3dbe 100644 --- a/lib/stripe/resources/issuing/cardholder.rb +++ b/lib/stripe/resources/issuing/cardholder.rb @@ -249,7 +249,7 @@ def self.field_remappings attr_reader :object # The cardholder's phone number. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://docs.stripe.com/issuing/3d-secure#when-is-3d-secure-applied) for more details. attr_reader :phone_number - # The cardholder’s preferred locales (languages), ordered by preference. Locales can be `da`, `de`, `en`, `es`, `fr`, `it`, `pl`, or `sv`. + # The cardholder’s preferred locales (languages), ordered by preference. Locales can be `de`, `en`, `es`, `fr`, or `it`. # This changes the language of the [3D Secure flow](https://docs.stripe.com/issuing/3d-secure) and one-time password messages sent to the cardholder. attr_reader :preferred_locales # Redaction status of this cardholder. If the cardholder is not redacted, this field will be null. diff --git a/lib/stripe/resources/payment_attempt_record.rb b/lib/stripe/resources/payment_attempt_record.rb index 5cf7c6b59..0065c42b5 100644 --- a/lib/stripe/resources/payment_attempt_record.rb +++ b/lib/stripe/resources/payment_attempt_record.rb @@ -1584,7 +1584,7 @@ def self.field_remappings class Pix < ::Stripe::StripeObject # Unique transaction id generated by BCB attr_reader :bank_transaction_id - # ID of the multi use Mandate generated by the PaymentIntent + # ID of the multi use Mandate generated by the PaymentIntent or SetupIntent. attr_reader :mandate def self.inner_class_types @@ -1769,7 +1769,7 @@ def self.field_remappings end class Sequra < ::Stripe::StripeObject - # The Sequra transaction ID associated with this payment. + # The SeQura transaction ID associated with this payment. attr_reader :transaction_id def self.inner_class_types @@ -1887,7 +1887,7 @@ def self.field_remappings end class Twint < ::Stripe::StripeObject - # ID of the multi use Mandate generated by the PaymentIntent + # ID of the multi use Mandate generated by the PaymentIntent or SetupIntent. attr_reader :mandate def self.inner_class_types diff --git a/lib/stripe/resources/payment_intent.rb b/lib/stripe/resources/payment_intent.rb index a0fefe708..11a0bbadd 100644 --- a/lib/stripe/resources/payment_intent.rb +++ b/lib/stripe/resources/payment_intent.rb @@ -4699,6 +4699,14 @@ def self.field_remappings class Sequra < ::Stripe::StripeObject # Controls when the funds will be captured from the customer's account. attr_reader :capture_method + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage def self.inner_class_types @inner_class_types = {} diff --git a/lib/stripe/resources/payment_record.rb b/lib/stripe/resources/payment_record.rb index 632af3363..3d47f87f3 100644 --- a/lib/stripe/resources/payment_record.rb +++ b/lib/stripe/resources/payment_record.rb @@ -1586,7 +1586,7 @@ def self.field_remappings class Pix < ::Stripe::StripeObject # Unique transaction id generated by BCB attr_reader :bank_transaction_id - # ID of the multi use Mandate generated by the PaymentIntent + # ID of the multi use Mandate generated by the PaymentIntent or SetupIntent. attr_reader :mandate def self.inner_class_types @@ -1771,7 +1771,7 @@ def self.field_remappings end class Sequra < ::Stripe::StripeObject - # The Sequra transaction ID associated with this payment. + # The SeQura transaction ID associated with this payment. attr_reader :transaction_id def self.inner_class_types @@ -1889,7 +1889,7 @@ def self.field_remappings end class Twint < ::Stripe::StripeObject - # ID of the multi use Mandate generated by the PaymentIntent + # ID of the multi use Mandate generated by the PaymentIntent or SetupIntent. attr_reader :mandate def self.inner_class_types diff --git a/lib/stripe/resources/quote_preview_invoice.rb b/lib/stripe/resources/quote_preview_invoice.rb index 431b9ffd5..38f768d54 100644 --- a/lib/stripe/resources/quote_preview_invoice.rb +++ b/lib/stripe/resources/quote_preview_invoice.rb @@ -172,6 +172,23 @@ def self.field_remappings end end + class CustomerBalance < ::Stripe::StripeObject + # The total amount of customer balance applied to this invoice (automatically + manually). + attr_reader :applied_balance + # The amount of customer balance automatically applied during invoice finalization. + attr_reader :automatically_applied_balance + # The total amount of customer balance manually applied after finalization. + attr_reader :manually_applied_balance + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + class CustomerShipping < ::Stripe::StripeObject class Address < ::Stripe::StripeObject # City, district, suburb, town, or village. @@ -482,6 +499,16 @@ def self.field_remappings end end + class Billie < ::Stripe::StripeObject + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + class Bizum < ::Stripe::StripeObject def self.inner_class_types @inner_class_types = {} @@ -748,6 +775,8 @@ def self.field_remappings attr_reader :acss_debit # If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. attr_reader :bancontact + # If paying by `billie`, this sub-hash contains details about the Billie payment method options to pass to the invoice’s PaymentIntent. + attr_reader :billie # If paying by `bizum`, this sub-hash contains details about the Bizum payment method options to pass to the invoice’s PaymentIntent. attr_reader :bizum # If paying by `blik`, this sub-hash contains details about the Blik payment method options to pass to the invoice’s PaymentIntent. @@ -779,6 +808,7 @@ def self.inner_class_types @inner_class_types = { acss_debit: AcssDebit, bancontact: Bancontact, + billie: Billie, bizum: Bizum, blik: Blik, card: Card, @@ -1119,6 +1149,8 @@ def self.field_remappings attr_reader :customer_account # The customer's address. Until the invoice is finalized, this field will equal `customer.address`. Once the invoice is finalized, this field will no longer be updated. attr_reader :customer_address + # The customer balance amounts applied to this invoice. + attr_reader :customer_balance # The customer's email. Until the invoice is finalized, this field will equal `customer.email`. Once the invoice is finalized, this field will no longer be updated. attr_reader :customer_email # The customer's name. Until the invoice is finalized, this field will equal `customer.name`. Once the invoice is finalized, this field will no longer be updated. @@ -1238,6 +1270,7 @@ def self.inner_class_types confirmation_secret: ConfirmationSecret, custom_fields: CustomField, customer_address: CustomerAddress, + customer_balance: CustomerBalance, customer_shipping: CustomerShipping, customer_tax_ids: CustomerTaxId, from_invoice: FromInvoice, diff --git a/lib/stripe/resources/quote_preview_subscription_schedule.rb b/lib/stripe/resources/quote_preview_subscription_schedule.rb index d44a00c72..57ef87786 100644 --- a/lib/stripe/resources/quote_preview_subscription_schedule.rb +++ b/lib/stripe/resources/quote_preview_subscription_schedule.rb @@ -374,13 +374,44 @@ def self.field_remappings @field_remappings = {} end end + + class Status < ::Stripe::StripeObject + class Error < ::Stripe::StripeObject + # A machine-readable error code. + attr_reader :code + # A description of the error. + attr_reader :message + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + # Attribute for field error + attr_reader :error + # The lifecycle state of the pause operation. + attr_reader :type + + def self.inner_class_types + @inner_class_types = { error: Error } + end + + def self.field_remappings + @field_remappings = {} + end + end # Time at which the subscription pauses. attr_reader :pause_at # Settings controlling billing behavior during the pause. attr_reader :settings + # Attribute for field status + attr_reader :status def self.inner_class_types - @inner_class_types = { settings: Settings } + @inner_class_types = { settings: Settings, status: Status } end def self.field_remappings @@ -405,13 +436,44 @@ def self.field_remappings @field_remappings = {} end end + + class Status < ::Stripe::StripeObject + class Error < ::Stripe::StripeObject + # A machine-readable error code. + attr_reader :code + # A description of the error. + attr_reader :message + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + # Attribute for field error + attr_reader :error + # The lifecycle state of the resume operation. + attr_reader :type + + def self.inner_class_types + @inner_class_types = { error: Error } + end + + def self.field_remappings + @field_remappings = {} + end + end # Time at which the subscription resumes. attr_reader :resume_at # Attribute for field settings attr_reader :settings + # Attribute for field status + attr_reader :status def self.inner_class_types - @inner_class_types = { settings: Settings } + @inner_class_types = { settings: Settings, status: Status } end def self.field_remappings diff --git a/lib/stripe/resources/subscription.rb b/lib/stripe/resources/subscription.rb index 05cb5cecf..372454ea1 100644 --- a/lib/stripe/resources/subscription.rb +++ b/lib/stripe/resources/subscription.rb @@ -346,6 +346,16 @@ def self.field_remappings end end + class Billie < ::Stripe::StripeObject + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + class Bizum < ::Stripe::StripeObject class MandateOptions < ::Stripe::StripeObject # Amount to be charged for future payments. Required when `amount_type=fixed`. @@ -668,6 +678,8 @@ def self.field_remappings attr_reader :acss_debit # This sub-hash contains details about the Bancontact payment method options to pass to invoices created by the subscription. attr_reader :bancontact + # This sub-hash contains details about the Billie payment method options to pass to invoices created by the subscription. + attr_reader :billie # This sub-hash contains details about the Bizum payment method options to pass to invoices created by the subscription. attr_reader :bizum # This sub-hash contains details about the Blik payment method options to pass to invoices created by the subscription. @@ -699,6 +711,7 @@ def self.inner_class_types @inner_class_types = { acss_debit: AcssDebit, bancontact: Bancontact, + billie: Billie, bizum: Bizum, blik: Blik, card: Card, diff --git a/lib/stripe/resources/subscription_schedule.rb b/lib/stripe/resources/subscription_schedule.rb index 35c5c78df..865a02954 100644 --- a/lib/stripe/resources/subscription_schedule.rb +++ b/lib/stripe/resources/subscription_schedule.rb @@ -364,13 +364,44 @@ def self.field_remappings @field_remappings = {} end end + + class Status < ::Stripe::StripeObject + class Error < ::Stripe::StripeObject + # A machine-readable error code. + attr_reader :code + # A description of the error. + attr_reader :message + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + # Attribute for field error + attr_reader :error + # The lifecycle state of the pause operation. + attr_reader :type + + def self.inner_class_types + @inner_class_types = { error: Error } + end + + def self.field_remappings + @field_remappings = {} + end + end # Time at which the subscription pauses. attr_reader :pause_at # Settings controlling billing behavior during the pause. attr_reader :settings + # Attribute for field status + attr_reader :status def self.inner_class_types - @inner_class_types = { settings: Settings } + @inner_class_types = { settings: Settings, status: Status } end def self.field_remappings @@ -395,13 +426,44 @@ def self.field_remappings @field_remappings = {} end end + + class Status < ::Stripe::StripeObject + class Error < ::Stripe::StripeObject + # A machine-readable error code. + attr_reader :code + # A description of the error. + attr_reader :message + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + # Attribute for field error + attr_reader :error + # The lifecycle state of the resume operation. + attr_reader :type + + def self.inner_class_types + @inner_class_types = { error: Error } + end + + def self.field_remappings + @field_remappings = {} + end + end # Time at which the subscription resumes. attr_reader :resume_at # Attribute for field settings attr_reader :settings + # Attribute for field status + attr_reader :status def self.inner_class_types - @inner_class_types = { settings: Settings } + @inner_class_types = { settings: Settings, status: Status } end def self.field_remappings diff --git a/lib/stripe/resources/v2/core/account.rb b/lib/stripe/resources/v2/core/account.rb index e15e247c5..71a4c41cf 100644 --- a/lib/stripe/resources/v2/core/account.rb +++ b/lib/stripe/resources/v2/core/account.rb @@ -19201,23 +19201,23 @@ def self.field_remappings @field_remappings = {} end end - # One or more documents that support the Bank account ownership verification requirement. Must be a document associated with the account’s primary active bank account that displays the last 4 digits of the account number, either a statement or a check. + # One or more documents that support the Bank account ownership verification requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a check. attr_reader :bank_account_ownership_verification - # One or more documents that demonstrate proof of a company’s license to operate. + # One or more documents that demonstrate proof of a company's license to operate. attr_reader :company_license - # One or more documents showing the company’s Memorandum of Association. + # One or more documents showing the company's Memorandum of Association. attr_reader :company_memorandum_of_association - # Certain countries only: One or more documents showing the ministerial decree legalizing the company’s establishment. + # Certain countries only: One or more documents showing the ministerial decree legalizing the company's establishment. attr_reader :company_ministerial_decree - # One or more documents that demonstrate proof of a company’s registration with the appropriate local authorities. + # One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. attr_reader :company_registration_verification - # One or more documents that demonstrate proof of a company’s tax ID. + # One or more documents that demonstrate proof of a company's tax ID. attr_reader :company_tax_id_verification # A document verifying the business. attr_reader :primary_verification # One or more documents that demonstrate proof of address. attr_reader :proof_of_address - # One or more documents showing the company’s proof of registration with the national business registry. + # One or more documents showing the company's proof of registration with the national business registry. attr_reader :proof_of_registration # One or more documents that demonstrate proof of ultimate beneficial ownership. attr_reader :proof_of_ultimate_beneficial_ownership @@ -19392,7 +19392,7 @@ def self.field_remappings end # Additional addresses associated with the business. attr_reader :additional_addresses - # The company’s primary address. + # The company's primary address. attr_reader :address # The business gross annual revenue for its preceding fiscal year. attr_reader :annual_revenue @@ -19406,7 +19406,7 @@ def self.field_remappings attr_reader :id_numbers # An estimate of the monthly revenue of the business. Only accepted for accounts in Brazil and India. attr_reader :monthly_estimated_revenue - # The company’s phone number (used for verification). + # The company's phone number (used for verification). attr_reader :phone # The business legal name. attr_reader :registered_name @@ -19661,13 +19661,13 @@ def self.field_remappings end # One or more documents that demonstrate proof that this person is authorized to represent the company. attr_reader :company_authorization - # One or more documents showing the person’s passport page with photo and personal data. + # One or more documents showing the person's passport page with photo and personal data. attr_reader :passport # An identifying document showing the person's name, either a passport or local ID card. attr_reader :primary_verification # A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. attr_reader :secondary_verification - # One or more documents showing the person’s visa required for living in the country where they are residing. + # One or more documents showing the person's visa required for living in the country where they are residing. attr_reader :visa def self.inner_class_types @@ -19860,7 +19860,7 @@ def self.field_remappings attr_reader :id # The identification numbers (e.g., SSN) associated with the individual. attr_reader :id_numbers - # The individual's gender (International regulations require either "male” or "female"). + # The individual's gender (International regulations require either "male" or "female"). attr_reader :legal_gender # Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. attr_reader :metadata diff --git a/lib/stripe/resources/v2/core/account_person.rb b/lib/stripe/resources/v2/core/account_person.rb index 13c94ee89..7e3f5c2cd 100644 --- a/lib/stripe/resources/v2/core/account_person.rb +++ b/lib/stripe/resources/v2/core/account_person.rb @@ -233,13 +233,13 @@ def self.field_remappings end # One or more documents that demonstrate proof that this person is authorized to represent the company. attr_reader :company_authorization - # One or more documents showing the person’s passport page with photo and personal data. + # One or more documents showing the person's passport page with photo and personal data. attr_reader :passport # An identifying document showing the person's name, either a passport or local ID card. attr_reader :primary_verification # A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. attr_reader :secondary_verification - # One or more documents showing the person’s visa required for living in the country where they are residing. + # One or more documents showing the person's visa required for living in the country where they are residing. attr_reader :visa def self.inner_class_types diff --git a/lib/stripe/resources/v2/core/health/alert.rb b/lib/stripe/resources/v2/core/health/alert.rb index cc2240989..0edd4270b 100644 --- a/lib/stripe/resources/v2/core/health/alert.rb +++ b/lib/stripe/resources/v2/core/health/alert.rb @@ -122,9 +122,11 @@ def self.field_encodings class AuthorizationRateDrop < ::Stripe::StripeObject class Dimension < ::Stripe::StripeObject + # Populated when type is acquirer. + attr_reader :acquirer # Populated when type is issuer. attr_reader :issuer - # The type of the dimension. Determines which field in dimension_details is populated. + # The type of the dimension. Determines which field is populated. attr_reader :type def self.inner_class_types diff --git a/lib/stripe/resources/v2/core/health/alert_history_entry.rb b/lib/stripe/resources/v2/core/health/alert_history_entry.rb index 72721fcfb..8bfb93588 100644 --- a/lib/stripe/resources/v2/core/health/alert_history_entry.rb +++ b/lib/stripe/resources/v2/core/health/alert_history_entry.rb @@ -122,9 +122,11 @@ def self.field_encodings class AuthorizationRateDrop < ::Stripe::StripeObject class Dimension < ::Stripe::StripeObject + # Populated when type is acquirer. + attr_reader :acquirer # Populated when type is issuer. attr_reader :issuer - # The type of the dimension. Determines which field in dimension_details is populated. + # The type of the dimension. Determines which field is populated. attr_reader :type def self.inner_class_types diff --git a/lib/stripe/resources/v2/money_management/payout_intent.rb b/lib/stripe/resources/v2/money_management/payout_intent.rb index 1b91a7fd3..1de4c6d90 100644 --- a/lib/stripe/resources/v2/money_management/payout_intent.rb +++ b/lib/stripe/resources/v2/money_management/payout_intent.rb @@ -11,9 +11,42 @@ def self.object_name "v2.money_management.payout_intent" end + class EstimatedFee < ::Stripe::StripeObject + class TaxAmount < ::Stripe::StripeObject + # Currency code. + attr_reader :currency + # Tax amount value represented as a decimal string in major units. + attr_reader :value_decimal + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + # The fee amount. + attr_reader :amount + # Tax charged for this fee, if applicable. Value expressed as a decimal string in major units. + attr_reader :tax_amount + # Open Enum. The type of fee. + attr_reader :type + + def self.inner_class_types + @inner_class_types = { tax_amount: TaxAmount } + end + + def self.field_remappings + @field_remappings = {} + end + end + class From < ::Stripe::StripeObject # The currency of the financial account. attr_reader :currency + # Estimated amount to be debited from the financial account. + attr_reader :debited # The FinancialAccount that funds are pulled from. attr_reader :financial_account @@ -26,6 +59,40 @@ def self.field_remappings end end + class FxQuote < ::Stripe::StripeObject + class Rates < ::Stripe::StripeObject + # The exchange rate going from_currency -> to_currency, represented as a decimal string + # (e.g., "1.1520") to preserve the full precision of the rate. + attr_reader :exchange_rate + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + # Open Enum. Duration of the FX rate lock. + attr_reader :lock_duration + # Timestamp when the rate lock expires. Null when rate locking is not supported. + attr_reader :lock_expires_at + # Open Enum. Lock status of the FX rate. + attr_reader :lock_status + # Key: source currency. Value: exchange rate from source currency to to_currency. + attr_reader :rates + # The destination currency. + attr_reader :to_currency + + def self.inner_class_types + @inner_class_types = { rates: Rates } + end + + def self.field_remappings + @field_remappings = {} + end + end + class LatestPayout < ::Stripe::StripeObject # The ID of the OutboundPayment, if applicable. attr_reader :outbound_payment @@ -44,6 +111,19 @@ def self.field_remappings end class NextAction < ::Stripe::StripeObject + class Confirm < ::Stripe::StripeObject + # Open Enum. The reason the PayoutIntent requires confirmation. + attr_reader :reason + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + class HandleFailure < ::Stripe::StripeObject # Open Enum. The reason for the failure. attr_reader :failure_reason @@ -56,13 +136,15 @@ def self.field_remappings @field_remappings = {} end end + # Details about a confirmation required. Populated when type is confirm. + attr_reader :confirm # Details about a failure that requires user action. Populated when type is handle_failure. attr_reader :handle_failure # Open Enum. The type of next action required. attr_reader :type def self.inner_class_types - @inner_class_types = { handle_failure: HandleFailure } + @inner_class_types = { confirm: Confirm, handle_failure: HandleFailure } end def self.field_remappings @@ -173,6 +255,8 @@ def self.field_remappings @field_remappings = {} end end + # Estimated amount to be credited to the recipient in the destination currency. + attr_reader :credited # The currency to send to the recipient. attr_reader :currency # The payout method ID. Optional for OutboundPayment if recipient has default payment method. Required for OutboundTransfer. @@ -192,13 +276,19 @@ def self.field_remappings end # The monetary amount to be sent. attr_reader :amount + # Controls whether the intent requires explicit confirmation before transitioning to pending. + attr_reader :confirmation_method # Time at which the PayoutIntent was created. # Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. attr_reader :created # An arbitrary string attached to the PayoutIntent. Often useful for displaying to users. attr_reader :description + # Estimated fees and taxes. + attr_reader :estimated_fees # The FinancialAccount that funds are pulled from. attr_reader :from + # FX rate information for fee transparency. + attr_reader :fx_quote # Unique identifier for the PayoutIntent. attr_reader :id # Details about the latest payout associated with this PayoutIntent. @@ -226,7 +316,9 @@ def self.field_remappings def self.inner_class_types @inner_class_types = { + estimated_fees: EstimatedFee, from: From, + fx_quote: FxQuote, latest_payout: LatestPayout, next_action: NextAction, recipient_notification: RecipientNotification, diff --git a/lib/stripe/resources/v2/payments/off_session_payment.rb b/lib/stripe/resources/v2/payments/off_session_payment.rb index 8020ee047..c913851d3 100644 --- a/lib/stripe/resources/v2/payments/off_session_payment.rb +++ b/lib/stripe/resources/v2/payments/off_session_payment.rb @@ -207,7 +207,7 @@ def self.field_remappings attr_reader :amount_capturable # Provides industry-specific information about the amount. attr_reader :amount_details - # The “presentment amount” to be collected from the customer. + # The "presentment amount" to be collected from the customer. attr_reader :amount_requested # The application associated with this OffSessionPayment. attr_reader :application @@ -253,14 +253,14 @@ def self.field_remappings attr_reader :payments_orchestration # Details about the OffSessionPayment retries. attr_reader :retry_details - # Text that appears on the customer’s statement as the statement descriptor for a - # non-card charge. This value overrides the account’s default statement descriptor. + # Text that appears on the customer's statement as the statement descriptor for a + # non-card charge. This value overrides the account's default statement descriptor. # For information about requirements, including the 22-character limit, see the # [Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). attr_reader :statement_descriptor - # Provides information about a card charge. Concatenated to the account’s + # Provides information about a card charge. Concatenated to the account's # [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) - # to form the complete statement descriptor that appears on the customer’s statement. + # to form the complete statement descriptor that appears on the customer's statement. attr_reader :statement_descriptor_suffix # Status of this OffSessionPayment, one of `pending`, `pending_retry`, `processing`, # `failed`, `canceled`, `requires_capture`, or `succeeded`. diff --git a/lib/stripe/resources/v2/tax/operations_resolve_address_result.rb b/lib/stripe/resources/v2/tax/operations_resolve_address_result.rb new file mode 100644 index 000000000..2a5b707e8 --- /dev/null +++ b/lib/stripe/resources/v2/tax/operations_resolve_address_result.rb @@ -0,0 +1,82 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module V2 + module Tax + # The result of resolving an address to its tax precision level. + class OperationsResolveAddressResult < APIResource + OBJECT_NAME = "v2.tax.operations_resolve_address_result" + def self.object_name + "v2.tax.operations_resolve_address_result" + end + + class Address < ::Stripe::StripeObject + # The city. + attr_reader :city + # The two-letter country code. + attr_reader :country + # The first line of the street address. + attr_reader :line1 + # The postal code. + attr_reader :postal_code + # The state or province. + attr_reader :state + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + + class PrecisionDetails < ::Stripe::StripeObject + class Issue < ::Stripe::StripeObject + # A code describing the issue. + attr_reader :code + # The address field with the issue. + attr_reader :field + + def self.inner_class_types + @inner_class_types = {} + end + + def self.field_remappings + @field_remappings = {} + end + end + # Issues preventing higher precision. + attr_reader :issues + + def self.inner_class_types + @inner_class_types = { issues: Issue } + end + + def self.field_remappings + @field_remappings = {} + end + end + # The normalized form of the input address. + attr_reader :address + # 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 + # String representing the object's type. Objects of the same type share the same value of the object field. + attr_reader :object + # The precision level of the resolved address. + attr_reader :precision + # Details about the precision, including any issues. + attr_reader :precision_details + + def self.inner_class_types + @inner_class_types = { address: Address, precision_details: PrecisionDetails } + end + + def self.field_remappings + @field_remappings = {} + end + end + end + end +end diff --git a/lib/stripe/search_result_object.rb b/lib/stripe/search_result_object.rb index 52a4c5e35..08e8614ee 100644 --- a/lib/stripe/search_result_object.rb +++ b/lib/stripe/search_result_object.rb @@ -71,6 +71,10 @@ def auto_paging_each(&blk) page = page.next_search_result_page break if page.empty? + rescue LocalJumpError => e + raise unless e.reason == :break + + break end end diff --git a/lib/stripe/services.rb b/lib/stripe/services.rb index f2819bea7..942bc6c77 100644 --- a/lib/stripe/services.rb +++ b/lib/stripe/services.rb @@ -551,6 +551,7 @@ module Signals module Tax autoload :ManualRuleService, "stripe/services/v2/tax/manual_rule_service" + autoload :OperationService, "stripe/services/v2/tax/operation_service" end module TestHelpers @@ -913,6 +914,7 @@ module Stripe stripe/services/v2/signals/account_signal_service stripe/services/v2/signals_service stripe/services/v2/tax/manual_rule_service + stripe/services/v2/tax/operation_service stripe/services/v2/tax_service stripe/services/v2/test_helper_service stripe/services/v2/test_helpers/financial_address_service diff --git a/lib/stripe/services/v2/money_management/payout_intent_service.rb b/lib/stripe/services/v2/money_management/payout_intent_service.rb index e9be73990..e3b4ebfe4 100644 --- a/lib/stripe/services/v2/money_management/payout_intent_service.rb +++ b/lib/stripe/services/v2/money_management/payout_intent_service.rb @@ -5,7 +5,7 @@ module Stripe module V2 module MoneyManagement class PayoutIntentService < StripeService - # Cancels a PayoutIntent. Only pending PayoutIntents or processing PayoutIntents with cancelable OutboundPayment/Transfer can be canceled. + # Cancels a PayoutIntent. Only pending PayoutIntents, processing PayoutIntents with cancelable OutboundPayment/Transfer, or requires_action PayoutIntents can be canceled. # # ** raises NotCancelableError def cancel(id, params = {}, opts = {}) @@ -18,6 +18,19 @@ def cancel(id, params = {}, opts = {}) ) end + # Confirms a PayoutIntent that is in the requires_action state, transitioning it to pending. + # + # ** raises FxQuoteNeedsRefreshError + def confirm(id, params = {}, opts = {}) + request( + method: :post, + path: format("/v2/money_management/payout_intents/%s/confirm", { id: CGI.escape(id) }), + params: params, + opts: opts, + base_address: :api + ) + end + # Creates a PayoutIntent. # # ** raises FeatureNotEnabledError @@ -31,6 +44,17 @@ def create(params = {}, opts = {}) ) end + # Refreshes FX quote for a PayoutIntent. + def fx_quote(id, params = {}, opts = {}) + request( + method: :post, + path: format("/v2/money_management/payout_intents/%s/fx_quote", { id: CGI.escape(id) }), + params: params, + opts: opts, + base_address: :api + ) + end + # Returns a list of PayoutIntents. def list(params = {}, opts = {}) request( diff --git a/lib/stripe/services/v2/tax/operation_service.rb b/lib/stripe/services/v2/tax/operation_service.rb new file mode 100644 index 000000000..ffa8aad96 --- /dev/null +++ b/lib/stripe/services/v2/tax/operation_service.rb @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module V2 + module Tax + class OperationService < StripeService + # Resolves an address to its tax precision level. + def resolve_address(params = {}, opts = {}) + request( + method: :post, + path: "/v2/tax/operations/resolve_address", + params: params, + opts: opts, + base_address: :api + ) + end + end + end + end +end diff --git a/lib/stripe/services/v2/tax_service.rb b/lib/stripe/services/v2/tax_service.rb index db56124f8..5d37c3155 100644 --- a/lib/stripe/services/v2/tax_service.rb +++ b/lib/stripe/services/v2/tax_service.rb @@ -4,11 +4,12 @@ module Stripe module V2 class TaxService < StripeService - attr_reader :manual_rules + attr_reader :manual_rules, :operations def initialize(requestor) super @manual_rules = Stripe::V2::Tax::ManualRuleService.new(@requestor) + @operations = Stripe::V2::Tax::OperationService.new(@requestor) end end end diff --git a/lib/stripe/stripe_event_notification_handler.rb b/lib/stripe/stripe_event_notification_handler.rb index 93bfc0c61..8d1bd8653 100644 --- a/lib/stripe/stripe_event_notification_handler.rb +++ b/lib/stripe/stripe_event_notification_handler.rb @@ -140,12 +140,48 @@ def on_v1_balance_available(&handler) register("v1.balance.available", &handler) end + def on_v1_balance_settings_updated(&handler) + raise ArgumentError, "Block required to register event handler" if handler.nil? + + register("v1.balance_settings.updated", &handler) + end + def on_v1_billing_alert_triggered(&handler) raise ArgumentError, "Block required to register event handler" if handler.nil? register("v1.billing.alert.triggered", &handler) end + def on_v1_billing_credit_balance_transaction_created(&handler) + raise ArgumentError, "Block required to register event handler" if handler.nil? + + register("v1.billing.credit_balance_transaction.created", &handler) + end + + def on_v1_billing_credit_grant_created(&handler) + raise ArgumentError, "Block required to register event handler" if handler.nil? + + register("v1.billing.credit_grant.created", &handler) + end + + def on_v1_billing_credit_grant_updated(&handler) + raise ArgumentError, "Block required to register event handler" if handler.nil? + + register("v1.billing.credit_grant.updated", &handler) + end + + def on_v1_billing_meter_created(&handler) + raise ArgumentError, "Block required to register event handler" if handler.nil? + + register("v1.billing.meter.created", &handler) + end + + def on_v1_billing_meter_deactivated(&handler) + raise ArgumentError, "Block required to register event handler" if handler.nil? + + register("v1.billing.meter.deactivated", &handler) + end + def on_v1_billing_meter_error_report_triggered(&handler) raise ArgumentError, "Block required to register event handler" if handler.nil? @@ -158,6 +194,18 @@ def on_v1_billing_meter_no_meter_found(&handler) register("v1.billing.meter.no_meter_found", &handler) end + def on_v1_billing_meter_reactivated(&handler) + raise ArgumentError, "Block required to register event handler" if handler.nil? + + register("v1.billing.meter.reactivated", &handler) + end + + def on_v1_billing_meter_updated(&handler) + raise ArgumentError, "Block required to register event handler" if handler.nil? + + register("v1.billing.meter.updated", &handler) + end + def on_v1_billing_portal_configuration_created(&handler) raise ArgumentError, "Block required to register event handler" if handler.nil? @@ -470,6 +518,12 @@ def on_v1_file_created(&handler) register("v1.file.created", &handler) end + def on_v1_financial_connections_account_account_numbers_updated(&handler) + raise ArgumentError, "Block required to register event handler" if handler.nil? + + register("v1.financial_connections.account.account_numbers_updated", &handler) + end + def on_v1_financial_connections_account_created(&handler) raise ArgumentError, "Block required to register event handler" if handler.nil? @@ -488,6 +542,12 @@ def on_v1_financial_connections_account_disconnected(&handler) register("v1.financial_connections.account.disconnected", &handler) end + def on_v1_financial_connections_account_expected_deactivation_date_updated(&handler) + raise ArgumentError, "Block required to register event handler" if handler.nil? + + register("v1.financial_connections.account.expected_deactivation_date_updated", &handler) + end + def on_v1_financial_connections_account_reactivated(&handler) raise ArgumentError, "Block required to register event handler" if handler.nil? @@ -512,6 +572,24 @@ def on_v1_financial_connections_account_refreshed_transactions(&handler) register("v1.financial_connections.account.refreshed_transactions", &handler) end + def on_v1_financial_connections_account_supported_payment_method_types_updated(&handler) + raise ArgumentError, "Block required to register event handler" if handler.nil? + + register("v1.financial_connections.account.supported_payment_method_types_updated", &handler) + end + + def on_v1_financial_connections_account_upcoming_account_number_expiry(&handler) + raise ArgumentError, "Block required to register event handler" if handler.nil? + + register("v1.financial_connections.account.upcoming_account_number_expiry", &handler) + end + + def on_v1_financial_connections_account_upcoming_deactivation(&handler) + raise ArgumentError, "Block required to register event handler" if handler.nil? + + register("v1.financial_connections.account.upcoming_deactivation", &handler) + end + def on_v1_identity_verification_session_canceled(&handler) raise ArgumentError, "Block required to register event handler" if handler.nil? @@ -602,6 +680,12 @@ def on_v1_invoice_payment_action_required(&handler) register("v1.invoice.payment_action_required", &handler) end + def on_v1_invoice_payment_attempt_required(&handler) + raise ArgumentError, "Block required to register event handler" if handler.nil? + + register("v1.invoice.payment_attempt_required", &handler) + end + def on_v1_invoice_payment_failed(&handler) raise ArgumentError, "Block required to register event handler" if handler.nil? diff --git a/lib/stripe/stripe_object.rb b/lib/stripe/stripe_object.rb index dedc15831..8e413e4f3 100644 --- a/lib/stripe/stripe_object.rb +++ b/lib/stripe/stripe_object.rb @@ -157,9 +157,8 @@ def update_attributes(values, opts = {}, dirty: true) values.each do |k, v| add_accessors([k], values) unless metaclass.method_defined?(k.to_sym) @values[k] = convert_value_with_inner_types(k, v, opts) - if self.class.field_encodings[k.to_sym] == :decimal_string && @values[k].is_a?(String) - @values[k] = BigDecimal(@values[k]) - end + encoding = self.class.field_encodings[k.to_sym] + @values[k] = V2TypeCoercion.coerce_value(@values[k], encoding, direction: :decode) if encoding dirty_value!(@values[k]) if dirty @unsaved_values.add(k) end diff --git a/lib/stripe/v2_list_object.rb b/lib/stripe/v2_list_object.rb index 90744e13a..87db6a576 100644 --- a/lib/stripe/v2_list_object.rb +++ b/lib/stripe/v2_list_object.rb @@ -58,6 +58,10 @@ def auto_paging_each(&blk) break if page.next_page_url.nil? page = page.fetch_next_page + rescue LocalJumpError => e + raise unless e.reason == :break + + break end end diff --git a/lib/stripe/v2_type_coercion.rb b/lib/stripe/v2_type_coercion.rb new file mode 100644 index 000000000..edeb8777c --- /dev/null +++ b/lib/stripe/v2_type_coercion.rb @@ -0,0 +1,102 @@ +# frozen_string_literal: true +# typed: true + +require "bigdecimal" + +module Stripe + # Shared V2 type coercion logic for encoding/decoding values between + # native Ruby types and their wire representations. + # + # Used by RequestParams (encode: native → wire) and StripeObject (decode: wire → native). + module V2TypeCoercion + # Coerce a single value based on its field encoding schema. + # direction: :encode (request: native → wire) or :decode (response: wire → native) + module_function def coerce_value(value, encoding, direction:) + return value if value.nil? + + case encoding + when :int64_string + coerce_int64_string(value, direction) + when :decimal_string + coerce_decimal_string(value, direction) + when Hash + coerce_composite(value, encoding, direction) + else + value + end + end + + # Coerce all fields in a hash according to a schema map. + module_function def coerce_fields(hash, schema, direction:) + return hash unless hash.is_a?(Hash) + return hash if schema.nil? || schema.empty? + + hash.each_with_object({}) do |(k, v), result| + field_encoding = schema[k.to_sym] + result[k] = field_encoding ? coerce_value(v, field_encoding, direction: direction) : v + end + end + + # --- leaf coercions --- + + module_function def coerce_int64_string(value, direction) + case direction + when :encode + case value + when Integer then value.to_s + when Array then value.map { |v| v.is_a?(Integer) ? v.to_s : v } + else value + end + when :decode + case value + when String then Kernel.Integer(value) + when Array then value.map { |v| v.is_a?(String) ? Kernel.Integer(v) : v } + else value + end + else + Kernel.raise ArgumentError, "unknown direction: #{direction.inspect}" + end + end + + module_function def coerce_decimal_string(value, direction) + case direction + when :encode + case value + when BigDecimal then value.to_s("F") + when Integer, Float then value.to_s + when Array then value.map { |v| coerce_decimal_string(v, direction) } + else value + end + when :decode + case value + when String then Kernel.BigDecimal(value) + when Array then value.map { |v| coerce_decimal_string(v, direction) } + else value + end + else + Kernel.raise ArgumentError, "unknown direction: #{direction.inspect}" + end + end + + # --- composite coercions --- + + module_function def coerce_composite(value, encoding, direction) + case encoding[:kind] + when :object + coerce_object(value, encoding[:fields] || {}, direction) + when :array + return value unless value.is_a?(Array) + + value.map { |v| coerce_value(v, encoding[:element], direction: direction) } + else + value + end + end + + module_function def coerce_object(value, fields_schema, direction) + return value unless value.is_a?(Hash) + + coerce_fields(value, fields_schema, direction: direction) + end + end +end diff --git a/rbi/stripe.rbi b/rbi/stripe.rbi index ea7c9ef86..6bc00a921 100644 --- a/rbi/stripe.rbi +++ b/rbi/stripe.rbi @@ -2157,6 +2157,79 @@ module Stripe end end # typed: true +module Stripe + module V2 + module Tax + # The result of resolving an address to its tax precision level. + class OperationsResolveAddressResult < APIResource + class Address < ::Stripe::StripeObject + # The city. + sig { returns(T.nilable(String)) } + def city; end + # The two-letter country code. + sig { returns(T.nilable(String)) } + def country; end + # The first line of the street address. + sig { returns(T.nilable(String)) } + def line1; end + # The postal code. + sig { returns(T.nilable(String)) } + def postal_code; end + # The state or province. + sig { returns(T.nilable(String)) } + def state; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + class PrecisionDetails < ::Stripe::StripeObject + class Issue < ::Stripe::StripeObject + # A code describing the issue. + sig { returns(String) } + def code; end + # The address field with the issue. + sig { returns(String) } + def field; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + # Issues preventing higher precision. + sig { returns(T::Array[Issue]) } + def issues; end + def self.inner_class_types + @inner_class_types = {issues: Issue} + end + def self.field_remappings + @field_remappings = {} + end + end + # The normalized form of the input address. + sig { returns(Address) } + def address; 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 + # 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 + # The precision level of the resolved address. + sig { returns(String) } + def precision; end + # Details about the precision, including any issues. + sig { returns(PrecisionDetails) } + def precision_details; end + end + end + end +end +# typed: true module Stripe module DelegatedCheckout # An order event represents a change to a delegated checkout order. @@ -5034,7 +5107,7 @@ module Stripe # The status of the SEPA Direct Debits payments capability of the account, or whether the account can directly process SEPA Direct Debits charges. sig { returns(T.nilable(String)) } def sepa_debit_payments; end - # The status of the Sequra capability of the account, or whether the account can directly process Sequra payments. + # The status of the SeQura capability of the account, or whether the account can directly process SeQura payments. sig { returns(T.nilable(String)) } def sequra_payments; end # The status of the ShopeePay capability of the account, or whether the account can directly process ShopeePay payments. @@ -10197,6 +10270,14 @@ module Stripe @field_remappings = {} end end + class CustomerUpdate < ::Stripe::StripeObject + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end class SubscriptionCancel < ::Stripe::StripeObject class Retention < ::Stripe::StripeObject class CouponOffer < ::Stripe::StripeObject @@ -10298,6 +10379,9 @@ module Stripe # Attribute for field after_completion sig { returns(AfterCompletion) } def after_completion; end + # Configuration when `flow.type=customer_update`. + sig { returns(T.nilable(CustomerUpdate)) } + def customer_update; end # Configuration when `flow.type=subscription_cancel`. sig { returns(T.nilable(SubscriptionCancel)) } def subscription_cancel; end @@ -10313,6 +10397,7 @@ module Stripe def self.inner_class_types @inner_class_types = { after_completion: AfterCompletion, + customer_update: CustomerUpdate, subscription_cancel: SubscriptionCancel, subscription_update: SubscriptionUpdate, subscription_update_confirm: SubscriptionUpdateConfirm, @@ -12399,9 +12484,9 @@ module Stripe # You could use this attribute to get a sense of international fees. sig { returns(T.nilable(String)) } def country; end - # The pricing bundle applied to this Link payment at confirmation time. Maps to a bundle in your Stripe pricing contract and on Stripe's published pricing page. Omitted if bundle lookup failed at confirmation time. + # The funding source group applied to this Link payment at confirmation time. Maps to a bundle in your Stripe pricing contract and on Stripe's published pricing page. Omitted if group lookup failed at confirmation time. sig { returns(T.nilable(String)) } - def pricing_group; end + def funding_source_group; end def self.inner_class_types @inner_class_types = {} end @@ -12728,7 +12813,7 @@ module Stripe # Uniquely identifies this particular Pix account. You can use this attribute to check whether two Pix accounts are the same. sig { returns(T.nilable(String)) } def fingerprint; end - # ID of the multi use Mandate generated by the PaymentIntent + # ID of the multi use Mandate generated by the PaymentIntent or SetupIntent. sig { returns(T.nilable(String)) } def mandate; end def self.inner_class_types @@ -12908,7 +12993,7 @@ module Stripe end end class Sequra < ::Stripe::StripeObject - # The Sequra transaction ID associated with this payment. + # The SeQura transaction ID associated with this payment. sig { returns(T.nilable(String)) } def transaction_id; end def self.inner_class_types @@ -13022,7 +13107,7 @@ module Stripe end end class Twint < ::Stripe::StripeObject - # ID of the multi use Mandate generated by the PaymentIntent + # ID of the multi use Mandate generated by the PaymentIntent or SetupIntent. sig { returns(T.nilable(String)) } def mandate; end def self.inner_class_types @@ -17085,7 +17170,7 @@ module Stripe # Details about the delivery of carbon removal for this order. sig { returns(T::Array[DeliveryDetail]) } def delivery_details; end - # The year this order is expected to be delivered. + # The year this order is expected to be delivered. If the year is in the past, the order is a spot purchase and will be delivered within 30 days of purchase. sig { returns(Integer) } def expected_delivery_year; end # Unique identifier for the object. @@ -17181,7 +17266,7 @@ module Stripe # Current prices for a metric ton of carbon removal in a currency's smallest unit. sig { returns(T::Hash[String, CurrentPricesPerMetricTon]) } def current_prices_per_metric_ton; end - # The year in which the carbon removal is expected to be delivered. + # The year in which the carbon removal is expected to be delivered. If the year is in the past, this represents spot inventory with guaranteed delivery. sig { returns(T.nilable(Integer)) } def delivery_year; end # Unique identifier for the object. For convenience, Climate product IDs are human-readable strings @@ -20360,6 +20445,9 @@ module Stripe # A bitcoin address sig { returns(T.nilable(String)) } def bitcoin; end + # A Celo address + sig { returns(T.nilable(String)) } + def celo; end # The end customer's crypto wallet destination tag (for each network) to use for this transaction. sig { returns(T.nilable(DestinationTags)) } def destination_tags; end @@ -20566,6 +20654,17 @@ module Stripe @field_remappings = {} end end + class CustomerPortal < ::Stripe::StripeObject + # Whether the customer portal is enabled. + sig { returns(T::Boolean) } + def enabled; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end class CustomerSheet < ::Stripe::StripeObject class Features < ::Stripe::StripeObject # A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the customer sheet displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list. @@ -20737,6 +20836,9 @@ module Stripe # This hash contains whether the buy button is enabled. sig { returns(BuyButton) } def buy_button; end + # This hash contains whether the customer portal is enabled. + sig { returns(CustomerPortal) } + def customer_portal; end # This hash contains whether the customer sheet is enabled and the features it supports. sig { returns(CustomerSheet) } def customer_sheet; end @@ -20755,6 +20857,7 @@ module Stripe def self.inner_class_types @inner_class_types = { buy_button: BuyButton, + customer_portal: CustomerPortal, customer_sheet: CustomerSheet, mobile_payment_element: MobilePaymentElement, payment_element: PaymentElement, @@ -23641,6 +23744,39 @@ module Stripe @field_remappings = {} end end + class ClassificationState < ::Stripe::StripeObject + # The taxonomy classification status for this account. One of 'pending' or 'completed'. + sig { returns(T.nilable(String)) } + def status; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + class EnrichmentState < ::Stripe::StripeObject + class Merchant < ::Stripe::StripeObject + # The merchant enrichment status for this account. One of 'pending' or 'completed'. + sig { returns(T.nilable(String)) } + def status; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + # The enrichment status for merchant name normalization. + sig { returns(T.nilable(Merchant)) } + def merchant; end + def self.inner_class_types + @inner_class_types = {merchant: Merchant} + end + def self.field_remappings + @field_remappings = {} + end + end class InferredBalancesRefresh < ::Stripe::StripeObject # The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch. sig { returns(Integer) } @@ -23758,12 +23894,18 @@ module Stripe # The type of the account. Account category is further divided in `subcategory`. sig { returns(String) } def category; end + # Per-taxonomy processing state for this account. One entry per subscribed taxonomy. + sig { returns(T.nilable(T::Hash[String, ClassificationState])) } + def classification_state; end # Time at which the object was created. Measured in seconds since the Unix epoch. sig { returns(Integer) } def created; end # A human-readable name that has been assigned to this account, either by the account holder or by the institution. sig { returns(T.nilable(String)) } def display_name; end + # The state of merchant name enrichment for this account. + sig { returns(T.nilable(EnrichmentState)) } + def enrichment_state; end # Unique identifier for the object. sig { returns(String) } def id; end @@ -24149,6 +24291,9 @@ module Stripe # List of countries from which to filter accounts. sig { returns(T.nilable(T::Array[String])) } def countries; end + # Country from which to filter accounts. + sig { returns(T.nilable(String)) } + def country; end # Stripe ID of the institution with which the customer should be directed to log in. sig { returns(T.nilable(String)) } def institution; end @@ -24343,6 +24488,82 @@ module Stripe module FinancialConnections # A Transaction represents a real transaction that affects a Financial Connections Account balance. class Transaction < APIResource + class Classification < ::Stripe::StripeObject + class MoneyMovement < ::Stripe::StripeObject + # Stripe's confidence in this classification. + sig { returns(T.nilable(String)) } + def confidence_level; end + # The detailed category label for this transaction. + sig { returns(T.nilable(String)) } + def detailed_label; end + # The primary category label for this transaction. + sig { returns(T.nilable(String)) } + def primary_label; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + class PersonalFinance < ::Stripe::StripeObject + # Stripe's confidence in this classification. + sig { returns(T.nilable(String)) } + def confidence_level; end + # The detailed category label for this transaction. + sig { returns(T.nilable(String)) } + def detailed_label; end + # The primary category label for this transaction. + sig { returns(T.nilable(String)) } + def primary_label; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + # Money movement classification labels for this transaction. + sig { returns(T.nilable(MoneyMovement)) } + def money_movement; end + # Personal finance classification labels for this transaction. + sig { returns(T.nilable(PersonalFinance)) } + def personal_finance; end + # The taxonomy type for this classification entry. + sig { returns(String) } + def type; end + def self.inner_class_types + @inner_class_types = {money_movement: MoneyMovement, personal_finance: PersonalFinance} + end + def self.field_remappings + @field_remappings = {} + end + end + class Enrichments < ::Stripe::StripeObject + class Merchant < ::Stripe::StripeObject + # Stripe's confidence in the enriched merchant name. + sig { returns(T.nilable(String)) } + def confidence_level; end + # The normalized merchant name for this transaction. + sig { returns(T.nilable(String)) } + def name; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + # Attribute for field merchant + sig { returns(Merchant) } + def merchant; end + def self.inner_class_types + @inner_class_types = {merchant: Merchant} + end + def self.field_remappings + @field_remappings = {} + end + end class StatusTransitions < ::Stripe::StripeObject # Time at which this transaction posted. Measured in seconds since the Unix epoch. sig { returns(T.nilable(Integer)) } @@ -24363,12 +24584,18 @@ module Stripe # The amount of this transaction, in cents (or local equivalent). sig { returns(Integer) } def amount; end + # Classification labels for this transaction, one entry per subscribed use case. + sig { returns(T.nilable(T::Array[Classification])) } + def classifications; end # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). sig { returns(String) } def currency; end # The description of this transaction. sig { returns(String) } def description; end + # Enriched merchant information for this transaction. + sig { returns(T.nilable(Enrichments)) } + def enrichments; end # Unique identifier for the object. sig { returns(String) } def id; end @@ -26660,6 +26887,23 @@ module Stripe @field_remappings = {} end end + class CustomerBalance < ::Stripe::StripeObject + # The total amount of customer balance applied to this invoice (automatically + manually). + sig { returns(Integer) } + def applied_balance; end + # The amount of customer balance automatically applied during invoice finalization. + sig { returns(Integer) } + def automatically_applied_balance; end + # The total amount of customer balance manually applied after finalization. + sig { returns(Integer) } + def manually_applied_balance; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end class CustomerShipping < ::Stripe::StripeObject class Address < ::Stripe::StripeObject # City, district, suburb, town, or village. @@ -26984,6 +27228,14 @@ module Stripe @field_remappings = {} end end + class Billie < ::Stripe::StripeObject + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end class Bizum < ::Stripe::StripeObject def self.inner_class_types @inner_class_types = {} @@ -27234,6 +27486,9 @@ module Stripe # If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. sig { returns(T.nilable(Bancontact)) } def bancontact; end + # If paying by `billie`, this sub-hash contains details about the Billie payment method options to pass to the invoice’s PaymentIntent. + sig { returns(T.nilable(Billie)) } + def billie; end # If paying by `bizum`, this sub-hash contains details about the Bizum payment method options to pass to the invoice’s PaymentIntent. sig { returns(T.nilable(Bizum)) } def bizum; end @@ -27277,6 +27532,7 @@ module Stripe @inner_class_types = { acss_debit: AcssDebit, bancontact: Bancontact, + billie: Billie, bizum: Bizum, blik: Blik, card: Card, @@ -27656,6 +27912,9 @@ module Stripe # The customer's address. Until the invoice is finalized, this field will equal `customer.address`. Once the invoice is finalized, this field will no longer be updated. sig { returns(T.nilable(CustomerAddress)) } def customer_address; end + # The customer balance amounts applied to this invoice. + sig { returns(T.nilable(CustomerBalance)) } + def customer_balance; end # The customer's email. Until the invoice is finalized, this field will equal `customer.email`. Once the invoice is finalized, this field will no longer be updated. sig { returns(T.nilable(String)) } def customer_email; end @@ -29188,6 +29447,62 @@ module Stripe @field_remappings = {} end end + class HoldAmount < ::Stripe::StripeObject + # Three-letter ISO currency code. + sig { returns(String) } + def currency; end + # The amount in the smallest currency unit. + sig { returns(Integer) } + def value; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + class HoldAmountDetails < ::Stripe::StripeObject + class Network < ::Stripe::StripeObject + # Three-letter ISO currency code. + sig { returns(String) } + def currency; end + # The amount in the smallest currency unit. + sig { returns(Integer) } + def value; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + class Reserve < ::Stripe::StripeObject + # Three-letter ISO currency code. + sig { returns(String) } + def currency; end + # The amount in the smallest currency unit. + sig { returns(Integer) } + def value; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + # Attribute for field network + sig { returns(Network) } + def network; end + # The reserve amount held for this authorization. Present for certain MCCs that may have overcaptures. + sig { returns(T.nilable(Reserve)) } + def reserve; end + def self.inner_class_types + @inner_class_types = {network: Network, reserve: Reserve} + end + def self.field_remappings + @field_remappings = {} + end + end # The additional amount Stripe will hold if the authorization is approved, in the card's [currency](https://docs.stripe.com/api#issuing_authorization_object-pending-request-currency) and in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). sig { returns(Integer) } def amount; end @@ -29197,6 +29512,12 @@ module Stripe # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). sig { returns(String) } def currency; end + # The total amount to be held for this authorization request. + sig { returns(T.nilable(HoldAmount)) } + def hold_amount; end + # Breakdown of the amounts contributing to hold_amount. + sig { returns(T.nilable(HoldAmountDetails)) } + def hold_amount_details; end # If set `true`, you may provide [amount](https://docs.stripe.com/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. sig { returns(T::Boolean) } def is_amount_controllable; end @@ -29210,7 +29531,11 @@ module Stripe sig { returns(T.nilable(Integer)) } def network_risk_score; end def self.inner_class_types - @inner_class_types = {amount_details: AmountDetails} + @inner_class_types = { + amount_details: AmountDetails, + hold_amount: HoldAmount, + hold_amount_details: HoldAmountDetails, + } end def self.field_remappings @field_remappings = {} @@ -29242,6 +29567,62 @@ module Stripe @field_remappings = {} end end + class HoldAmount < ::Stripe::StripeObject + # Three-letter ISO currency code. + sig { returns(String) } + def currency; end + # The amount in the smallest currency unit. + sig { returns(Integer) } + def value; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + class HoldAmountDetails < ::Stripe::StripeObject + class Network < ::Stripe::StripeObject + # Three-letter ISO currency code. + sig { returns(String) } + def currency; end + # The amount in the smallest currency unit. + sig { returns(Integer) } + def value; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + class Reserve < ::Stripe::StripeObject + # Three-letter ISO currency code. + sig { returns(String) } + def currency; end + # The amount in the smallest currency unit. + sig { returns(Integer) } + def value; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + # Attribute for field network + sig { returns(Network) } + def network; end + # The reserve amount held for this authorization. Present for certain MCCs that may have overcaptures. + sig { returns(T.nilable(Reserve)) } + def reserve; end + def self.inner_class_types + @inner_class_types = {network: Network, reserve: Reserve} + end + def self.field_remappings + @field_remappings = {} + end + end class NetworkData < ::Stripe::StripeObject class TraceId < ::Stripe::StripeObject # The unique reference number within the specified financial network on the specified network date. @@ -29288,6 +29669,12 @@ module Stripe # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). sig { returns(String) } def currency; end + # The total amount that was held for this authorization request. + sig { returns(T.nilable(HoldAmount)) } + def hold_amount; end + # Breakdown of the amounts contributing to hold_amount. + sig { returns(T.nilable(HoldAmountDetails)) } + def hold_amount_details; end # The `pending_request.merchant_amount` at the time of the request, presented in the `merchant_currency` and in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). sig { returns(Integer) } def merchant_amount; end @@ -29310,7 +29697,12 @@ module Stripe sig { returns(T.nilable(Integer)) } def requested_at; end def self.inner_class_types - @inner_class_types = {amount_details: AmountDetails, network_data: NetworkData} + @inner_class_types = { + amount_details: AmountDetails, + hold_amount: HoldAmount, + hold_amount_details: HoldAmountDetails, + network_data: NetworkData, + } end def self.field_remappings @field_remappings = {} @@ -29949,7 +30341,7 @@ module Stripe # The cardholder's phone number. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://docs.stripe.com/issuing/3d-secure#when-is-3d-secure-applied) for more details. sig { returns(T.nilable(String)) } def phone_number; end - # The cardholder’s preferred locales (languages), ordered by preference. Locales can be `da`, `de`, `en`, `es`, `fr`, `it`, `pl`, or `sv`. + # The cardholder’s preferred locales (languages), ordered by preference. Locales can be `de`, `en`, `es`, `fr`, or `it`. # This changes the language of the [3D Secure flow](https://docs.stripe.com/issuing/3d-secure) and one-time password messages sent to the cardholder. sig { returns(T.nilable(T::Array[String])) } def preferred_locales; end @@ -35559,7 +35951,7 @@ module Stripe # Unique transaction id generated by BCB sig { returns(T.nilable(String)) } def bank_transaction_id; end - # ID of the multi use Mandate generated by the PaymentIntent + # ID of the multi use Mandate generated by the PaymentIntent or SetupIntent. sig { returns(T.nilable(String)) } def mandate; end def self.inner_class_types @@ -35739,7 +36131,7 @@ module Stripe end end class Sequra < ::Stripe::StripeObject - # The Sequra transaction ID associated with this payment. + # The SeQura transaction ID associated with this payment. sig { returns(T.nilable(String)) } def transaction_id; end def self.inner_class_types @@ -35851,7 +36243,7 @@ module Stripe end end class Twint < ::Stripe::StripeObject - # ID of the multi use Mandate generated by the PaymentIntent + # ID of the multi use Mandate generated by the PaymentIntent or SetupIntent. sig { returns(T.nilable(String)) } def mandate; end def self.inner_class_types @@ -41460,6 +41852,15 @@ module Stripe # Controls when the funds will be captured from the customer's account. sig { returns(T.nilable(String)) } def capture_method; end + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(T.nilable(String)) } + def setup_future_usage; end def self.inner_class_types @inner_class_types = {} end @@ -50145,7 +50546,7 @@ module Stripe # Unique transaction id generated by BCB sig { returns(T.nilable(String)) } def bank_transaction_id; end - # ID of the multi use Mandate generated by the PaymentIntent + # ID of the multi use Mandate generated by the PaymentIntent or SetupIntent. sig { returns(T.nilable(String)) } def mandate; end def self.inner_class_types @@ -50325,7 +50726,7 @@ module Stripe end end class Sequra < ::Stripe::StripeObject - # The Sequra transaction ID associated with this payment. + # The SeQura transaction ID associated with this payment. sig { returns(T.nilable(String)) } def transaction_id; end def self.inner_class_types @@ -50437,7 +50838,7 @@ module Stripe end end class Twint < ::Stripe::StripeObject - # ID of the multi use Mandate generated by the PaymentIntent + # ID of the multi use Mandate generated by the PaymentIntent or SetupIntent. sig { returns(T.nilable(String)) } def mandate; end def self.inner_class_types @@ -53987,6 +54388,23 @@ module Stripe @field_remappings = {} end end + class CustomerBalance < ::Stripe::StripeObject + # The total amount of customer balance applied to this invoice (automatically + manually). + sig { returns(Integer) } + def applied_balance; end + # The amount of customer balance automatically applied during invoice finalization. + sig { returns(Integer) } + def automatically_applied_balance; end + # The total amount of customer balance manually applied after finalization. + sig { returns(Integer) } + def manually_applied_balance; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end class CustomerShipping < ::Stripe::StripeObject class Address < ::Stripe::StripeObject # City, district, suburb, town, or village. @@ -54311,6 +54729,14 @@ module Stripe @field_remappings = {} end end + class Billie < ::Stripe::StripeObject + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end class Bizum < ::Stripe::StripeObject def self.inner_class_types @inner_class_types = {} @@ -54561,6 +54987,9 @@ module Stripe # If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. sig { returns(T.nilable(Bancontact)) } def bancontact; end + # If paying by `billie`, this sub-hash contains details about the Billie payment method options to pass to the invoice’s PaymentIntent. + sig { returns(T.nilable(Billie)) } + def billie; end # If paying by `bizum`, this sub-hash contains details about the Bizum payment method options to pass to the invoice’s PaymentIntent. sig { returns(T.nilable(Bizum)) } def bizum; end @@ -54604,6 +55033,7 @@ module Stripe @inner_class_types = { acss_debit: AcssDebit, bancontact: Bancontact, + billie: Billie, bizum: Bizum, blik: Blik, card: Card, @@ -54980,6 +55410,9 @@ module Stripe # The customer's address. Until the invoice is finalized, this field will equal `customer.address`. Once the invoice is finalized, this field will no longer be updated. sig { returns(T.nilable(CustomerAddress)) } def customer_address; end + # The customer balance amounts applied to this invoice. + sig { returns(T.nilable(CustomerBalance)) } + def customer_balance; end # The customer's email. Until the invoice is finalized, this field will equal `customer.email`. Once the invoice is finalized, this field will no longer be updated. sig { returns(T.nilable(String)) } def customer_email; end @@ -55524,14 +55957,45 @@ module Stripe @field_remappings = {} end end + class Status < ::Stripe::StripeObject + class Error < ::Stripe::StripeObject + # A machine-readable error code. + sig { returns(T.nilable(String)) } + def code; end + # A description of the error. + sig { returns(String) } + def message; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + # Attribute for field error + sig { returns(T.nilable(Error)) } + def error; end + # The lifecycle state of the pause operation. + sig { returns(String) } + def type; end + def self.inner_class_types + @inner_class_types = {error: Error} + end + def self.field_remappings + @field_remappings = {} + end + end # Time at which the subscription pauses. sig { returns(Integer) } def pause_at; end # Settings controlling billing behavior during the pause. sig { returns(T.nilable(Settings)) } def settings; end + # Attribute for field status + sig { returns(Status) } + def status; end def self.inner_class_types - @inner_class_types = {settings: Settings} + @inner_class_types = {settings: Settings, status: Status} end def self.field_remappings @field_remappings = {} @@ -55555,14 +56019,45 @@ module Stripe @field_remappings = {} end end + class Status < ::Stripe::StripeObject + class Error < ::Stripe::StripeObject + # A machine-readable error code. + sig { returns(T.nilable(String)) } + def code; end + # A description of the error. + sig { returns(String) } + def message; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + # Attribute for field error + sig { returns(T.nilable(Error)) } + def error; end + # The lifecycle state of the resume operation. + sig { returns(String) } + def type; end + def self.inner_class_types + @inner_class_types = {error: Error} + end + def self.field_remappings + @field_remappings = {} + end + end # Time at which the subscription resumes. sig { returns(Integer) } def resume_at; end # Attribute for field settings sig { returns(Settings) } def settings; end + # Attribute for field status + sig { returns(Status) } + def status; end def self.inner_class_types - @inner_class_types = {settings: Settings} + @inner_class_types = {settings: Settings, status: Status} end def self.field_remappings @field_remappings = {} @@ -63509,14 +64004,45 @@ module Stripe @field_remappings = {} end end + class Status < ::Stripe::StripeObject + class Error < ::Stripe::StripeObject + # A machine-readable error code. + sig { returns(T.nilable(String)) } + def code; end + # A description of the error. + sig { returns(String) } + def message; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + # Attribute for field error + sig { returns(T.nilable(Error)) } + def error; end + # The lifecycle state of the pause operation. + sig { returns(String) } + def type; end + def self.inner_class_types + @inner_class_types = {error: Error} + end + def self.field_remappings + @field_remappings = {} + end + end # Time at which the subscription pauses. sig { returns(Integer) } def pause_at; end # Settings controlling billing behavior during the pause. sig { returns(T.nilable(Settings)) } def settings; end + # Attribute for field status + sig { returns(Status) } + def status; end def self.inner_class_types - @inner_class_types = {settings: Settings} + @inner_class_types = {settings: Settings, status: Status} end def self.field_remappings @field_remappings = {} @@ -63540,14 +64066,45 @@ module Stripe @field_remappings = {} end end + class Status < ::Stripe::StripeObject + class Error < ::Stripe::StripeObject + # A machine-readable error code. + sig { returns(T.nilable(String)) } + def code; end + # A description of the error. + sig { returns(String) } + def message; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + # Attribute for field error + sig { returns(T.nilable(Error)) } + def error; end + # The lifecycle state of the resume operation. + sig { returns(String) } + def type; end + def self.inner_class_types + @inner_class_types = {error: Error} + end + def self.field_remappings + @field_remappings = {} + end + end # Time at which the subscription resumes. sig { returns(Integer) } def resume_at; end # Attribute for field settings sig { returns(Settings) } def settings; end + # Attribute for field status + sig { returns(Status) } + def status; end def self.inner_class_types - @inner_class_types = {settings: Settings} + @inner_class_types = {settings: Settings, status: Status} end def self.field_remappings @field_remappings = {} @@ -64638,6 +65195,14 @@ module Stripe @field_remappings = {} end end + class Billie < ::Stripe::StripeObject + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end class Bizum < ::Stripe::StripeObject class MandateOptions < ::Stripe::StripeObject # Amount to be charged for future payments. Required when `amount_type=fixed`. @@ -64948,6 +65513,9 @@ module Stripe # This sub-hash contains details about the Bancontact payment method options to pass to invoices created by the subscription. sig { returns(T.nilable(Bancontact)) } def bancontact; end + # This sub-hash contains details about the Billie payment method options to pass to invoices created by the subscription. + sig { returns(T.nilable(Billie)) } + def billie; end # This sub-hash contains details about the Bizum payment method options to pass to invoices created by the subscription. sig { returns(T.nilable(Bizum)) } def bizum; end @@ -64991,6 +65559,7 @@ module Stripe @inner_class_types = { acss_debit: AcssDebit, bancontact: Bancontact, + billie: Billie, bizum: Bizum, blik: Blik, card: Card, @@ -98330,22 +98899,22 @@ module Stripe @field_remappings = {} end end - # One or more documents that support the Bank account ownership verification requirement. Must be a document associated with the account’s primary active bank account that displays the last 4 digits of the account number, either a statement or a check. + # One or more documents that support the Bank account ownership verification requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a check. sig { returns(T.nilable(BankAccountOwnershipVerification)) } def bank_account_ownership_verification; end - # One or more documents that demonstrate proof of a company’s license to operate. + # One or more documents that demonstrate proof of a company's license to operate. sig { returns(T.nilable(CompanyLicense)) } def company_license; end - # One or more documents showing the company’s Memorandum of Association. + # One or more documents showing the company's Memorandum of Association. sig { returns(T.nilable(CompanyMemorandumOfAssociation)) } def company_memorandum_of_association; end - # Certain countries only: One or more documents showing the ministerial decree legalizing the company’s establishment. + # Certain countries only: One or more documents showing the ministerial decree legalizing the company's establishment. sig { returns(T.nilable(CompanyMinisterialDecree)) } def company_ministerial_decree; end - # One or more documents that demonstrate proof of a company’s registration with the appropriate local authorities. + # One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. sig { returns(T.nilable(CompanyRegistrationVerification)) } def company_registration_verification; end - # One or more documents that demonstrate proof of a company’s tax ID. + # One or more documents that demonstrate proof of a company's tax ID. sig { returns(T.nilable(CompanyTaxIdVerification)) } def company_tax_id_verification; end # A document verifying the business. @@ -98354,7 +98923,7 @@ module Stripe # One or more documents that demonstrate proof of address. sig { returns(T.nilable(ProofOfAddress)) } def proof_of_address; end - # One or more documents showing the company’s proof of registration with the national business registry. + # One or more documents showing the company's proof of registration with the national business registry. sig { returns(T.nilable(ProofOfRegistration)) } def proof_of_registration; end # One or more documents that demonstrate proof of ultimate beneficial ownership. @@ -98531,7 +99100,7 @@ module Stripe # Additional addresses associated with the business. sig { returns(T.nilable(T::Array[AdditionalAddress])) } def additional_addresses; end - # The company’s primary address. + # The company's primary address. sig { returns(T.nilable(Address)) } def address; end # The business gross annual revenue for its preceding fiscal year. @@ -98552,7 +99121,7 @@ module Stripe # An estimate of the monthly revenue of the business. Only accepted for accounts in Brazil and India. sig { returns(T.nilable(MonthlyEstimatedRevenue)) } def monthly_estimated_revenue; end - # The company’s phone number (used for verification). + # The company's phone number (used for verification). sig { returns(T.nilable(String)) } def phone; end # The business legal name. @@ -98816,7 +99385,7 @@ module Stripe # One or more documents that demonstrate proof that this person is authorized to represent the company. sig { returns(T.nilable(CompanyAuthorization)) } def company_authorization; end - # One or more documents showing the person’s passport page with photo and personal data. + # One or more documents showing the person's passport page with photo and personal data. sig { returns(T.nilable(Passport)) } def passport; end # An identifying document showing the person's name, either a passport or local ID card. @@ -98825,7 +99394,7 @@ module Stripe # A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. sig { returns(T.nilable(SecondaryVerification)) } def secondary_verification; end - # One or more documents showing the person’s visa required for living in the country where they are residing. + # One or more documents showing the person's visa required for living in the country where they are residing. sig { returns(T.nilable(Visa)) } def visa; end def self.inner_class_types @@ -99037,7 +99606,7 @@ module Stripe # The identification numbers (e.g., SSN) associated with the individual. sig { returns(T.nilable(T::Array[IdNumber])) } def id_numbers; end - # The individual's gender (International regulations require either "male” or "female"). + # The individual's gender (International regulations require either "male" or "female"). sig { returns(T.nilable(String)) } def legal_gender; end # Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. @@ -99627,7 +100196,7 @@ module Stripe # One or more documents that demonstrate proof that this person is authorized to represent the company. sig { returns(T.nilable(CompanyAuthorization)) } def company_authorization; end - # One or more documents showing the person’s passport page with photo and personal data. + # One or more documents showing the person's passport page with photo and personal data. sig { returns(T.nilable(Passport)) } def passport; end # An identifying document showing the person's name, either a passport or local ID card. @@ -99636,7 +100205,7 @@ module Stripe # A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. sig { returns(T.nilable(SecondaryVerification)) } def secondary_verification; end - # One or more documents showing the person’s visa required for living in the country where they are residing. + # One or more documents showing the person's visa required for living in the country where they are residing. sig { returns(T.nilable(Visa)) } def visa; end def self.inner_class_types @@ -101580,10 +102149,13 @@ module Stripe end class AuthorizationRateDrop < ::Stripe::StripeObject class Dimension < ::Stripe::StripeObject + # Populated when type is acquirer. + sig { returns(T.nilable(String)) } + def acquirer; end # Populated when type is issuer. sig { returns(T.nilable(String)) } def issuer; end - # The type of the dimension. Determines which field in dimension_details is populated. + # The type of the dimension. Determines which field is populated. sig { returns(String) } def type; end def self.inner_class_types @@ -102093,10 +102665,13 @@ module Stripe end class AuthorizationRateDrop < ::Stripe::StripeObject class Dimension < ::Stripe::StripeObject + # Populated when type is acquirer. + sig { returns(T.nilable(String)) } + def acquirer; end # Populated when type is issuer. sig { returns(T.nilable(String)) } def issuer; end - # The type of the dimension. Determines which field in dimension_details is populated. + # The type of the dimension. Determines which field is populated. sig { returns(String) } def type; end def self.inner_class_types @@ -105270,10 +105845,44 @@ module Stripe module MoneyManagement # PayoutIntent represents an intent to send funds from a Financial Account to a payout method. class PayoutIntent < APIResource + class EstimatedFee < ::Stripe::StripeObject + class TaxAmount < ::Stripe::StripeObject + # Currency code. + sig { returns(String) } + def currency; end + # Tax amount value represented as a decimal string in major units. + sig { returns(String) } + def value_decimal; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + # The fee amount. + sig { returns(::Stripe::V2::Amount) } + def amount; end + # Tax charged for this fee, if applicable. Value expressed as a decimal string in major units. + sig { returns(T.nilable(TaxAmount)) } + def tax_amount; end + # Open Enum. The type of fee. + sig { returns(String) } + def type; end + def self.inner_class_types + @inner_class_types = {tax_amount: TaxAmount} + end + def self.field_remappings + @field_remappings = {} + end + end class From < ::Stripe::StripeObject # The currency of the financial account. sig { returns(String) } def currency; end + # Estimated amount to be debited from the financial account. + sig { returns(T.nilable(::Stripe::V2::Amount)) } + def debited; end # The FinancialAccount that funds are pulled from. sig { returns(String) } def financial_account; end @@ -105284,6 +105893,41 @@ module Stripe @field_remappings = {} end end + class FxQuote < ::Stripe::StripeObject + class Rates < ::Stripe::StripeObject + # The exchange rate going from_currency -> to_currency, represented as a decimal string + # (e.g., "1.1520") to preserve the full precision of the rate. + sig { returns(String) } + def exchange_rate; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + # Open Enum. Duration of the FX rate lock. + sig { returns(String) } + def lock_duration; end + # Timestamp when the rate lock expires. Null when rate locking is not supported. + sig { returns(T.nilable(String)) } + def lock_expires_at; end + # Open Enum. Lock status of the FX rate. + sig { returns(String) } + def lock_status; end + # Key: source currency. Value: exchange rate from source currency to to_currency. + sig { returns(T::Hash[String, Rates]) } + def rates; end + # The destination currency. + sig { returns(String) } + def to_currency; end + def self.inner_class_types + @inner_class_types = {rates: Rates} + end + def self.field_remappings + @field_remappings = {} + end + end class LatestPayout < ::Stripe::StripeObject # The ID of the OutboundPayment, if applicable. sig { returns(T.nilable(String)) } @@ -105302,6 +105946,17 @@ module Stripe end end class NextAction < ::Stripe::StripeObject + class Confirm < ::Stripe::StripeObject + # Open Enum. The reason the PayoutIntent requires confirmation. + sig { returns(String) } + def reason; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end class HandleFailure < ::Stripe::StripeObject # Open Enum. The reason for the failure. sig { returns(String) } @@ -105313,6 +105968,9 @@ module Stripe @field_remappings = {} end end + # Details about a confirmation required. Populated when type is confirm. + sig { returns(T.nilable(Confirm)) } + def confirm; end # Details about a failure that requires user action. Populated when type is handle_failure. sig { returns(T.nilable(HandleFailure)) } def handle_failure; end @@ -105320,7 +105978,7 @@ module Stripe sig { returns(String) } def type; end def self.inner_class_types - @inner_class_types = {handle_failure: HandleFailure} + @inner_class_types = {confirm: Confirm, handle_failure: HandleFailure} end def self.field_remappings @field_remappings = {} @@ -105424,6 +106082,9 @@ module Stripe @field_remappings = {} end end + # Estimated amount to be credited to the recipient in the destination currency. + sig { returns(T.nilable(::Stripe::V2::Amount)) } + def credited; end # The currency to send to the recipient. sig { returns(T.nilable(String)) } def currency; end @@ -105446,6 +106107,9 @@ module Stripe # The monetary amount to be sent. sig { returns(::Stripe::V2::Amount) } def amount; end + # Controls whether the intent requires explicit confirmation before transitioning to pending. + sig { returns(String) } + def confirmation_method; end # Time at which the PayoutIntent was created. # Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. sig { returns(String) } @@ -105453,9 +106117,15 @@ module Stripe # An arbitrary string attached to the PayoutIntent. Often useful for displaying to users. sig { returns(T.nilable(String)) } def description; end + # Estimated fees and taxes. + sig { returns(T.nilable(T::Array[EstimatedFee])) } + def estimated_fees; end # The FinancialAccount that funds are pulled from. sig { returns(From) } def from; end + # FX rate information for fee transparency. + sig { returns(T.nilable(FxQuote)) } + def fx_quote; end # Unique identifier for the PayoutIntent. sig { returns(String) } def id; end @@ -107433,7 +108103,7 @@ module Stripe # Provides industry-specific information about the amount. sig { returns(T.nilable(AmountDetails)) } def amount_details; end - # The “presentment amount” to be collected from the customer. + # The "presentment amount" to be collected from the customer. sig { returns(::Stripe::V2::Amount) } def amount_requested; end # The application associated with this OffSessionPayment. @@ -107500,15 +108170,15 @@ module Stripe # Details about the OffSessionPayment retries. sig { returns(RetryDetails) } def retry_details; end - # Text that appears on the customer’s statement as the statement descriptor for a - # non-card charge. This value overrides the account’s default statement descriptor. + # Text that appears on the customer's statement as the statement descriptor for a + # non-card charge. This value overrides the account's default statement descriptor. # For information about requirements, including the 22-character limit, see the # [Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). sig { returns(T.nilable(String)) } def statement_descriptor; end - # Provides information about a card charge. Concatenated to the account’s + # Provides information about a card charge. Concatenated to the account's # [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) - # to form the complete statement descriptor that appears on the customer’s statement. + # to form the complete statement descriptor that appears on the customer's statement. sig { returns(T.nilable(String)) } def statement_descriptor_suffix; end # Status of this OffSessionPayment, one of `pending`, `pending_retry`, `processing`, @@ -117668,7 +118338,7 @@ module Stripe module V2 module MoneyManagement class PayoutIntentService < StripeService - # Cancels a PayoutIntent. Only pending PayoutIntents or processing PayoutIntents with cancelable OutboundPayment/Transfer can be canceled. + # Cancels a PayoutIntent. Only pending PayoutIntents, processing PayoutIntents with cancelable OutboundPayment/Transfer, or requires_action PayoutIntents can be canceled. # # ** raises NotCancelableError sig { @@ -117676,6 +118346,14 @@ module Stripe } def cancel(id, params = {}, opts = {}); end + # Confirms a PayoutIntent that is in the requires_action state, transitioning it to pending. + # + # ** raises FxQuoteNeedsRefreshError + sig { + params(id: String, params: T.any(::Stripe::V2::MoneyManagement::PayoutIntentConfirmParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::MoneyManagement::PayoutIntent) + } + def confirm(id, params = {}, opts = {}); end + # Creates a PayoutIntent. # # ** raises FeatureNotEnabledError @@ -117684,6 +118362,12 @@ module Stripe } def create(params = {}, opts = {}); end + # Refreshes FX quote for a PayoutIntent. + sig { + params(id: String, params: T.any(::Stripe::V2::MoneyManagement::PayoutIntentFxQuoteParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::MoneyManagement::PayoutIntent) + } + def fx_quote(id, params = {}, opts = {}); end + # Returns a list of PayoutIntents. sig { params(params: T.any(::Stripe::V2::MoneyManagement::PayoutIntentListParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::ListObject) @@ -118303,6 +118987,7 @@ module Stripe module V2 class TaxService < StripeService attr_reader :manual_rules + attr_reader :operations end end end @@ -118345,6 +119030,20 @@ module Stripe end end # typed: true +module Stripe + module V2 + module Tax + class OperationService < StripeService + # Resolves an address to its tax precision level. + sig { + params(params: T.any(::Stripe::V2::Tax::OperationResolveAddressParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Tax::OperationsResolveAddressResult) + } + def resolve_address(params = {}, opts = {}); end + end + end + end +end +# typed: true module Stripe module V2 class TestHelperService < StripeService @@ -163276,7 +163975,7 @@ module Stripe def phone_number; end sig { params(_phone_number: T.nilable(String)).returns(T.nilable(String)) } def phone_number=(_phone_number); end - # The cardholder’s preferred locales (languages), ordered by preference. Locales can be `da`, `de`, `en`, `es`, `fr`, `it`, `pl`, or `sv`. + # The cardholder’s preferred locales (languages), ordered by preference. Locales can be `de`, `en`, `es`, `fr`, or `it`. # This changes the language of the [3D Secure flow](https://docs.stripe.com/issuing/3d-secure) and one-time password messages sent to the cardholder. sig { returns(T.nilable(T::Array[String])) } def preferred_locales; end @@ -163661,7 +164360,7 @@ module Stripe def phone_number; end sig { params(_phone_number: T.nilable(String)).returns(T.nilable(String)) } def phone_number=(_phone_number); end - # The cardholder’s preferred locales (languages), ordered by preference. Locales can be `da`, `de`, `en`, `es`, `fr`, `it`, `pl`, or `sv`. + # The cardholder’s preferred locales (languages), ordered by preference. Locales can be `de`, `en`, `es`, `fr`, or `it`. # This changes the language of the [3D Secure flow](https://docs.stripe.com/issuing/3d-secure) and one-time password messages sent to the cardholder. sig { returns(T.nilable(T::Array[String])) } def preferred_locales; end @@ -175622,10 +176321,15 @@ module Stripe params(_checks: T.nilable(::Stripe::PaymentAttemptRecordReportFailedParams::PaymentMethodDetails::Card::Checks)).returns(T.nilable(::Stripe::PaymentAttemptRecordReportFailedParams::PaymentMethodDetails::Card::Checks)) } def checks=(_checks); end + # Decline code from the card network for the failed payment. + sig { returns(T.nilable(String)) } + def network_decline_code; end + sig { params(_network_decline_code: T.nilable(String)).returns(T.nilable(String)) } + def network_decline_code=(_network_decline_code); end sig { - params(checks: T.nilable(::Stripe::PaymentAttemptRecordReportFailedParams::PaymentMethodDetails::Card::Checks)).void + params(checks: T.nilable(::Stripe::PaymentAttemptRecordReportFailedParams::PaymentMethodDetails::Card::Checks), network_decline_code: T.nilable(String)).void } - def initialize(checks: nil); end + def initialize(checks: nil, network_decline_code: nil); end end # Information about the card payment method used to make this payment. sig { @@ -175685,7 +176389,7 @@ module Stripe def failed_at; end sig { params(_failed_at: T.nilable(Integer)).returns(T.nilable(Integer)) } def failed_at=(_failed_at); end - # The failure code for this payment attempt. Must be one of `payment_method_customer_decline` or `payment_method_provider_unknown_outcome`. + # The failure code for this payment attempt. Must be one of `payment_method_customer_decline`, `payment_method_provider_unknown_outcome`, `authentication_failure`, `expired_payment_method`, `incorrect_cvc`, `incorrect_number`, `incorrect_postal_code`, `insufficient_funds`, `processing_error`, or `payment_method_restricted`. sig { returns(T.nilable(String)) } def failure_code; end sig { params(_failure_code: T.nilable(String)).returns(T.nilable(String)) } @@ -220183,7 +220887,7 @@ module Stripe def failed_at; end sig { params(_failed_at: Integer).returns(Integer) } def failed_at=(_failed_at); end - # The failure code for this payment attempt. Must be one of `payment_method_customer_decline` or `payment_method_provider_unknown_outcome`. + # The failure code for this payment attempt. Must be one of `payment_method_customer_decline`, `payment_method_provider_unknown_outcome`, `authentication_failure`, `expired_payment_method`, `incorrect_cvc`, `incorrect_number`, `incorrect_postal_code`, `insufficient_funds`, `processing_error`, or `payment_method_restricted`. sig { returns(T.nilable(String)) } def failure_code; end sig { params(_failure_code: T.nilable(String)).returns(T.nilable(String)) } @@ -220670,10 +221374,15 @@ module Stripe params(_checks: T.nilable(::Stripe::PaymentRecordReportPaymentAttemptFailedParams::PaymentMethodDetails::Card::Checks)).returns(T.nilable(::Stripe::PaymentRecordReportPaymentAttemptFailedParams::PaymentMethodDetails::Card::Checks)) } def checks=(_checks); end + # Decline code from the card network for the failed payment. + sig { returns(T.nilable(String)) } + def network_decline_code; end + sig { params(_network_decline_code: T.nilable(String)).returns(T.nilable(String)) } + def network_decline_code=(_network_decline_code); end sig { - params(checks: T.nilable(::Stripe::PaymentRecordReportPaymentAttemptFailedParams::PaymentMethodDetails::Card::Checks)).void + params(checks: T.nilable(::Stripe::PaymentRecordReportPaymentAttemptFailedParams::PaymentMethodDetails::Card::Checks), network_decline_code: T.nilable(String)).void } - def initialize(checks: nil); end + def initialize(checks: nil, network_decline_code: nil); end end # Information about the card payment method used to make this payment. sig { @@ -220733,7 +221442,7 @@ module Stripe def failed_at; end sig { params(_failed_at: T.nilable(Integer)).returns(T.nilable(Integer)) } def failed_at=(_failed_at); end - # The failure code for this payment attempt. Must be one of `payment_method_customer_decline` or `payment_method_provider_unknown_outcome`. + # The failure code for this payment attempt. Must be one of `payment_method_customer_decline`, `payment_method_provider_unknown_outcome`, `authentication_failure`, `expired_payment_method`, `incorrect_cvc`, `incorrect_number`, `incorrect_postal_code`, `insufficient_funds`, `processing_error`, or `payment_method_restricted`. sig { returns(T.nilable(String)) } def failure_code; end sig { params(_failure_code: T.nilable(String)).returns(T.nilable(String)) } @@ -221299,7 +222008,7 @@ module Stripe def failed_at; end sig { params(_failed_at: Integer).returns(Integer) } def failed_at=(_failed_at); end - # The failure code for this payment attempt. Must be one of `payment_method_customer_decline` or `payment_method_provider_unknown_outcome`. + # The failure code for this payment attempt. Must be one of `payment_method_customer_decline`, `payment_method_provider_unknown_outcome`, `authentication_failure`, `expired_payment_method`, `incorrect_cvc`, `incorrect_number`, `incorrect_postal_code`, `insufficient_funds`, `processing_error`, or `payment_method_restricted`. sig { returns(T.nilable(String)) } def failure_code; end sig { params(_failure_code: T.nilable(String)).returns(T.nilable(String)) } @@ -242104,7 +242813,7 @@ module Stripe def billing_cycle_anchor; end sig { params(_billing_cycle_anchor: T.nilable(String)).returns(T.nilable(String)) } def billing_cycle_anchor=(_billing_cycle_anchor); end - # Controls whether Stripe attempts payment on the resumption invoice and how payment affects the subscription's status. The default is `resume_on_payment_attempt`. + # Controls whether Stripe attempts payment on the resumption invoice and how payment affects the subscription's status. The default is `resume_on_payment_success`. sig { returns(T.nilable(String)) } def payment_behavior; end sig { params(_payment_behavior: T.nilable(String)).returns(T.nilable(String)) } @@ -242150,10 +242859,10 @@ module Stripe sig { params(_key: T.nilable(String)).returns(T.nilable(String)) } def key=(_key); end # Configuration for when and how the subscription pauses. - sig { returns(::Stripe::SubscriptionScheduleCreateParams::PauseSchedule::Pause) } + sig { returns(T.nilable(::Stripe::SubscriptionScheduleCreateParams::PauseSchedule::Pause)) } def pause; end sig { - params(_pause: ::Stripe::SubscriptionScheduleCreateParams::PauseSchedule::Pause).returns(::Stripe::SubscriptionScheduleCreateParams::PauseSchedule::Pause) + params(_pause: T.nilable(::Stripe::SubscriptionScheduleCreateParams::PauseSchedule::Pause)).returns(T.nilable(::Stripe::SubscriptionScheduleCreateParams::PauseSchedule::Pause)) } def pause=(_pause); end # Configuration for when and how the subscription resumes. @@ -242164,7 +242873,7 @@ module Stripe } def resume=(_resume); end sig { - params(key: T.nilable(String), pause: ::Stripe::SubscriptionScheduleCreateParams::PauseSchedule::Pause, resume: T.nilable(::Stripe::SubscriptionScheduleCreateParams::PauseSchedule::Resume)).void + params(key: T.nilable(String), pause: T.nilable(::Stripe::SubscriptionScheduleCreateParams::PauseSchedule::Pause), resume: T.nilable(::Stripe::SubscriptionScheduleCreateParams::PauseSchedule::Resume)).void } def initialize(key: nil, pause: nil, resume: nil); end end @@ -243379,7 +244088,7 @@ module Stripe params(_metadata: T.nilable(T.any(String, T::Hash[String, String]))).returns(T.nilable(T.any(String, T::Hash[String, String]))) } def metadata=(_metadata); end - # Sets the pause schedules for the subscription schedule. Each entry configures when and how the subscription pauses and optionally when and how it resumes. + # Configures the subscription's pause behavior and, optionally, its resume behavior. Only one entry is supported. sig { returns(T.nilable(T::Array[::Stripe::SubscriptionScheduleCreateParams::PauseSchedule])) } def pause_schedules; end sig { @@ -243931,7 +244640,7 @@ module Stripe def billing_cycle_anchor; end sig { params(_billing_cycle_anchor: T.nilable(String)).returns(T.nilable(String)) } def billing_cycle_anchor=(_billing_cycle_anchor); end - # Controls whether Stripe attempts payment on the resumption invoice and how payment affects the subscription's status. The default is `resume_on_payment_attempt`. + # Controls whether Stripe attempts payment on the resumption invoice and how payment affects the subscription's status. The default is `resume_on_payment_success`. sig { returns(T.nilable(String)) } def payment_behavior; end sig { params(_payment_behavior: T.nilable(String)).returns(T.nilable(String)) } @@ -243986,14 +244695,16 @@ module Stripe } def pause=(_pause); end # Configuration for when and how the subscription resumes. - sig { returns(T.nilable(::Stripe::SubscriptionScheduleUpdateParams::PauseSchedule::Resume)) } + sig { + returns(T.nilable(T.any(String, ::Stripe::SubscriptionScheduleUpdateParams::PauseSchedule::Resume))) + } def resume; end sig { - params(_resume: T.nilable(::Stripe::SubscriptionScheduleUpdateParams::PauseSchedule::Resume)).returns(T.nilable(::Stripe::SubscriptionScheduleUpdateParams::PauseSchedule::Resume)) + params(_resume: T.nilable(T.any(String, ::Stripe::SubscriptionScheduleUpdateParams::PauseSchedule::Resume))).returns(T.nilable(T.any(String, ::Stripe::SubscriptionScheduleUpdateParams::PauseSchedule::Resume))) } def resume=(_resume); end sig { - params(key: T.nilable(String), pause: T.nilable(::Stripe::SubscriptionScheduleUpdateParams::PauseSchedule::Pause), resume: T.nilable(::Stripe::SubscriptionScheduleUpdateParams::PauseSchedule::Resume)).void + params(key: T.nilable(String), pause: T.nilable(::Stripe::SubscriptionScheduleUpdateParams::PauseSchedule::Pause), resume: T.nilable(T.any(String, ::Stripe::SubscriptionScheduleUpdateParams::PauseSchedule::Resume))).void } def initialize(key: nil, pause: nil, resume: nil); end end @@ -245198,7 +245909,7 @@ module Stripe params(_metadata: T.nilable(T.any(String, T::Hash[String, String]))).returns(T.nilable(T.any(String, T::Hash[String, String]))) } def metadata=(_metadata); end - # Sets the pause schedules for the subscription schedule. Include a `key` to update an existing entry or omit it to add a new one. Pass `""` to clear all entries or `[]` to leave them unchanged. + # Configures the subscription's pause behavior and, optionally, its resume behavior. Only one entry is supported. Include a key to update an existing entry. Omit to leave an existing pause schedule unchanged, or pass "" to clear it. sig { returns(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionScheduleUpdateParams::PauseSchedule]))) } @@ -268625,11 +269336,27 @@ end # typed: true module Stripe class CustomerBalanceTransactionCreateParams < ::Stripe::RequestParams + class AppliedToInvoice < ::Stripe::RequestParams + # The ID of the open invoice to apply the customer's balance credit to. + sig { returns(String) } + def invoice; end + sig { params(_invoice: String).returns(String) } + def invoice=(_invoice); end + sig { params(invoice: String).void } + def initialize(invoice: nil); end + end # The integer amount in **cents (or local equivalent)** to apply to the customer's credit balance. sig { returns(Integer) } def amount; end sig { params(_amount: Integer).returns(Integer) } def amount=(_amount); end + # Required when `type` is `applied_to_invoice`. Identifies the open invoice to apply the customer's balance credit to. + sig { returns(T.nilable(::Stripe::CustomerBalanceTransactionCreateParams::AppliedToInvoice)) } + def applied_to_invoice; end + sig { + params(_applied_to_invoice: T.nilable(::Stripe::CustomerBalanceTransactionCreateParams::AppliedToInvoice)).returns(T.nilable(::Stripe::CustomerBalanceTransactionCreateParams::AppliedToInvoice)) + } + def applied_to_invoice=(_applied_to_invoice); end # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Specifies the [`invoice_credit_balance`](https://docs.stripe.com/api/customers/object#customer_object-invoice_credit_balance) that this transaction will apply to. If the customer's `currency` is not set, it will be updated to this value. sig { returns(String) } def currency; end @@ -268652,10 +269379,23 @@ module Stripe params(_metadata: T.nilable(T.any(String, T::Hash[String, String]))).returns(T.nilable(T.any(String, T::Hash[String, String]))) } def metadata=(_metadata); end + # The type of customer balance transaction. Defaults to `adjustment`, which updates the customer's credit balance directly. Set to `applied_to_invoice` to apply the customer's existing credit balance to a specific open invoice. + sig { returns(T.nilable(String)) } + def type; end + sig { params(_type: T.nilable(String)).returns(T.nilable(String)) } + def type=(_type); end sig { - params(amount: Integer, currency: String, description: T.nilable(String), expand: T.nilable(T::Array[String]), metadata: T.nilable(T.any(String, T::Hash[String, String]))).void + params(amount: Integer, applied_to_invoice: T.nilable(::Stripe::CustomerBalanceTransactionCreateParams::AppliedToInvoice), currency: String, description: T.nilable(String), expand: T.nilable(T::Array[String]), metadata: T.nilable(T.any(String, T::Hash[String, String])), type: T.nilable(String)).void } - def initialize(amount: nil, currency: nil, description: nil, expand: nil, metadata: nil); end + def initialize( + amount: nil, + applied_to_invoice: nil, + currency: nil, + description: nil, + expand: nil, + metadata: nil, + type: nil + ); end end end # typed: true @@ -287473,7 +288213,7 @@ module Stripe end class Customer < ::Stripe::RequestParams class AutomaticIndirectTax < ::Stripe::RequestParams - # Describes the customer's tax exemption status, which is `none`, `exempt`, or `reverse`. When set to reverse, invoice and receipt PDFs include the following text: “Reverse charge”. + # Describes the customer's tax exemption status, which is `none`, `exempt`, or `reverse`. When set to reverse, invoice and receipt PDFs include the following text: "Reverse charge". sig { returns(T.nilable(String)) } def exempt; end sig { params(_exempt: T.nilable(String)).returns(T.nilable(String)) } @@ -295595,7 +296335,7 @@ module Stripe } def initialize(files: nil, signer: nil, type: nil); end end - # One or more documents that support the bank account ownership verification requirement. Must be a document associated with the account’s primary active bank account that displays the last 4 digits of the account number, either a statement or a check. + # One or more documents that support the bank account ownership verification requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a check. sig { returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::BankAccountOwnershipVerification)) } @@ -295604,7 +296344,7 @@ module Stripe params(_bank_account_ownership_verification: T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::BankAccountOwnershipVerification)).returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::BankAccountOwnershipVerification)) } def bank_account_ownership_verification=(_bank_account_ownership_verification); end - # One or more documents that demonstrate proof of a company’s license to operate. + # One or more documents that demonstrate proof of a company's license to operate. sig { returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyLicense)) } @@ -295613,7 +296353,7 @@ module Stripe params(_company_license: T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyLicense)).returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyLicense)) } def company_license=(_company_license); end - # One or more documents showing the company’s Memorandum of Association. + # One or more documents showing the company's Memorandum of Association. sig { returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyMemorandumOfAssociation)) } @@ -295622,7 +296362,7 @@ module Stripe params(_company_memorandum_of_association: T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyMemorandumOfAssociation)).returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyMemorandumOfAssociation)) } def company_memorandum_of_association=(_company_memorandum_of_association); end - # Certain countries only: One or more documents showing the ministerial decree legalizing the company’s establishment. + # Certain countries only: One or more documents showing the ministerial decree legalizing the company's establishment. sig { returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyMinisterialDecree)) } @@ -295631,7 +296371,7 @@ module Stripe params(_company_ministerial_decree: T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyMinisterialDecree)).returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyMinisterialDecree)) } def company_ministerial_decree=(_company_ministerial_decree); end - # One or more documents that demonstrate proof of a company’s registration with the appropriate local authorities. + # One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. sig { returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyRegistrationVerification)) } @@ -295640,7 +296380,7 @@ module Stripe params(_company_registration_verification: T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyRegistrationVerification)).returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyRegistrationVerification)) } def company_registration_verification=(_company_registration_verification); end - # One or more documents that demonstrate proof of a company’s tax ID. + # One or more documents that demonstrate proof of a company's tax ID. sig { returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyTaxIdVerification)) } @@ -295667,7 +296407,7 @@ module Stripe params(_proof_of_address: T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::ProofOfAddress)).returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::ProofOfAddress)) } def proof_of_address=(_proof_of_address); end - # One or more documents showing the company’s proof of registration with the national business registry. + # One or more documents showing the company's proof of registration with the national business registry. sig { returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::ProofOfRegistration)) } @@ -296314,7 +297054,7 @@ module Stripe params(_company_authorization: T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::Individual::Documents::CompanyAuthorization)).returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::Individual::Documents::CompanyAuthorization)) } def company_authorization=(_company_authorization); end - # One or more documents showing the person’s passport page with photo and personal data. + # One or more documents showing the person's passport page with photo and personal data. sig { returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::Individual::Documents::Passport)) } @@ -296341,7 +297081,7 @@ module Stripe params(_secondary_verification: T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::Individual::Documents::SecondaryVerification)).returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::Individual::Documents::SecondaryVerification)) } def secondary_verification=(_secondary_verification); end - # One or more documents showing the person’s visa required for living in the country where they are residing. + # One or more documents showing the person's visa required for living in the country where they are residing. sig { returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::Individual::Documents::Visa)) } @@ -296386,7 +297126,7 @@ module Stripe def executive; end sig { params(_executive: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } def executive=(_executive); end - # Whether the person is an owner of the account’s identity. + # Whether the person is an owner of the account's identity. sig { returns(T.nilable(T::Boolean)) } def owner; end sig { params(_owner: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } @@ -306089,7 +306829,7 @@ module Stripe } def initialize(files: nil, signer: nil, type: nil); end end - # One or more documents that support the bank account ownership verification requirement. Must be a document associated with the account’s primary active bank account that displays the last 4 digits of the account number, either a statement or a check. + # One or more documents that support the bank account ownership verification requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a check. sig { returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::BankAccountOwnershipVerification)) } @@ -306098,7 +306838,7 @@ module Stripe params(_bank_account_ownership_verification: T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::BankAccountOwnershipVerification)).returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::BankAccountOwnershipVerification)) } def bank_account_ownership_verification=(_bank_account_ownership_verification); end - # One or more documents that demonstrate proof of a company’s license to operate. + # One or more documents that demonstrate proof of a company's license to operate. sig { returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyLicense)) } @@ -306107,7 +306847,7 @@ module Stripe params(_company_license: T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyLicense)).returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyLicense)) } def company_license=(_company_license); end - # One or more documents showing the company’s Memorandum of Association. + # One or more documents showing the company's Memorandum of Association. sig { returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyMemorandumOfAssociation)) } @@ -306116,7 +306856,7 @@ module Stripe params(_company_memorandum_of_association: T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyMemorandumOfAssociation)).returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyMemorandumOfAssociation)) } def company_memorandum_of_association=(_company_memorandum_of_association); end - # Certain countries only: One or more documents showing the ministerial decree legalizing the company’s establishment. + # Certain countries only: One or more documents showing the ministerial decree legalizing the company's establishment. sig { returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyMinisterialDecree)) } @@ -306125,7 +306865,7 @@ module Stripe params(_company_ministerial_decree: T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyMinisterialDecree)).returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyMinisterialDecree)) } def company_ministerial_decree=(_company_ministerial_decree); end - # One or more documents that demonstrate proof of a company’s registration with the appropriate local authorities. + # One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. sig { returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyRegistrationVerification)) } @@ -306134,7 +306874,7 @@ module Stripe params(_company_registration_verification: T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyRegistrationVerification)).returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyRegistrationVerification)) } def company_registration_verification=(_company_registration_verification); end - # One or more documents that demonstrate proof of a company’s tax ID. + # One or more documents that demonstrate proof of a company's tax ID. sig { returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyTaxIdVerification)) } @@ -306808,7 +307548,7 @@ module Stripe params(_company_authorization: T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::Individual::Documents::CompanyAuthorization)).returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::Individual::Documents::CompanyAuthorization)) } def company_authorization=(_company_authorization); end - # One or more documents showing the person’s passport page with photo and personal data. + # One or more documents showing the person's passport page with photo and personal data. sig { returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::Individual::Documents::Passport)) } @@ -306835,7 +307575,7 @@ module Stripe params(_secondary_verification: T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::Individual::Documents::SecondaryVerification)).returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::Individual::Documents::SecondaryVerification)) } def secondary_verification=(_secondary_verification); end - # One or more documents showing the person’s visa required for living in the country where they are residing. + # One or more documents showing the person's visa required for living in the country where they are residing. sig { returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::Individual::Documents::Visa)) } @@ -306880,7 +307620,7 @@ module Stripe def executive; end sig { params(_executive: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } def executive=(_executive); end - # Whether the person is an owner of the account’s identity. + # Whether the person is an owner of the account's identity. sig { returns(T.nilable(T::Boolean)) } def owner; end sig { params(_owner: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } @@ -307731,7 +308471,7 @@ module Stripe params(_company_authorization: T.nilable(::Stripe::V2::Core::Accounts::PersonCreateParams::Documents::CompanyAuthorization)).returns(T.nilable(::Stripe::V2::Core::Accounts::PersonCreateParams::Documents::CompanyAuthorization)) } def company_authorization=(_company_authorization); end - # One or more documents showing the person’s passport page with photo and personal data. + # One or more documents showing the person's passport page with photo and personal data. sig { returns(T.nilable(::Stripe::V2::Core::Accounts::PersonCreateParams::Documents::Passport)) } @@ -307758,7 +308498,7 @@ module Stripe params(_secondary_verification: T.nilable(::Stripe::V2::Core::Accounts::PersonCreateParams::Documents::SecondaryVerification)).returns(T.nilable(::Stripe::V2::Core::Accounts::PersonCreateParams::Documents::SecondaryVerification)) } def secondary_verification=(_secondary_verification); end - # One or more documents showing the person’s visa required for living in the country where they are residing. + # One or more documents showing the person's visa required for living in the country where they are residing. sig { returns(T.nilable(::Stripe::V2::Core::Accounts::PersonCreateParams::Documents::Visa)) } @@ -308518,7 +309258,7 @@ module Stripe params(_company_authorization: T.nilable(::Stripe::V2::Core::Accounts::PersonUpdateParams::Documents::CompanyAuthorization)).returns(T.nilable(::Stripe::V2::Core::Accounts::PersonUpdateParams::Documents::CompanyAuthorization)) } def company_authorization=(_company_authorization); end - # One or more documents showing the person’s passport page with photo and personal data. + # One or more documents showing the person's passport page with photo and personal data. sig { returns(T.nilable(::Stripe::V2::Core::Accounts::PersonUpdateParams::Documents::Passport)) } @@ -308545,7 +309285,7 @@ module Stripe params(_secondary_verification: T.nilable(::Stripe::V2::Core::Accounts::PersonUpdateParams::Documents::SecondaryVerification)).returns(T.nilable(::Stripe::V2::Core::Accounts::PersonUpdateParams::Documents::SecondaryVerification)) } def secondary_verification=(_secondary_verification); end - # One or more documents showing the person’s visa required for living in the country where they are residing. + # One or more documents showing the person's visa required for living in the country where they are residing. sig { returns(T.nilable(::Stripe::V2::Core::Accounts::PersonUpdateParams::Documents::Visa)) } @@ -309275,7 +310015,7 @@ module Stripe params(_company_authorization: T.nilable(::Stripe::V2::Core::Accounts::PersonTokenCreateParams::Documents::CompanyAuthorization)).returns(T.nilable(::Stripe::V2::Core::Accounts::PersonTokenCreateParams::Documents::CompanyAuthorization)) } def company_authorization=(_company_authorization); end - # One or more documents showing the person’s passport page with photo and personal data. + # One or more documents showing the person's passport page with photo and personal data. sig { returns(T.nilable(::Stripe::V2::Core::Accounts::PersonTokenCreateParams::Documents::Passport)) } @@ -309302,7 +310042,7 @@ module Stripe params(_secondary_verification: T.nilable(::Stripe::V2::Core::Accounts::PersonTokenCreateParams::Documents::SecondaryVerification)).returns(T.nilable(::Stripe::V2::Core::Accounts::PersonTokenCreateParams::Documents::SecondaryVerification)) } def secondary_verification=(_secondary_verification); end - # One or more documents showing the person’s visa required for living in the country where they are residing. + # One or more documents showing the person's visa required for living in the country where they are residing. sig { returns(T.nilable(::Stripe::V2::Core::Accounts::PersonTokenCreateParams::Documents::Visa)) } @@ -311041,7 +311781,7 @@ module Stripe } def initialize(files: nil, signer: nil, type: nil); end end - # One or more documents that support the bank account ownership verification requirement. Must be a document associated with the account’s primary active bank account that displays the last 4 digits of the account number, either a statement or a check. + # One or more documents that support the bank account ownership verification requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a check. sig { returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::BankAccountOwnershipVerification)) } @@ -311050,7 +311790,7 @@ module Stripe params(_bank_account_ownership_verification: T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::BankAccountOwnershipVerification)).returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::BankAccountOwnershipVerification)) } def bank_account_ownership_verification=(_bank_account_ownership_verification); end - # One or more documents that demonstrate proof of a company’s license to operate. + # One or more documents that demonstrate proof of a company's license to operate. sig { returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyLicense)) } @@ -311059,7 +311799,7 @@ module Stripe params(_company_license: T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyLicense)).returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyLicense)) } def company_license=(_company_license); end - # One or more documents showing the company’s Memorandum of Association. + # One or more documents showing the company's Memorandum of Association. sig { returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyMemorandumOfAssociation)) } @@ -311068,7 +311808,7 @@ module Stripe params(_company_memorandum_of_association: T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyMemorandumOfAssociation)).returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyMemorandumOfAssociation)) } def company_memorandum_of_association=(_company_memorandum_of_association); end - # Certain countries only: One or more documents showing the ministerial decree legalizing the company’s establishment. + # Certain countries only: One or more documents showing the ministerial decree legalizing the company's establishment. sig { returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyMinisterialDecree)) } @@ -311077,7 +311817,7 @@ module Stripe params(_company_ministerial_decree: T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyMinisterialDecree)).returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyMinisterialDecree)) } def company_ministerial_decree=(_company_ministerial_decree); end - # One or more documents that demonstrate proof of a company’s registration with the appropriate local authorities. + # One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. sig { returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyRegistrationVerification)) } @@ -311086,7 +311826,7 @@ module Stripe params(_company_registration_verification: T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyRegistrationVerification)).returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyRegistrationVerification)) } def company_registration_verification=(_company_registration_verification); end - # One or more documents that demonstrate proof of a company’s tax ID. + # One or more documents that demonstrate proof of a company's tax ID. sig { returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyTaxIdVerification)) } @@ -311760,7 +312500,7 @@ module Stripe params(_company_authorization: T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::Individual::Documents::CompanyAuthorization)).returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::Individual::Documents::CompanyAuthorization)) } def company_authorization=(_company_authorization); end - # One or more documents showing the person’s passport page with photo and personal data. + # One or more documents showing the person's passport page with photo and personal data. sig { returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::Individual::Documents::Passport)) } @@ -311787,7 +312527,7 @@ module Stripe params(_secondary_verification: T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::Individual::Documents::SecondaryVerification)).returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::Individual::Documents::SecondaryVerification)) } def secondary_verification=(_secondary_verification); end - # One or more documents showing the person’s visa required for living in the country where they are residing. + # One or more documents showing the person's visa required for living in the country where they are residing. sig { returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::Individual::Documents::Visa)) } @@ -311832,7 +312572,7 @@ module Stripe def executive; end sig { params(_executive: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } def executive=(_executive); end - # Whether the person is an owner of the account’s identity. + # Whether the person is an owner of the account's identity. sig { returns(T.nilable(T::Boolean)) } def owner; end sig { params(_owner: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } @@ -315922,6 +316662,11 @@ module Stripe def amount; end sig { params(_amount: ::Stripe::V2::Amount).returns(::Stripe::V2::Amount) } def amount=(_amount); end + # Controls whether the intent requires explicit confirmation before transitioning to pending. Defaults to automatic. + sig { returns(T.nilable(String)) } + def confirmation_method; end + sig { params(_confirmation_method: T.nilable(String)).returns(T.nilable(String)) } + def confirmation_method=(_confirmation_method); end # An arbitrary string attached to the PayoutIntent. Often useful for displaying to users. sig { returns(T.nilable(String)) } def description; end @@ -315972,10 +316717,11 @@ module Stripe } def to=(_to); end sig { - params(amount: ::Stripe::V2::Amount, description: T.nilable(String), from: ::Stripe::V2::MoneyManagement::PayoutIntentCreateParams::From, metadata: T.nilable(T::Hash[String, String]), recipient_notification: T.nilable(::Stripe::V2::MoneyManagement::PayoutIntentCreateParams::RecipientNotification), schedule_options: T.nilable(::Stripe::V2::MoneyManagement::PayoutIntentCreateParams::ScheduleOptions), statement_descriptor: T.nilable(String), to: ::Stripe::V2::MoneyManagement::PayoutIntentCreateParams::To).void + params(amount: ::Stripe::V2::Amount, confirmation_method: T.nilable(String), description: T.nilable(String), from: ::Stripe::V2::MoneyManagement::PayoutIntentCreateParams::From, metadata: T.nilable(T::Hash[String, String]), recipient_notification: T.nilable(::Stripe::V2::MoneyManagement::PayoutIntentCreateParams::RecipientNotification), schedule_options: T.nilable(::Stripe::V2::MoneyManagement::PayoutIntentCreateParams::ScheduleOptions), statement_descriptor: T.nilable(String), to: ::Stripe::V2::MoneyManagement::PayoutIntentCreateParams::To).void } def initialize( amount: nil, + confirmation_method: nil, description: nil, from: nil, metadata: nil, @@ -316217,6 +316963,22 @@ module Stripe end end # typed: true +module Stripe + module V2 + module MoneyManagement + class PayoutIntentConfirmParams < ::Stripe::RequestParams; end + end + end +end +# typed: true +module Stripe + module V2 + module MoneyManagement + class PayoutIntentFxQuoteParams < ::Stripe::RequestParams; end + end + end +end +# typed: true module Stripe module V2 module MoneyManagement @@ -317121,7 +317883,7 @@ module Stripe sig { params(amount: T.nilable(Integer), destination: String).void } def initialize(amount: nil, destination: nil); end end - # The “presentment amount” to be collected from the customer. + # The "presentment amount" to be collected from the customer. sig { returns(::Stripe::V2::Amount) } def amount; end sig { params(_amount: ::Stripe::V2::Amount).returns(::Stripe::V2::Amount) } @@ -317230,17 +317992,17 @@ module Stripe params(_retry_details: T.nilable(::Stripe::V2::Payments::OffSessionPaymentCreateParams::RetryDetails)).returns(T.nilable(::Stripe::V2::Payments::OffSessionPaymentCreateParams::RetryDetails)) } def retry_details=(_retry_details); end - # Text that appears on the customer’s statement as the statement descriptor for a - # non-card charge. This value overrides the account’s default statement descriptor. + # Text that appears on the customer's statement as the statement descriptor for a + # non-card charge. This value overrides the account's default statement descriptor. # For information about requirements, including the 22-character limit, see the # [Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). 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 account’s + # Provides information about a card charge. Concatenated to the account's # [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) - # to form the complete statement descriptor that appears on the customer’s statement. + # to form the complete statement descriptor that appears on the customer's statement. sig { returns(T.nilable(String)) } def statement_descriptor_suffix; end sig { params(_statement_descriptor_suffix: T.nilable(String)).returns(T.nilable(String)) } @@ -317532,8 +318294,8 @@ module Stripe params(_payment_details: T.nilable(::Stripe::V2::Payments::OffSessionPaymentCaptureParams::PaymentDetails)).returns(T.nilable(::Stripe::V2::Payments::OffSessionPaymentCaptureParams::PaymentDetails)) } def payment_details=(_payment_details); end - # Text that appears on the customer’s statement as the statement descriptor for a - # non-card charge. This value overrides the account’s default statement descriptor. + # Text that appears on the customer's statement as the statement descriptor for a + # non-card charge. This value overrides the account's default statement descriptor. # For information about requirements, including the 22-character limit, see the # [Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). sig { returns(T.nilable(String)) } @@ -319062,6 +319824,55 @@ module Stripe end end # typed: true +module Stripe + module V2 + module Tax + class OperationResolveAddressParams < ::Stripe::RequestParams + class Address < ::Stripe::RequestParams + # The city. + sig { returns(T.nilable(String)) } + def city; end + sig { params(_city: T.nilable(String)).returns(T.nilable(String)) } + def city=(_city); end + # The two-letter country code. + sig { returns(String) } + def country; end + sig { params(_country: String).returns(String) } + def country=(_country); end + # The first line of the street address. + sig { returns(T.nilable(String)) } + def line1; end + sig { params(_line1: T.nilable(String)).returns(T.nilable(String)) } + def line1=(_line1); end + # The postal code. + sig { returns(T.nilable(String)) } + def postal_code; end + sig { params(_postal_code: T.nilable(String)).returns(T.nilable(String)) } + def postal_code=(_postal_code); end + # The state or province. + sig { returns(T.nilable(String)) } + def state; end + sig { params(_state: T.nilable(String)).returns(T.nilable(String)) } + def state=(_state); end + sig { + params(city: T.nilable(String), country: String, line1: T.nilable(String), postal_code: T.nilable(String), state: T.nilable(String)).void + } + def initialize(city: nil, country: nil, line1: nil, postal_code: nil, state: nil); end + end + # The address to resolve. + sig { returns(::Stripe::V2::Tax::OperationResolveAddressParams::Address) } + def address; end + sig { + params(_address: ::Stripe::V2::Tax::OperationResolveAddressParams::Address).returns(::Stripe::V2::Tax::OperationResolveAddressParams::Address) + } + def address=(_address); end + sig { params(address: ::Stripe::V2::Tax::OperationResolveAddressParams::Address).void } + def initialize(address: nil); end + end + end + end +end +# typed: true module Stripe module V2 module TestHelpers diff --git a/rbi/stripe/params/customer_balance_transaction_create_params.rbi b/rbi/stripe/params/customer_balance_transaction_create_params.rbi index cda1c1771..ef0fd5af3 100644 --- a/rbi/stripe/params/customer_balance_transaction_create_params.rbi +++ b/rbi/stripe/params/customer_balance_transaction_create_params.rbi @@ -4,11 +4,27 @@ # typed: true module Stripe class CustomerBalanceTransactionCreateParams < ::Stripe::RequestParams + class AppliedToInvoice < ::Stripe::RequestParams + # The ID of the open invoice to apply the customer's balance credit to. + sig { returns(String) } + def invoice; end + sig { params(_invoice: String).returns(String) } + def invoice=(_invoice); end + sig { params(invoice: String).void } + def initialize(invoice: nil); end + end # The integer amount in **cents (or local equivalent)** to apply to the customer's credit balance. sig { returns(Integer) } def amount; end sig { params(_amount: Integer).returns(Integer) } def amount=(_amount); end + # Required when `type` is `applied_to_invoice`. Identifies the open invoice to apply the customer's balance credit to. + sig { returns(T.nilable(::Stripe::CustomerBalanceTransactionCreateParams::AppliedToInvoice)) } + def applied_to_invoice; end + sig { + params(_applied_to_invoice: T.nilable(::Stripe::CustomerBalanceTransactionCreateParams::AppliedToInvoice)).returns(T.nilable(::Stripe::CustomerBalanceTransactionCreateParams::AppliedToInvoice)) + } + def applied_to_invoice=(_applied_to_invoice); end # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Specifies the [`invoice_credit_balance`](https://docs.stripe.com/api/customers/object#customer_object-invoice_credit_balance) that this transaction will apply to. If the customer's `currency` is not set, it will be updated to this value. sig { returns(String) } def currency; end @@ -31,9 +47,22 @@ module Stripe params(_metadata: T.nilable(T.any(String, T::Hash[String, String]))).returns(T.nilable(T.any(String, T::Hash[String, String]))) } def metadata=(_metadata); end + # The type of customer balance transaction. Defaults to `adjustment`, which updates the customer's credit balance directly. Set to `applied_to_invoice` to apply the customer's existing credit balance to a specific open invoice. + sig { returns(T.nilable(String)) } + def type; end + sig { params(_type: T.nilable(String)).returns(T.nilable(String)) } + def type=(_type); end sig { - params(amount: Integer, currency: String, description: T.nilable(String), expand: T.nilable(T::Array[String]), metadata: T.nilable(T.any(String, T::Hash[String, String]))).void + params(amount: Integer, applied_to_invoice: T.nilable(::Stripe::CustomerBalanceTransactionCreateParams::AppliedToInvoice), currency: String, description: T.nilable(String), expand: T.nilable(T::Array[String]), metadata: T.nilable(T.any(String, T::Hash[String, String])), type: T.nilable(String)).void } - def initialize(amount: nil, currency: nil, description: nil, expand: nil, metadata: nil); end + def initialize( + amount: nil, + applied_to_invoice: nil, + currency: nil, + description: nil, + expand: nil, + metadata: nil, + type: nil + ); end end end \ No newline at end of file diff --git a/rbi/stripe/params/issuing/cardholder_create_params.rbi b/rbi/stripe/params/issuing/cardholder_create_params.rbi index 81404edb9..167ee3074 100644 --- a/rbi/stripe/params/issuing/cardholder_create_params.rbi +++ b/rbi/stripe/params/issuing/cardholder_create_params.rbi @@ -342,7 +342,7 @@ module Stripe def phone_number; end sig { params(_phone_number: T.nilable(String)).returns(T.nilable(String)) } def phone_number=(_phone_number); end - # The cardholder’s preferred locales (languages), ordered by preference. Locales can be `da`, `de`, `en`, `es`, `fr`, `it`, `pl`, or `sv`. + # The cardholder’s preferred locales (languages), ordered by preference. Locales can be `de`, `en`, `es`, `fr`, or `it`. # This changes the language of the [3D Secure flow](https://docs.stripe.com/issuing/3d-secure) and one-time password messages sent to the cardholder. sig { returns(T.nilable(T::Array[String])) } def preferred_locales; end diff --git a/rbi/stripe/params/issuing/cardholder_update_params.rbi b/rbi/stripe/params/issuing/cardholder_update_params.rbi index ef6373db4..2bcb25587 100644 --- a/rbi/stripe/params/issuing/cardholder_update_params.rbi +++ b/rbi/stripe/params/issuing/cardholder_update_params.rbi @@ -341,7 +341,7 @@ module Stripe def phone_number; end sig { params(_phone_number: T.nilable(String)).returns(T.nilable(String)) } def phone_number=(_phone_number); end - # The cardholder’s preferred locales (languages), ordered by preference. Locales can be `da`, `de`, `en`, `es`, `fr`, `it`, `pl`, or `sv`. + # The cardholder’s preferred locales (languages), ordered by preference. Locales can be `de`, `en`, `es`, `fr`, or `it`. # This changes the language of the [3D Secure flow](https://docs.stripe.com/issuing/3d-secure) and one-time password messages sent to the cardholder. sig { returns(T.nilable(T::Array[String])) } def preferred_locales; end diff --git a/rbi/stripe/params/payment_attempt_record_report_failed_params.rbi b/rbi/stripe/params/payment_attempt_record_report_failed_params.rbi index c12e8d08a..d9edcd415 100644 --- a/rbi/stripe/params/payment_attempt_record_report_failed_params.rbi +++ b/rbi/stripe/params/payment_attempt_record_report_failed_params.rbi @@ -40,10 +40,15 @@ module Stripe params(_checks: T.nilable(::Stripe::PaymentAttemptRecordReportFailedParams::PaymentMethodDetails::Card::Checks)).returns(T.nilable(::Stripe::PaymentAttemptRecordReportFailedParams::PaymentMethodDetails::Card::Checks)) } def checks=(_checks); end + # Decline code from the card network for the failed payment. + sig { returns(T.nilable(String)) } + def network_decline_code; end + sig { params(_network_decline_code: T.nilable(String)).returns(T.nilable(String)) } + def network_decline_code=(_network_decline_code); end sig { - params(checks: T.nilable(::Stripe::PaymentAttemptRecordReportFailedParams::PaymentMethodDetails::Card::Checks)).void + params(checks: T.nilable(::Stripe::PaymentAttemptRecordReportFailedParams::PaymentMethodDetails::Card::Checks), network_decline_code: T.nilable(String)).void } - def initialize(checks: nil); end + def initialize(checks: nil, network_decline_code: nil); end end # Information about the card payment method used to make this payment. sig { @@ -103,7 +108,7 @@ module Stripe def failed_at; end sig { params(_failed_at: T.nilable(Integer)).returns(T.nilable(Integer)) } def failed_at=(_failed_at); end - # The failure code for this payment attempt. Must be one of `payment_method_customer_decline` or `payment_method_provider_unknown_outcome`. + # The failure code for this payment attempt. Must be one of `payment_method_customer_decline`, `payment_method_provider_unknown_outcome`, `authentication_failure`, `expired_payment_method`, `incorrect_cvc`, `incorrect_number`, `incorrect_postal_code`, `insufficient_funds`, `processing_error`, or `payment_method_restricted`. sig { returns(T.nilable(String)) } def failure_code; end sig { params(_failure_code: T.nilable(String)).returns(T.nilable(String)) } diff --git a/rbi/stripe/params/payment_record_report_payment_attempt_failed_params.rbi b/rbi/stripe/params/payment_record_report_payment_attempt_failed_params.rbi index b8309713d..8929154ce 100644 --- a/rbi/stripe/params/payment_record_report_payment_attempt_failed_params.rbi +++ b/rbi/stripe/params/payment_record_report_payment_attempt_failed_params.rbi @@ -40,10 +40,15 @@ module Stripe params(_checks: T.nilable(::Stripe::PaymentRecordReportPaymentAttemptFailedParams::PaymentMethodDetails::Card::Checks)).returns(T.nilable(::Stripe::PaymentRecordReportPaymentAttemptFailedParams::PaymentMethodDetails::Card::Checks)) } def checks=(_checks); end + # Decline code from the card network for the failed payment. + sig { returns(T.nilable(String)) } + def network_decline_code; end + sig { params(_network_decline_code: T.nilable(String)).returns(T.nilable(String)) } + def network_decline_code=(_network_decline_code); end sig { - params(checks: T.nilable(::Stripe::PaymentRecordReportPaymentAttemptFailedParams::PaymentMethodDetails::Card::Checks)).void + params(checks: T.nilable(::Stripe::PaymentRecordReportPaymentAttemptFailedParams::PaymentMethodDetails::Card::Checks), network_decline_code: T.nilable(String)).void } - def initialize(checks: nil); end + def initialize(checks: nil, network_decline_code: nil); end end # Information about the card payment method used to make this payment. sig { @@ -103,7 +108,7 @@ module Stripe def failed_at; end sig { params(_failed_at: T.nilable(Integer)).returns(T.nilable(Integer)) } def failed_at=(_failed_at); end - # The failure code for this payment attempt. Must be one of `payment_method_customer_decline` or `payment_method_provider_unknown_outcome`. + # The failure code for this payment attempt. Must be one of `payment_method_customer_decline`, `payment_method_provider_unknown_outcome`, `authentication_failure`, `expired_payment_method`, `incorrect_cvc`, `incorrect_number`, `incorrect_postal_code`, `insufficient_funds`, `processing_error`, or `payment_method_restricted`. sig { returns(T.nilable(String)) } def failure_code; end sig { params(_failure_code: T.nilable(String)).returns(T.nilable(String)) } diff --git a/rbi/stripe/params/payment_record_report_payment_attempt_params.rbi b/rbi/stripe/params/payment_record_report_payment_attempt_params.rbi index ac5991d34..ced95edc7 100644 --- a/rbi/stripe/params/payment_record_report_payment_attempt_params.rbi +++ b/rbi/stripe/params/payment_record_report_payment_attempt_params.rbi @@ -39,7 +39,7 @@ module Stripe def failed_at; end sig { params(_failed_at: Integer).returns(Integer) } def failed_at=(_failed_at); end - # The failure code for this payment attempt. Must be one of `payment_method_customer_decline` or `payment_method_provider_unknown_outcome`. + # The failure code for this payment attempt. Must be one of `payment_method_customer_decline`, `payment_method_provider_unknown_outcome`, `authentication_failure`, `expired_payment_method`, `incorrect_cvc`, `incorrect_number`, `incorrect_postal_code`, `insufficient_funds`, `processing_error`, or `payment_method_restricted`. sig { returns(T.nilable(String)) } def failure_code; end sig { params(_failure_code: T.nilable(String)).returns(T.nilable(String)) } diff --git a/rbi/stripe/params/payment_record_report_payment_params.rbi b/rbi/stripe/params/payment_record_report_payment_params.rbi index e5f7d5874..e5dedb96c 100644 --- a/rbi/stripe/params/payment_record_report_payment_params.rbi +++ b/rbi/stripe/params/payment_record_report_payment_params.rbi @@ -79,7 +79,7 @@ module Stripe def failed_at; end sig { params(_failed_at: Integer).returns(Integer) } def failed_at=(_failed_at); end - # The failure code for this payment attempt. Must be one of `payment_method_customer_decline` or `payment_method_provider_unknown_outcome`. + # The failure code for this payment attempt. Must be one of `payment_method_customer_decline`, `payment_method_provider_unknown_outcome`, `authentication_failure`, `expired_payment_method`, `incorrect_cvc`, `incorrect_number`, `incorrect_postal_code`, `insufficient_funds`, `processing_error`, or `payment_method_restricted`. sig { returns(T.nilable(String)) } def failure_code; end sig { params(_failure_code: T.nilable(String)).returns(T.nilable(String)) } diff --git a/rbi/stripe/params/subscription_schedule_create_params.rbi b/rbi/stripe/params/subscription_schedule_create_params.rbi index 766fee9b5..a929f9609 100644 --- a/rbi/stripe/params/subscription_schedule_create_params.rbi +++ b/rbi/stripe/params/subscription_schedule_create_params.rbi @@ -497,7 +497,7 @@ module Stripe def billing_cycle_anchor; end sig { params(_billing_cycle_anchor: T.nilable(String)).returns(T.nilable(String)) } def billing_cycle_anchor=(_billing_cycle_anchor); end - # Controls whether Stripe attempts payment on the resumption invoice and how payment affects the subscription's status. The default is `resume_on_payment_attempt`. + # Controls whether Stripe attempts payment on the resumption invoice and how payment affects the subscription's status. The default is `resume_on_payment_success`. sig { returns(T.nilable(String)) } def payment_behavior; end sig { params(_payment_behavior: T.nilable(String)).returns(T.nilable(String)) } @@ -543,10 +543,10 @@ module Stripe sig { params(_key: T.nilable(String)).returns(T.nilable(String)) } def key=(_key); end # Configuration for when and how the subscription pauses. - sig { returns(::Stripe::SubscriptionScheduleCreateParams::PauseSchedule::Pause) } + sig { returns(T.nilable(::Stripe::SubscriptionScheduleCreateParams::PauseSchedule::Pause)) } def pause; end sig { - params(_pause: ::Stripe::SubscriptionScheduleCreateParams::PauseSchedule::Pause).returns(::Stripe::SubscriptionScheduleCreateParams::PauseSchedule::Pause) + params(_pause: T.nilable(::Stripe::SubscriptionScheduleCreateParams::PauseSchedule::Pause)).returns(T.nilable(::Stripe::SubscriptionScheduleCreateParams::PauseSchedule::Pause)) } def pause=(_pause); end # Configuration for when and how the subscription resumes. @@ -557,7 +557,7 @@ module Stripe } def resume=(_resume); end sig { - params(key: T.nilable(String), pause: ::Stripe::SubscriptionScheduleCreateParams::PauseSchedule::Pause, resume: T.nilable(::Stripe::SubscriptionScheduleCreateParams::PauseSchedule::Resume)).void + params(key: T.nilable(String), pause: T.nilable(::Stripe::SubscriptionScheduleCreateParams::PauseSchedule::Pause), resume: T.nilable(::Stripe::SubscriptionScheduleCreateParams::PauseSchedule::Resume)).void } def initialize(key: nil, pause: nil, resume: nil); end end @@ -1772,7 +1772,7 @@ module Stripe params(_metadata: T.nilable(T.any(String, T::Hash[String, String]))).returns(T.nilable(T.any(String, T::Hash[String, String]))) } def metadata=(_metadata); end - # Sets the pause schedules for the subscription schedule. Each entry configures when and how the subscription pauses and optionally when and how it resumes. + # Configures the subscription's pause behavior and, optionally, its resume behavior. Only one entry is supported. sig { returns(T.nilable(T::Array[::Stripe::SubscriptionScheduleCreateParams::PauseSchedule])) } def pause_schedules; end sig { diff --git a/rbi/stripe/params/subscription_schedule_update_params.rbi b/rbi/stripe/params/subscription_schedule_update_params.rbi index bba271b19..e216f49e5 100644 --- a/rbi/stripe/params/subscription_schedule_update_params.rbi +++ b/rbi/stripe/params/subscription_schedule_update_params.rbi @@ -474,7 +474,7 @@ module Stripe def billing_cycle_anchor; end sig { params(_billing_cycle_anchor: T.nilable(String)).returns(T.nilable(String)) } def billing_cycle_anchor=(_billing_cycle_anchor); end - # Controls whether Stripe attempts payment on the resumption invoice and how payment affects the subscription's status. The default is `resume_on_payment_attempt`. + # Controls whether Stripe attempts payment on the resumption invoice and how payment affects the subscription's status. The default is `resume_on_payment_success`. sig { returns(T.nilable(String)) } def payment_behavior; end sig { params(_payment_behavior: T.nilable(String)).returns(T.nilable(String)) } @@ -529,14 +529,16 @@ module Stripe } def pause=(_pause); end # Configuration for when and how the subscription resumes. - sig { returns(T.nilable(::Stripe::SubscriptionScheduleUpdateParams::PauseSchedule::Resume)) } + sig { + returns(T.nilable(T.any(String, ::Stripe::SubscriptionScheduleUpdateParams::PauseSchedule::Resume))) + } def resume; end sig { - params(_resume: T.nilable(::Stripe::SubscriptionScheduleUpdateParams::PauseSchedule::Resume)).returns(T.nilable(::Stripe::SubscriptionScheduleUpdateParams::PauseSchedule::Resume)) + params(_resume: T.nilable(T.any(String, ::Stripe::SubscriptionScheduleUpdateParams::PauseSchedule::Resume))).returns(T.nilable(T.any(String, ::Stripe::SubscriptionScheduleUpdateParams::PauseSchedule::Resume))) } def resume=(_resume); end sig { - params(key: T.nilable(String), pause: T.nilable(::Stripe::SubscriptionScheduleUpdateParams::PauseSchedule::Pause), resume: T.nilable(::Stripe::SubscriptionScheduleUpdateParams::PauseSchedule::Resume)).void + params(key: T.nilable(String), pause: T.nilable(::Stripe::SubscriptionScheduleUpdateParams::PauseSchedule::Pause), resume: T.nilable(T.any(String, ::Stripe::SubscriptionScheduleUpdateParams::PauseSchedule::Resume))).void } def initialize(key: nil, pause: nil, resume: nil); end end @@ -1741,7 +1743,7 @@ module Stripe params(_metadata: T.nilable(T.any(String, T::Hash[String, String]))).returns(T.nilable(T.any(String, T::Hash[String, String]))) } def metadata=(_metadata); end - # Sets the pause schedules for the subscription schedule. Include a `key` to update an existing entry or omit it to add a new one. Pass `""` to clear all entries or `[]` to leave them unchanged. + # Configures the subscription's pause behavior and, optionally, its resume behavior. Only one entry is supported. Include a key to update an existing entry. Omit to leave an existing pause schedule unchanged, or pass "" to clear it. sig { returns(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionScheduleUpdateParams::PauseSchedule]))) } diff --git a/rbi/stripe/params/v2/core/account_create_params.rbi b/rbi/stripe/params/v2/core/account_create_params.rbi index 444b0f649..d8a249d96 100644 --- a/rbi/stripe/params/v2/core/account_create_params.rbi +++ b/rbi/stripe/params/v2/core/account_create_params.rbi @@ -928,7 +928,7 @@ module Stripe end class Customer < ::Stripe::RequestParams class AutomaticIndirectTax < ::Stripe::RequestParams - # Describes the customer's tax exemption status, which is `none`, `exempt`, or `reverse`. When set to reverse, invoice and receipt PDFs include the following text: “Reverse charge”. + # Describes the customer's tax exemption status, which is `none`, `exempt`, or `reverse`. When set to reverse, invoice and receipt PDFs include the following text: "Reverse charge". sig { returns(T.nilable(String)) } def exempt; end sig { params(_exempt: T.nilable(String)).returns(T.nilable(String)) } @@ -9050,7 +9050,7 @@ module Stripe } def initialize(files: nil, signer: nil, type: nil); end end - # One or more documents that support the bank account ownership verification requirement. Must be a document associated with the account’s primary active bank account that displays the last 4 digits of the account number, either a statement or a check. + # One or more documents that support the bank account ownership verification requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a check. sig { returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::BankAccountOwnershipVerification)) } @@ -9059,7 +9059,7 @@ module Stripe params(_bank_account_ownership_verification: T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::BankAccountOwnershipVerification)).returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::BankAccountOwnershipVerification)) } def bank_account_ownership_verification=(_bank_account_ownership_verification); end - # One or more documents that demonstrate proof of a company’s license to operate. + # One or more documents that demonstrate proof of a company's license to operate. sig { returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyLicense)) } @@ -9068,7 +9068,7 @@ module Stripe params(_company_license: T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyLicense)).returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyLicense)) } def company_license=(_company_license); end - # One or more documents showing the company’s Memorandum of Association. + # One or more documents showing the company's Memorandum of Association. sig { returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyMemorandumOfAssociation)) } @@ -9077,7 +9077,7 @@ module Stripe params(_company_memorandum_of_association: T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyMemorandumOfAssociation)).returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyMemorandumOfAssociation)) } def company_memorandum_of_association=(_company_memorandum_of_association); end - # Certain countries only: One or more documents showing the ministerial decree legalizing the company’s establishment. + # Certain countries only: One or more documents showing the ministerial decree legalizing the company's establishment. sig { returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyMinisterialDecree)) } @@ -9086,7 +9086,7 @@ module Stripe params(_company_ministerial_decree: T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyMinisterialDecree)).returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyMinisterialDecree)) } def company_ministerial_decree=(_company_ministerial_decree); end - # One or more documents that demonstrate proof of a company’s registration with the appropriate local authorities. + # One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. sig { returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyRegistrationVerification)) } @@ -9095,7 +9095,7 @@ module Stripe params(_company_registration_verification: T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyRegistrationVerification)).returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyRegistrationVerification)) } def company_registration_verification=(_company_registration_verification); end - # One or more documents that demonstrate proof of a company’s tax ID. + # One or more documents that demonstrate proof of a company's tax ID. sig { returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::CompanyTaxIdVerification)) } @@ -9122,7 +9122,7 @@ module Stripe params(_proof_of_address: T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::ProofOfAddress)).returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::ProofOfAddress)) } def proof_of_address=(_proof_of_address); end - # One or more documents showing the company’s proof of registration with the national business registry. + # One or more documents showing the company's proof of registration with the national business registry. sig { returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::BusinessDetails::Documents::ProofOfRegistration)) } @@ -9769,7 +9769,7 @@ module Stripe params(_company_authorization: T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::Individual::Documents::CompanyAuthorization)).returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::Individual::Documents::CompanyAuthorization)) } def company_authorization=(_company_authorization); end - # One or more documents showing the person’s passport page with photo and personal data. + # One or more documents showing the person's passport page with photo and personal data. sig { returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::Individual::Documents::Passport)) } @@ -9796,7 +9796,7 @@ module Stripe params(_secondary_verification: T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::Individual::Documents::SecondaryVerification)).returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::Individual::Documents::SecondaryVerification)) } def secondary_verification=(_secondary_verification); end - # One or more documents showing the person’s visa required for living in the country where they are residing. + # One or more documents showing the person's visa required for living in the country where they are residing. sig { returns(T.nilable(::Stripe::V2::Core::AccountCreateParams::Identity::Individual::Documents::Visa)) } @@ -9841,7 +9841,7 @@ module Stripe def executive; end sig { params(_executive: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } def executive=(_executive); end - # Whether the person is an owner of the account’s identity. + # Whether the person is an owner of the account's identity. sig { returns(T.nilable(T::Boolean)) } def owner; end sig { params(_owner: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } diff --git a/rbi/stripe/params/v2/core/account_token_create_params.rbi b/rbi/stripe/params/v2/core/account_token_create_params.rbi index 7e4ab4ab8..a5869dc4f 100644 --- a/rbi/stripe/params/v2/core/account_token_create_params.rbi +++ b/rbi/stripe/params/v2/core/account_token_create_params.rbi @@ -907,7 +907,7 @@ module Stripe } def initialize(files: nil, signer: nil, type: nil); end end - # One or more documents that support the bank account ownership verification requirement. Must be a document associated with the account’s primary active bank account that displays the last 4 digits of the account number, either a statement or a check. + # One or more documents that support the bank account ownership verification requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a check. sig { returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::BankAccountOwnershipVerification)) } @@ -916,7 +916,7 @@ module Stripe params(_bank_account_ownership_verification: T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::BankAccountOwnershipVerification)).returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::BankAccountOwnershipVerification)) } def bank_account_ownership_verification=(_bank_account_ownership_verification); end - # One or more documents that demonstrate proof of a company’s license to operate. + # One or more documents that demonstrate proof of a company's license to operate. sig { returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyLicense)) } @@ -925,7 +925,7 @@ module Stripe params(_company_license: T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyLicense)).returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyLicense)) } def company_license=(_company_license); end - # One or more documents showing the company’s Memorandum of Association. + # One or more documents showing the company's Memorandum of Association. sig { returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyMemorandumOfAssociation)) } @@ -934,7 +934,7 @@ module Stripe params(_company_memorandum_of_association: T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyMemorandumOfAssociation)).returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyMemorandumOfAssociation)) } def company_memorandum_of_association=(_company_memorandum_of_association); end - # Certain countries only: One or more documents showing the ministerial decree legalizing the company’s establishment. + # Certain countries only: One or more documents showing the ministerial decree legalizing the company's establishment. sig { returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyMinisterialDecree)) } @@ -943,7 +943,7 @@ module Stripe params(_company_ministerial_decree: T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyMinisterialDecree)).returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyMinisterialDecree)) } def company_ministerial_decree=(_company_ministerial_decree); end - # One or more documents that demonstrate proof of a company’s registration with the appropriate local authorities. + # One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. sig { returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyRegistrationVerification)) } @@ -952,7 +952,7 @@ module Stripe params(_company_registration_verification: T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyRegistrationVerification)).returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyRegistrationVerification)) } def company_registration_verification=(_company_registration_verification); end - # One or more documents that demonstrate proof of a company’s tax ID. + # One or more documents that demonstrate proof of a company's tax ID. sig { returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::BusinessDetails::Documents::CompanyTaxIdVerification)) } @@ -1626,7 +1626,7 @@ module Stripe params(_company_authorization: T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::Individual::Documents::CompanyAuthorization)).returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::Individual::Documents::CompanyAuthorization)) } def company_authorization=(_company_authorization); end - # One or more documents showing the person’s passport page with photo and personal data. + # One or more documents showing the person's passport page with photo and personal data. sig { returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::Individual::Documents::Passport)) } @@ -1653,7 +1653,7 @@ module Stripe params(_secondary_verification: T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::Individual::Documents::SecondaryVerification)).returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::Individual::Documents::SecondaryVerification)) } def secondary_verification=(_secondary_verification); end - # One or more documents showing the person’s visa required for living in the country where they are residing. + # One or more documents showing the person's visa required for living in the country where they are residing. sig { returns(T.nilable(::Stripe::V2::Core::AccountTokenCreateParams::Identity::Individual::Documents::Visa)) } @@ -1698,7 +1698,7 @@ module Stripe def executive; end sig { params(_executive: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } def executive=(_executive); end - # Whether the person is an owner of the account’s identity. + # Whether the person is an owner of the account's identity. sig { returns(T.nilable(T::Boolean)) } def owner; end sig { params(_owner: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } diff --git a/rbi/stripe/params/v2/core/account_update_params.rbi b/rbi/stripe/params/v2/core/account_update_params.rbi index 3cf1296f5..d1389e5f8 100644 --- a/rbi/stripe/params/v2/core/account_update_params.rbi +++ b/rbi/stripe/params/v2/core/account_update_params.rbi @@ -9182,7 +9182,7 @@ module Stripe } def initialize(files: nil, signer: nil, type: nil); end end - # One or more documents that support the bank account ownership verification requirement. Must be a document associated with the account’s primary active bank account that displays the last 4 digits of the account number, either a statement or a check. + # One or more documents that support the bank account ownership verification requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a check. sig { returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::BankAccountOwnershipVerification)) } @@ -9191,7 +9191,7 @@ module Stripe params(_bank_account_ownership_verification: T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::BankAccountOwnershipVerification)).returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::BankAccountOwnershipVerification)) } def bank_account_ownership_verification=(_bank_account_ownership_verification); end - # One or more documents that demonstrate proof of a company’s license to operate. + # One or more documents that demonstrate proof of a company's license to operate. sig { returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyLicense)) } @@ -9200,7 +9200,7 @@ module Stripe params(_company_license: T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyLicense)).returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyLicense)) } def company_license=(_company_license); end - # One or more documents showing the company’s Memorandum of Association. + # One or more documents showing the company's Memorandum of Association. sig { returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyMemorandumOfAssociation)) } @@ -9209,7 +9209,7 @@ module Stripe params(_company_memorandum_of_association: T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyMemorandumOfAssociation)).returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyMemorandumOfAssociation)) } def company_memorandum_of_association=(_company_memorandum_of_association); end - # Certain countries only: One or more documents showing the ministerial decree legalizing the company’s establishment. + # Certain countries only: One or more documents showing the ministerial decree legalizing the company's establishment. sig { returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyMinisterialDecree)) } @@ -9218,7 +9218,7 @@ module Stripe params(_company_ministerial_decree: T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyMinisterialDecree)).returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyMinisterialDecree)) } def company_ministerial_decree=(_company_ministerial_decree); end - # One or more documents that demonstrate proof of a company’s registration with the appropriate local authorities. + # One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. sig { returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyRegistrationVerification)) } @@ -9227,7 +9227,7 @@ module Stripe params(_company_registration_verification: T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyRegistrationVerification)).returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyRegistrationVerification)) } def company_registration_verification=(_company_registration_verification); end - # One or more documents that demonstrate proof of a company’s tax ID. + # One or more documents that demonstrate proof of a company's tax ID. sig { returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::BusinessDetails::Documents::CompanyTaxIdVerification)) } @@ -9901,7 +9901,7 @@ module Stripe params(_company_authorization: T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::Individual::Documents::CompanyAuthorization)).returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::Individual::Documents::CompanyAuthorization)) } def company_authorization=(_company_authorization); end - # One or more documents showing the person’s passport page with photo and personal data. + # One or more documents showing the person's passport page with photo and personal data. sig { returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::Individual::Documents::Passport)) } @@ -9928,7 +9928,7 @@ module Stripe params(_secondary_verification: T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::Individual::Documents::SecondaryVerification)).returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::Individual::Documents::SecondaryVerification)) } def secondary_verification=(_secondary_verification); end - # One or more documents showing the person’s visa required for living in the country where they are residing. + # One or more documents showing the person's visa required for living in the country where they are residing. sig { returns(T.nilable(::Stripe::V2::Core::AccountUpdateParams::Identity::Individual::Documents::Visa)) } @@ -9973,7 +9973,7 @@ module Stripe def executive; end sig { params(_executive: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } def executive=(_executive); end - # Whether the person is an owner of the account’s identity. + # Whether the person is an owner of the account's identity. sig { returns(T.nilable(T::Boolean)) } def owner; end sig { params(_owner: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } diff --git a/rbi/stripe/params/v2/core/accounts/person_create_params.rbi b/rbi/stripe/params/v2/core/accounts/person_create_params.rbi index 2feb03027..a8cb40999 100644 --- a/rbi/stripe/params/v2/core/accounts/person_create_params.rbi +++ b/rbi/stripe/params/v2/core/accounts/person_create_params.rbi @@ -310,7 +310,7 @@ module Stripe params(_company_authorization: T.nilable(::Stripe::V2::Core::Accounts::PersonCreateParams::Documents::CompanyAuthorization)).returns(T.nilable(::Stripe::V2::Core::Accounts::PersonCreateParams::Documents::CompanyAuthorization)) } def company_authorization=(_company_authorization); end - # One or more documents showing the person’s passport page with photo and personal data. + # One or more documents showing the person's passport page with photo and personal data. sig { returns(T.nilable(::Stripe::V2::Core::Accounts::PersonCreateParams::Documents::Passport)) } @@ -337,7 +337,7 @@ module Stripe params(_secondary_verification: T.nilable(::Stripe::V2::Core::Accounts::PersonCreateParams::Documents::SecondaryVerification)).returns(T.nilable(::Stripe::V2::Core::Accounts::PersonCreateParams::Documents::SecondaryVerification)) } def secondary_verification=(_secondary_verification); end - # One or more documents showing the person’s visa required for living in the country where they are residing. + # One or more documents showing the person's visa required for living in the country where they are residing. sig { returns(T.nilable(::Stripe::V2::Core::Accounts::PersonCreateParams::Documents::Visa)) } diff --git a/rbi/stripe/params/v2/core/accounts/person_token_create_params.rbi b/rbi/stripe/params/v2/core/accounts/person_token_create_params.rbi index 8c26a9b4b..f5bbcc3d8 100644 --- a/rbi/stripe/params/v2/core/accounts/person_token_create_params.rbi +++ b/rbi/stripe/params/v2/core/accounts/person_token_create_params.rbi @@ -302,7 +302,7 @@ module Stripe params(_company_authorization: T.nilable(::Stripe::V2::Core::Accounts::PersonTokenCreateParams::Documents::CompanyAuthorization)).returns(T.nilable(::Stripe::V2::Core::Accounts::PersonTokenCreateParams::Documents::CompanyAuthorization)) } def company_authorization=(_company_authorization); end - # One or more documents showing the person’s passport page with photo and personal data. + # One or more documents showing the person's passport page with photo and personal data. sig { returns(T.nilable(::Stripe::V2::Core::Accounts::PersonTokenCreateParams::Documents::Passport)) } @@ -329,7 +329,7 @@ module Stripe params(_secondary_verification: T.nilable(::Stripe::V2::Core::Accounts::PersonTokenCreateParams::Documents::SecondaryVerification)).returns(T.nilable(::Stripe::V2::Core::Accounts::PersonTokenCreateParams::Documents::SecondaryVerification)) } def secondary_verification=(_secondary_verification); end - # One or more documents showing the person’s visa required for living in the country where they are residing. + # One or more documents showing the person's visa required for living in the country where they are residing. sig { returns(T.nilable(::Stripe::V2::Core::Accounts::PersonTokenCreateParams::Documents::Visa)) } diff --git a/rbi/stripe/params/v2/core/accounts/person_update_params.rbi b/rbi/stripe/params/v2/core/accounts/person_update_params.rbi index 81bf3544e..508b05c5a 100644 --- a/rbi/stripe/params/v2/core/accounts/person_update_params.rbi +++ b/rbi/stripe/params/v2/core/accounts/person_update_params.rbi @@ -312,7 +312,7 @@ module Stripe params(_company_authorization: T.nilable(::Stripe::V2::Core::Accounts::PersonUpdateParams::Documents::CompanyAuthorization)).returns(T.nilable(::Stripe::V2::Core::Accounts::PersonUpdateParams::Documents::CompanyAuthorization)) } def company_authorization=(_company_authorization); end - # One or more documents showing the person’s passport page with photo and personal data. + # One or more documents showing the person's passport page with photo and personal data. sig { returns(T.nilable(::Stripe::V2::Core::Accounts::PersonUpdateParams::Documents::Passport)) } @@ -339,7 +339,7 @@ module Stripe params(_secondary_verification: T.nilable(::Stripe::V2::Core::Accounts::PersonUpdateParams::Documents::SecondaryVerification)).returns(T.nilable(::Stripe::V2::Core::Accounts::PersonUpdateParams::Documents::SecondaryVerification)) } def secondary_verification=(_secondary_verification); end - # One or more documents showing the person’s visa required for living in the country where they are residing. + # One or more documents showing the person's visa required for living in the country where they are residing. sig { returns(T.nilable(::Stripe::V2::Core::Accounts::PersonUpdateParams::Documents::Visa)) } diff --git a/rbi/stripe/params/v2/money_management/payout_intent_confirm_params.rbi b/rbi/stripe/params/v2/money_management/payout_intent_confirm_params.rbi new file mode 100644 index 000000000..4003e094d --- /dev/null +++ b/rbi/stripe/params/v2/money_management/payout_intent_confirm_params.rbi @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module V2 + module MoneyManagement + class PayoutIntentConfirmParams < ::Stripe::RequestParams; end + end + end +end \ No newline at end of file diff --git a/rbi/stripe/params/v2/money_management/payout_intent_create_params.rbi b/rbi/stripe/params/v2/money_management/payout_intent_create_params.rbi index ae8bf2487..097dbf742 100644 --- a/rbi/stripe/params/v2/money_management/payout_intent_create_params.rbi +++ b/rbi/stripe/params/v2/money_management/payout_intent_create_params.rbi @@ -145,6 +145,11 @@ module Stripe def amount; end sig { params(_amount: ::Stripe::V2::Amount).returns(::Stripe::V2::Amount) } def amount=(_amount); end + # Controls whether the intent requires explicit confirmation before transitioning to pending. Defaults to automatic. + sig { returns(T.nilable(String)) } + def confirmation_method; end + sig { params(_confirmation_method: T.nilable(String)).returns(T.nilable(String)) } + def confirmation_method=(_confirmation_method); end # An arbitrary string attached to the PayoutIntent. Often useful for displaying to users. sig { returns(T.nilable(String)) } def description; end @@ -195,10 +200,11 @@ module Stripe } def to=(_to); end sig { - params(amount: ::Stripe::V2::Amount, description: T.nilable(String), from: ::Stripe::V2::MoneyManagement::PayoutIntentCreateParams::From, metadata: T.nilable(T::Hash[String, String]), recipient_notification: T.nilable(::Stripe::V2::MoneyManagement::PayoutIntentCreateParams::RecipientNotification), schedule_options: T.nilable(::Stripe::V2::MoneyManagement::PayoutIntentCreateParams::ScheduleOptions), statement_descriptor: T.nilable(String), to: ::Stripe::V2::MoneyManagement::PayoutIntentCreateParams::To).void + params(amount: ::Stripe::V2::Amount, confirmation_method: T.nilable(String), description: T.nilable(String), from: ::Stripe::V2::MoneyManagement::PayoutIntentCreateParams::From, metadata: T.nilable(T::Hash[String, String]), recipient_notification: T.nilable(::Stripe::V2::MoneyManagement::PayoutIntentCreateParams::RecipientNotification), schedule_options: T.nilable(::Stripe::V2::MoneyManagement::PayoutIntentCreateParams::ScheduleOptions), statement_descriptor: T.nilable(String), to: ::Stripe::V2::MoneyManagement::PayoutIntentCreateParams::To).void } def initialize( amount: nil, + confirmation_method: nil, description: nil, from: nil, metadata: nil, diff --git a/rbi/stripe/params/v2/money_management/payout_intent_fx_quote_params.rbi b/rbi/stripe/params/v2/money_management/payout_intent_fx_quote_params.rbi new file mode 100644 index 000000000..f0fa7f721 --- /dev/null +++ b/rbi/stripe/params/v2/money_management/payout_intent_fx_quote_params.rbi @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module V2 + module MoneyManagement + class PayoutIntentFxQuoteParams < ::Stripe::RequestParams; end + end + end +end \ No newline at end of file diff --git a/rbi/stripe/params/v2/payments/off_session_payment_capture_params.rbi b/rbi/stripe/params/v2/payments/off_session_payment_capture_params.rbi index 187d8b4bf..7356bc3cf 100644 --- a/rbi/stripe/params/v2/payments/off_session_payment_capture_params.rbi +++ b/rbi/stripe/params/v2/payments/off_session_payment_capture_params.rbi @@ -224,8 +224,8 @@ module Stripe params(_payment_details: T.nilable(::Stripe::V2::Payments::OffSessionPaymentCaptureParams::PaymentDetails)).returns(T.nilable(::Stripe::V2::Payments::OffSessionPaymentCaptureParams::PaymentDetails)) } def payment_details=(_payment_details); end - # Text that appears on the customer’s statement as the statement descriptor for a - # non-card charge. This value overrides the account’s default statement descriptor. + # Text that appears on the customer's statement as the statement descriptor for a + # non-card charge. This value overrides the account's default statement descriptor. # For information about requirements, including the 22-character limit, see the # [Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). sig { returns(T.nilable(String)) } diff --git a/rbi/stripe/params/v2/payments/off_session_payment_create_params.rbi b/rbi/stripe/params/v2/payments/off_session_payment_create_params.rbi index a860af521..25a334632 100644 --- a/rbi/stripe/params/v2/payments/off_session_payment_create_params.rbi +++ b/rbi/stripe/params/v2/payments/off_session_payment_create_params.rbi @@ -384,7 +384,7 @@ module Stripe sig { params(amount: T.nilable(Integer), destination: String).void } def initialize(amount: nil, destination: nil); end end - # The “presentment amount” to be collected from the customer. + # The "presentment amount" to be collected from the customer. sig { returns(::Stripe::V2::Amount) } def amount; end sig { params(_amount: ::Stripe::V2::Amount).returns(::Stripe::V2::Amount) } @@ -493,17 +493,17 @@ module Stripe params(_retry_details: T.nilable(::Stripe::V2::Payments::OffSessionPaymentCreateParams::RetryDetails)).returns(T.nilable(::Stripe::V2::Payments::OffSessionPaymentCreateParams::RetryDetails)) } def retry_details=(_retry_details); end - # Text that appears on the customer’s statement as the statement descriptor for a - # non-card charge. This value overrides the account’s default statement descriptor. + # Text that appears on the customer's statement as the statement descriptor for a + # non-card charge. This value overrides the account's default statement descriptor. # For information about requirements, including the 22-character limit, see the # [Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). 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 account’s + # Provides information about a card charge. Concatenated to the account's # [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) - # to form the complete statement descriptor that appears on the customer’s statement. + # to form the complete statement descriptor that appears on the customer's statement. sig { returns(T.nilable(String)) } def statement_descriptor_suffix; end sig { params(_statement_descriptor_suffix: T.nilable(String)).returns(T.nilable(String)) } diff --git a/rbi/stripe/params/v2/tax/operation_resolve_address_params.rbi b/rbi/stripe/params/v2/tax/operation_resolve_address_params.rbi new file mode 100644 index 000000000..64f8fe9b2 --- /dev/null +++ b/rbi/stripe/params/v2/tax/operation_resolve_address_params.rbi @@ -0,0 +1,52 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module V2 + module Tax + class OperationResolveAddressParams < ::Stripe::RequestParams + class Address < ::Stripe::RequestParams + # The city. + sig { returns(T.nilable(String)) } + def city; end + sig { params(_city: T.nilable(String)).returns(T.nilable(String)) } + def city=(_city); end + # The two-letter country code. + sig { returns(String) } + def country; end + sig { params(_country: String).returns(String) } + def country=(_country); end + # The first line of the street address. + sig { returns(T.nilable(String)) } + def line1; end + sig { params(_line1: T.nilable(String)).returns(T.nilable(String)) } + def line1=(_line1); end + # The postal code. + sig { returns(T.nilable(String)) } + def postal_code; end + sig { params(_postal_code: T.nilable(String)).returns(T.nilable(String)) } + def postal_code=(_postal_code); end + # The state or province. + sig { returns(T.nilable(String)) } + def state; end + sig { params(_state: T.nilable(String)).returns(T.nilable(String)) } + def state=(_state); end + sig { + params(city: T.nilable(String), country: String, line1: T.nilable(String), postal_code: T.nilable(String), state: T.nilable(String)).void + } + def initialize(city: nil, country: nil, line1: nil, postal_code: nil, state: nil); end + end + # The address to resolve. + sig { returns(::Stripe::V2::Tax::OperationResolveAddressParams::Address) } + def address; end + sig { + params(_address: ::Stripe::V2::Tax::OperationResolveAddressParams::Address).returns(::Stripe::V2::Tax::OperationResolveAddressParams::Address) + } + def address=(_address); end + sig { params(address: ::Stripe::V2::Tax::OperationResolveAddressParams::Address).void } + def initialize(address: nil); end + end + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/account.rbi b/rbi/stripe/resources/account.rbi index b152dd28f..49bc04f93 100644 --- a/rbi/stripe/resources/account.rbi +++ b/rbi/stripe/resources/account.rbi @@ -313,7 +313,7 @@ module Stripe # The status of the SEPA Direct Debits payments capability of the account, or whether the account can directly process SEPA Direct Debits charges. sig { returns(T.nilable(String)) } def sepa_debit_payments; end - # The status of the Sequra capability of the account, or whether the account can directly process Sequra payments. + # The status of the SeQura capability of the account, or whether the account can directly process SeQura payments. sig { returns(T.nilable(String)) } def sequra_payments; end # The status of the ShopeePay capability of the account, or whether the account can directly process ShopeePay payments. diff --git a/rbi/stripe/resources/billing_portal/session.rbi b/rbi/stripe/resources/billing_portal/session.rbi index b55d76e74..5066ec558 100644 --- a/rbi/stripe/resources/billing_portal/session.rbi +++ b/rbi/stripe/resources/billing_portal/session.rbi @@ -59,6 +59,14 @@ module Stripe @field_remappings = {} end end + class CustomerUpdate < ::Stripe::StripeObject + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end class SubscriptionCancel < ::Stripe::StripeObject class Retention < ::Stripe::StripeObject class CouponOffer < ::Stripe::StripeObject @@ -160,6 +168,9 @@ module Stripe # Attribute for field after_completion sig { returns(AfterCompletion) } def after_completion; end + # Configuration when `flow.type=customer_update`. + sig { returns(T.nilable(CustomerUpdate)) } + def customer_update; end # Configuration when `flow.type=subscription_cancel`. sig { returns(T.nilable(SubscriptionCancel)) } def subscription_cancel; end @@ -175,6 +186,7 @@ module Stripe def self.inner_class_types @inner_class_types = { after_completion: AfterCompletion, + customer_update: CustomerUpdate, subscription_cancel: SubscriptionCancel, subscription_update: SubscriptionUpdate, subscription_update_confirm: SubscriptionUpdateConfirm, diff --git a/rbi/stripe/resources/charge.rbi b/rbi/stripe/resources/charge.rbi index 47c253308..e37b77c01 100644 --- a/rbi/stripe/resources/charge.rbi +++ b/rbi/stripe/resources/charge.rbi @@ -1722,9 +1722,9 @@ module Stripe # You could use this attribute to get a sense of international fees. sig { returns(T.nilable(String)) } def country; end - # The pricing bundle applied to this Link payment at confirmation time. Maps to a bundle in your Stripe pricing contract and on Stripe's published pricing page. Omitted if bundle lookup failed at confirmation time. + # The funding source group applied to this Link payment at confirmation time. Maps to a bundle in your Stripe pricing contract and on Stripe's published pricing page. Omitted if group lookup failed at confirmation time. sig { returns(T.nilable(String)) } - def pricing_group; end + def funding_source_group; end def self.inner_class_types @inner_class_types = {} end @@ -2051,7 +2051,7 @@ module Stripe # Uniquely identifies this particular Pix account. You can use this attribute to check whether two Pix accounts are the same. sig { returns(T.nilable(String)) } def fingerprint; end - # ID of the multi use Mandate generated by the PaymentIntent + # ID of the multi use Mandate generated by the PaymentIntent or SetupIntent. sig { returns(T.nilable(String)) } def mandate; end def self.inner_class_types @@ -2231,7 +2231,7 @@ module Stripe end end class Sequra < ::Stripe::StripeObject - # The Sequra transaction ID associated with this payment. + # The SeQura transaction ID associated with this payment. sig { returns(T.nilable(String)) } def transaction_id; end def self.inner_class_types @@ -2345,7 +2345,7 @@ module Stripe end end class Twint < ::Stripe::StripeObject - # ID of the multi use Mandate generated by the PaymentIntent + # ID of the multi use Mandate generated by the PaymentIntent or SetupIntent. sig { returns(T.nilable(String)) } def mandate; end def self.inner_class_types diff --git a/rbi/stripe/resources/climate/order.rbi b/rbi/stripe/resources/climate/order.rbi index 26102e0ab..b284941fa 100644 --- a/rbi/stripe/resources/climate/order.rbi +++ b/rbi/stripe/resources/climate/order.rbi @@ -103,7 +103,7 @@ module Stripe # Details about the delivery of carbon removal for this order. sig { returns(T::Array[DeliveryDetail]) } def delivery_details; end - # The year this order is expected to be delivered. + # The year this order is expected to be delivered. If the year is in the past, the order is a spot purchase and will be delivered within 30 days of purchase. sig { returns(Integer) } def expected_delivery_year; end # Unique identifier for the object. diff --git a/rbi/stripe/resources/climate/product.rbi b/rbi/stripe/resources/climate/product.rbi index 8757e2036..fc4a97075 100644 --- a/rbi/stripe/resources/climate/product.rbi +++ b/rbi/stripe/resources/climate/product.rbi @@ -30,7 +30,7 @@ module Stripe # Current prices for a metric ton of carbon removal in a currency's smallest unit. sig { returns(T::Hash[String, CurrentPricesPerMetricTon]) } def current_prices_per_metric_ton; end - # The year in which the carbon removal is expected to be delivered. + # The year in which the carbon removal is expected to be delivered. If the year is in the past, this represents spot inventory with guaranteed delivery. sig { returns(T.nilable(Integer)) } def delivery_year; end # Unique identifier for the object. For convenience, Climate product IDs are human-readable strings diff --git a/rbi/stripe/resources/crypto/onramp_session.rbi b/rbi/stripe/resources/crypto/onramp_session.rbi index f9dd804a9..7a21ad379 100644 --- a/rbi/stripe/resources/crypto/onramp_session.rbi +++ b/rbi/stripe/resources/crypto/onramp_session.rbi @@ -46,6 +46,9 @@ module Stripe # A bitcoin address sig { returns(T.nilable(String)) } def bitcoin; end + # A Celo address + sig { returns(T.nilable(String)) } + def celo; end # The end customer's crypto wallet destination tag (for each network) to use for this transaction. sig { returns(T.nilable(DestinationTags)) } def destination_tags; end diff --git a/rbi/stripe/resources/customer_session.rbi b/rbi/stripe/resources/customer_session.rbi index a3854a0e6..08a79d671 100644 --- a/rbi/stripe/resources/customer_session.rbi +++ b/rbi/stripe/resources/customer_session.rbi @@ -22,6 +22,17 @@ module Stripe @field_remappings = {} end end + class CustomerPortal < ::Stripe::StripeObject + # Whether the customer portal is enabled. + sig { returns(T::Boolean) } + def enabled; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end class CustomerSheet < ::Stripe::StripeObject class Features < ::Stripe::StripeObject # A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the customer sheet displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list. @@ -193,6 +204,9 @@ module Stripe # This hash contains whether the buy button is enabled. sig { returns(BuyButton) } def buy_button; end + # This hash contains whether the customer portal is enabled. + sig { returns(CustomerPortal) } + def customer_portal; end # This hash contains whether the customer sheet is enabled and the features it supports. sig { returns(CustomerSheet) } def customer_sheet; end @@ -211,6 +225,7 @@ module Stripe def self.inner_class_types @inner_class_types = { buy_button: BuyButton, + customer_portal: CustomerPortal, customer_sheet: CustomerSheet, mobile_payment_element: MobilePaymentElement, payment_element: PaymentElement, diff --git a/rbi/stripe/resources/financial_connections/account.rbi b/rbi/stripe/resources/financial_connections/account.rbi index e9020d958..4bed598f5 100644 --- a/rbi/stripe/resources/financial_connections/account.rbi +++ b/rbi/stripe/resources/financial_connections/account.rbi @@ -120,6 +120,39 @@ module Stripe @field_remappings = {} end end + class ClassificationState < ::Stripe::StripeObject + # The taxonomy classification status for this account. One of 'pending' or 'completed'. + sig { returns(T.nilable(String)) } + def status; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + class EnrichmentState < ::Stripe::StripeObject + class Merchant < ::Stripe::StripeObject + # The merchant enrichment status for this account. One of 'pending' or 'completed'. + sig { returns(T.nilable(String)) } + def status; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + # The enrichment status for merchant name normalization. + sig { returns(T.nilable(Merchant)) } + def merchant; end + def self.inner_class_types + @inner_class_types = {merchant: Merchant} + end + def self.field_remappings + @field_remappings = {} + end + end class InferredBalancesRefresh < ::Stripe::StripeObject # The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch. sig { returns(Integer) } @@ -237,12 +270,18 @@ module Stripe # The type of the account. Account category is further divided in `subcategory`. sig { returns(String) } def category; end + # Per-taxonomy processing state for this account. One entry per subscribed taxonomy. + sig { returns(T.nilable(T::Hash[String, ClassificationState])) } + def classification_state; end # Time at which the object was created. Measured in seconds since the Unix epoch. sig { returns(Integer) } def created; end # A human-readable name that has been assigned to this account, either by the account holder or by the institution. sig { returns(T.nilable(String)) } def display_name; end + # The state of merchant name enrichment for this account. + sig { returns(T.nilable(EnrichmentState)) } + def enrichment_state; end # Unique identifier for the object. sig { returns(String) } def id; end diff --git a/rbi/stripe/resources/financial_connections/session.rbi b/rbi/stripe/resources/financial_connections/session.rbi index 535995d44..5c5051074 100644 --- a/rbi/stripe/resources/financial_connections/session.rbi +++ b/rbi/stripe/resources/financial_connections/session.rbi @@ -33,6 +33,9 @@ module Stripe # List of countries from which to filter accounts. sig { returns(T.nilable(T::Array[String])) } def countries; end + # Country from which to filter accounts. + sig { returns(T.nilable(String)) } + def country; end # Stripe ID of the institution with which the customer should be directed to log in. sig { returns(T.nilable(String)) } def institution; end diff --git a/rbi/stripe/resources/financial_connections/transaction.rbi b/rbi/stripe/resources/financial_connections/transaction.rbi index 118145e72..cb72e9cd2 100644 --- a/rbi/stripe/resources/financial_connections/transaction.rbi +++ b/rbi/stripe/resources/financial_connections/transaction.rbi @@ -6,6 +6,82 @@ module Stripe module FinancialConnections # A Transaction represents a real transaction that affects a Financial Connections Account balance. class Transaction < APIResource + class Classification < ::Stripe::StripeObject + class MoneyMovement < ::Stripe::StripeObject + # Stripe's confidence in this classification. + sig { returns(T.nilable(String)) } + def confidence_level; end + # The detailed category label for this transaction. + sig { returns(T.nilable(String)) } + def detailed_label; end + # The primary category label for this transaction. + sig { returns(T.nilable(String)) } + def primary_label; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + class PersonalFinance < ::Stripe::StripeObject + # Stripe's confidence in this classification. + sig { returns(T.nilable(String)) } + def confidence_level; end + # The detailed category label for this transaction. + sig { returns(T.nilable(String)) } + def detailed_label; end + # The primary category label for this transaction. + sig { returns(T.nilable(String)) } + def primary_label; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + # Money movement classification labels for this transaction. + sig { returns(T.nilable(MoneyMovement)) } + def money_movement; end + # Personal finance classification labels for this transaction. + sig { returns(T.nilable(PersonalFinance)) } + def personal_finance; end + # The taxonomy type for this classification entry. + sig { returns(String) } + def type; end + def self.inner_class_types + @inner_class_types = {money_movement: MoneyMovement, personal_finance: PersonalFinance} + end + def self.field_remappings + @field_remappings = {} + end + end + class Enrichments < ::Stripe::StripeObject + class Merchant < ::Stripe::StripeObject + # Stripe's confidence in the enriched merchant name. + sig { returns(T.nilable(String)) } + def confidence_level; end + # The normalized merchant name for this transaction. + sig { returns(T.nilable(String)) } + def name; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + # Attribute for field merchant + sig { returns(Merchant) } + def merchant; end + def self.inner_class_types + @inner_class_types = {merchant: Merchant} + end + def self.field_remappings + @field_remappings = {} + end + end class StatusTransitions < ::Stripe::StripeObject # Time at which this transaction posted. Measured in seconds since the Unix epoch. sig { returns(T.nilable(Integer)) } @@ -26,12 +102,18 @@ module Stripe # The amount of this transaction, in cents (or local equivalent). sig { returns(Integer) } def amount; end + # Classification labels for this transaction, one entry per subscribed use case. + sig { returns(T.nilable(T::Array[Classification])) } + def classifications; end # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). sig { returns(String) } def currency; end # The description of this transaction. sig { returns(String) } def description; end + # Enriched merchant information for this transaction. + sig { returns(T.nilable(Enrichments)) } + def enrichments; end # Unique identifier for the object. sig { returns(String) } def id; end diff --git a/rbi/stripe/resources/invoice.rbi b/rbi/stripe/resources/invoice.rbi index e22549937..d774dfc2f 100644 --- a/rbi/stripe/resources/invoice.rbi +++ b/rbi/stripe/resources/invoice.rbi @@ -159,6 +159,23 @@ module Stripe @field_remappings = {} end end + class CustomerBalance < ::Stripe::StripeObject + # The total amount of customer balance applied to this invoice (automatically + manually). + sig { returns(Integer) } + def applied_balance; end + # The amount of customer balance automatically applied during invoice finalization. + sig { returns(Integer) } + def automatically_applied_balance; end + # The total amount of customer balance manually applied after finalization. + sig { returns(Integer) } + def manually_applied_balance; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end class CustomerShipping < ::Stripe::StripeObject class Address < ::Stripe::StripeObject # City, district, suburb, town, or village. @@ -483,6 +500,14 @@ module Stripe @field_remappings = {} end end + class Billie < ::Stripe::StripeObject + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end class Bizum < ::Stripe::StripeObject def self.inner_class_types @inner_class_types = {} @@ -733,6 +758,9 @@ module Stripe # If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. sig { returns(T.nilable(Bancontact)) } def bancontact; end + # If paying by `billie`, this sub-hash contains details about the Billie payment method options to pass to the invoice’s PaymentIntent. + sig { returns(T.nilable(Billie)) } + def billie; end # If paying by `bizum`, this sub-hash contains details about the Bizum payment method options to pass to the invoice’s PaymentIntent. sig { returns(T.nilable(Bizum)) } def bizum; end @@ -776,6 +804,7 @@ module Stripe @inner_class_types = { acss_debit: AcssDebit, bancontact: Bancontact, + billie: Billie, bizum: Bizum, blik: Blik, card: Card, @@ -1155,6 +1184,9 @@ module Stripe # The customer's address. Until the invoice is finalized, this field will equal `customer.address`. Once the invoice is finalized, this field will no longer be updated. sig { returns(T.nilable(CustomerAddress)) } def customer_address; end + # The customer balance amounts applied to this invoice. + sig { returns(T.nilable(CustomerBalance)) } + def customer_balance; end # The customer's email. Until the invoice is finalized, this field will equal `customer.email`. Once the invoice is finalized, this field will no longer be updated. sig { returns(T.nilable(String)) } def customer_email; end diff --git a/rbi/stripe/resources/issuing/authorization.rbi b/rbi/stripe/resources/issuing/authorization.rbi index bcf8aa7de..7c9c02f1b 100644 --- a/rbi/stripe/resources/issuing/authorization.rbi +++ b/rbi/stripe/resources/issuing/authorization.rbi @@ -644,6 +644,62 @@ module Stripe @field_remappings = {} end end + class HoldAmount < ::Stripe::StripeObject + # Three-letter ISO currency code. + sig { returns(String) } + def currency; end + # The amount in the smallest currency unit. + sig { returns(Integer) } + def value; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + class HoldAmountDetails < ::Stripe::StripeObject + class Network < ::Stripe::StripeObject + # Three-letter ISO currency code. + sig { returns(String) } + def currency; end + # The amount in the smallest currency unit. + sig { returns(Integer) } + def value; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + class Reserve < ::Stripe::StripeObject + # Three-letter ISO currency code. + sig { returns(String) } + def currency; end + # The amount in the smallest currency unit. + sig { returns(Integer) } + def value; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + # Attribute for field network + sig { returns(Network) } + def network; end + # The reserve amount held for this authorization. Present for certain MCCs that may have overcaptures. + sig { returns(T.nilable(Reserve)) } + def reserve; end + def self.inner_class_types + @inner_class_types = {network: Network, reserve: Reserve} + end + def self.field_remappings + @field_remappings = {} + end + end # The additional amount Stripe will hold if the authorization is approved, in the card's [currency](https://docs.stripe.com/api#issuing_authorization_object-pending-request-currency) and in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). sig { returns(Integer) } def amount; end @@ -653,6 +709,12 @@ module Stripe # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). sig { returns(String) } def currency; end + # The total amount to be held for this authorization request. + sig { returns(T.nilable(HoldAmount)) } + def hold_amount; end + # Breakdown of the amounts contributing to hold_amount. + sig { returns(T.nilable(HoldAmountDetails)) } + def hold_amount_details; end # If set `true`, you may provide [amount](https://docs.stripe.com/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. sig { returns(T::Boolean) } def is_amount_controllable; end @@ -666,7 +728,11 @@ module Stripe sig { returns(T.nilable(Integer)) } def network_risk_score; end def self.inner_class_types - @inner_class_types = {amount_details: AmountDetails} + @inner_class_types = { + amount_details: AmountDetails, + hold_amount: HoldAmount, + hold_amount_details: HoldAmountDetails, + } end def self.field_remappings @field_remappings = {} @@ -698,6 +764,62 @@ module Stripe @field_remappings = {} end end + class HoldAmount < ::Stripe::StripeObject + # Three-letter ISO currency code. + sig { returns(String) } + def currency; end + # The amount in the smallest currency unit. + sig { returns(Integer) } + def value; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + class HoldAmountDetails < ::Stripe::StripeObject + class Network < ::Stripe::StripeObject + # Three-letter ISO currency code. + sig { returns(String) } + def currency; end + # The amount in the smallest currency unit. + sig { returns(Integer) } + def value; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + class Reserve < ::Stripe::StripeObject + # Three-letter ISO currency code. + sig { returns(String) } + def currency; end + # The amount in the smallest currency unit. + sig { returns(Integer) } + def value; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + # Attribute for field network + sig { returns(Network) } + def network; end + # The reserve amount held for this authorization. Present for certain MCCs that may have overcaptures. + sig { returns(T.nilable(Reserve)) } + def reserve; end + def self.inner_class_types + @inner_class_types = {network: Network, reserve: Reserve} + end + def self.field_remappings + @field_remappings = {} + end + end class NetworkData < ::Stripe::StripeObject class TraceId < ::Stripe::StripeObject # The unique reference number within the specified financial network on the specified network date. @@ -744,6 +866,12 @@ module Stripe # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). sig { returns(String) } def currency; end + # The total amount that was held for this authorization request. + sig { returns(T.nilable(HoldAmount)) } + def hold_amount; end + # Breakdown of the amounts contributing to hold_amount. + sig { returns(T.nilable(HoldAmountDetails)) } + def hold_amount_details; end # The `pending_request.merchant_amount` at the time of the request, presented in the `merchant_currency` and in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). sig { returns(Integer) } def merchant_amount; end @@ -766,7 +894,12 @@ module Stripe sig { returns(T.nilable(Integer)) } def requested_at; end def self.inner_class_types - @inner_class_types = {amount_details: AmountDetails, network_data: NetworkData} + @inner_class_types = { + amount_details: AmountDetails, + hold_amount: HoldAmount, + hold_amount_details: HoldAmountDetails, + network_data: NetworkData, + } end def self.field_remappings @field_remappings = {} diff --git a/rbi/stripe/resources/issuing/cardholder.rbi b/rbi/stripe/resources/issuing/cardholder.rbi index 4ac596f1b..2c94fe9b5 100644 --- a/rbi/stripe/resources/issuing/cardholder.rbi +++ b/rbi/stripe/resources/issuing/cardholder.rbi @@ -256,7 +256,7 @@ module Stripe # The cardholder's phone number. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://docs.stripe.com/issuing/3d-secure#when-is-3d-secure-applied) for more details. sig { returns(T.nilable(String)) } def phone_number; end - # The cardholder’s preferred locales (languages), ordered by preference. Locales can be `da`, `de`, `en`, `es`, `fr`, `it`, `pl`, or `sv`. + # The cardholder’s preferred locales (languages), ordered by preference. Locales can be `de`, `en`, `es`, `fr`, or `it`. # This changes the language of the [3D Secure flow](https://docs.stripe.com/issuing/3d-secure) and one-time password messages sent to the cardholder. sig { returns(T.nilable(T::Array[String])) } def preferred_locales; end diff --git a/rbi/stripe/resources/payment_attempt_record.rbi b/rbi/stripe/resources/payment_attempt_record.rbi index 3820af25e..15e889019 100644 --- a/rbi/stripe/resources/payment_attempt_record.rbi +++ b/rbi/stripe/resources/payment_attempt_record.rbi @@ -1673,7 +1673,7 @@ module Stripe # Unique transaction id generated by BCB sig { returns(T.nilable(String)) } def bank_transaction_id; end - # ID of the multi use Mandate generated by the PaymentIntent + # ID of the multi use Mandate generated by the PaymentIntent or SetupIntent. sig { returns(T.nilable(String)) } def mandate; end def self.inner_class_types @@ -1853,7 +1853,7 @@ module Stripe end end class Sequra < ::Stripe::StripeObject - # The Sequra transaction ID associated with this payment. + # The SeQura transaction ID associated with this payment. sig { returns(T.nilable(String)) } def transaction_id; end def self.inner_class_types @@ -1965,7 +1965,7 @@ module Stripe end end class Twint < ::Stripe::StripeObject - # ID of the multi use Mandate generated by the PaymentIntent + # ID of the multi use Mandate generated by the PaymentIntent or SetupIntent. sig { returns(T.nilable(String)) } def mandate; end def self.inner_class_types diff --git a/rbi/stripe/resources/payment_intent.rbi b/rbi/stripe/resources/payment_intent.rbi index 30a5bea99..4a9d3c00b 100644 --- a/rbi/stripe/resources/payment_intent.rbi +++ b/rbi/stripe/resources/payment_intent.rbi @@ -4925,6 +4925,15 @@ module Stripe # Controls when the funds will be captured from the customer's account. sig { returns(T.nilable(String)) } def capture_method; end + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(T.nilable(String)) } + def setup_future_usage; end def self.inner_class_types @inner_class_types = {} end diff --git a/rbi/stripe/resources/payment_record.rbi b/rbi/stripe/resources/payment_record.rbi index d5108ddd2..140977163 100644 --- a/rbi/stripe/resources/payment_record.rbi +++ b/rbi/stripe/resources/payment_record.rbi @@ -1673,7 +1673,7 @@ module Stripe # Unique transaction id generated by BCB sig { returns(T.nilable(String)) } def bank_transaction_id; end - # ID of the multi use Mandate generated by the PaymentIntent + # ID of the multi use Mandate generated by the PaymentIntent or SetupIntent. sig { returns(T.nilable(String)) } def mandate; end def self.inner_class_types @@ -1853,7 +1853,7 @@ module Stripe end end class Sequra < ::Stripe::StripeObject - # The Sequra transaction ID associated with this payment. + # The SeQura transaction ID associated with this payment. sig { returns(T.nilable(String)) } def transaction_id; end def self.inner_class_types @@ -1965,7 +1965,7 @@ module Stripe end end class Twint < ::Stripe::StripeObject - # ID of the multi use Mandate generated by the PaymentIntent + # ID of the multi use Mandate generated by the PaymentIntent or SetupIntent. sig { returns(T.nilable(String)) } def mandate; end def self.inner_class_types diff --git a/rbi/stripe/resources/quote_preview_invoice.rbi b/rbi/stripe/resources/quote_preview_invoice.rbi index 71ea8c74e..bdede01b5 100644 --- a/rbi/stripe/resources/quote_preview_invoice.rbi +++ b/rbi/stripe/resources/quote_preview_invoice.rbi @@ -176,6 +176,23 @@ module Stripe @field_remappings = {} end end + class CustomerBalance < ::Stripe::StripeObject + # The total amount of customer balance applied to this invoice (automatically + manually). + sig { returns(Integer) } + def applied_balance; end + # The amount of customer balance automatically applied during invoice finalization. + sig { returns(Integer) } + def automatically_applied_balance; end + # The total amount of customer balance manually applied after finalization. + sig { returns(Integer) } + def manually_applied_balance; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end class CustomerShipping < ::Stripe::StripeObject class Address < ::Stripe::StripeObject # City, district, suburb, town, or village. @@ -500,6 +517,14 @@ module Stripe @field_remappings = {} end end + class Billie < ::Stripe::StripeObject + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end class Bizum < ::Stripe::StripeObject def self.inner_class_types @inner_class_types = {} @@ -750,6 +775,9 @@ module Stripe # If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. sig { returns(T.nilable(Bancontact)) } def bancontact; end + # If paying by `billie`, this sub-hash contains details about the Billie payment method options to pass to the invoice’s PaymentIntent. + sig { returns(T.nilable(Billie)) } + def billie; end # If paying by `bizum`, this sub-hash contains details about the Bizum payment method options to pass to the invoice’s PaymentIntent. sig { returns(T.nilable(Bizum)) } def bizum; end @@ -793,6 +821,7 @@ module Stripe @inner_class_types = { acss_debit: AcssDebit, bancontact: Bancontact, + billie: Billie, bizum: Bizum, blik: Blik, card: Card, @@ -1169,6 +1198,9 @@ module Stripe # The customer's address. Until the invoice is finalized, this field will equal `customer.address`. Once the invoice is finalized, this field will no longer be updated. sig { returns(T.nilable(CustomerAddress)) } def customer_address; end + # The customer balance amounts applied to this invoice. + sig { returns(T.nilable(CustomerBalance)) } + def customer_balance; end # The customer's email. Until the invoice is finalized, this field will equal `customer.email`. Once the invoice is finalized, this field will no longer be updated. sig { returns(T.nilable(String)) } def customer_email; end diff --git a/rbi/stripe/resources/quote_preview_subscription_schedule.rbi b/rbi/stripe/resources/quote_preview_subscription_schedule.rbi index 5509d858d..c8ffb1725 100644 --- a/rbi/stripe/resources/quote_preview_subscription_schedule.rbi +++ b/rbi/stripe/resources/quote_preview_subscription_schedule.rbi @@ -376,14 +376,45 @@ module Stripe @field_remappings = {} end end + class Status < ::Stripe::StripeObject + class Error < ::Stripe::StripeObject + # A machine-readable error code. + sig { returns(T.nilable(String)) } + def code; end + # A description of the error. + sig { returns(String) } + def message; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + # Attribute for field error + sig { returns(T.nilable(Error)) } + def error; end + # The lifecycle state of the pause operation. + sig { returns(String) } + def type; end + def self.inner_class_types + @inner_class_types = {error: Error} + end + def self.field_remappings + @field_remappings = {} + end + end # Time at which the subscription pauses. sig { returns(Integer) } def pause_at; end # Settings controlling billing behavior during the pause. sig { returns(T.nilable(Settings)) } def settings; end + # Attribute for field status + sig { returns(Status) } + def status; end def self.inner_class_types - @inner_class_types = {settings: Settings} + @inner_class_types = {settings: Settings, status: Status} end def self.field_remappings @field_remappings = {} @@ -407,14 +438,45 @@ module Stripe @field_remappings = {} end end + class Status < ::Stripe::StripeObject + class Error < ::Stripe::StripeObject + # A machine-readable error code. + sig { returns(T.nilable(String)) } + def code; end + # A description of the error. + sig { returns(String) } + def message; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + # Attribute for field error + sig { returns(T.nilable(Error)) } + def error; end + # The lifecycle state of the resume operation. + sig { returns(String) } + def type; end + def self.inner_class_types + @inner_class_types = {error: Error} + end + def self.field_remappings + @field_remappings = {} + end + end # Time at which the subscription resumes. sig { returns(Integer) } def resume_at; end # Attribute for field settings sig { returns(Settings) } def settings; end + # Attribute for field status + sig { returns(Status) } + def status; end def self.inner_class_types - @inner_class_types = {settings: Settings} + @inner_class_types = {settings: Settings, status: Status} end def self.field_remappings @field_remappings = {} diff --git a/rbi/stripe/resources/subscription.rbi b/rbi/stripe/resources/subscription.rbi index 416782893..b48a0fc49 100644 --- a/rbi/stripe/resources/subscription.rbi +++ b/rbi/stripe/resources/subscription.rbi @@ -333,6 +333,14 @@ module Stripe @field_remappings = {} end end + class Billie < ::Stripe::StripeObject + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end class Bizum < ::Stripe::StripeObject class MandateOptions < ::Stripe::StripeObject # Amount to be charged for future payments. Required when `amount_type=fixed`. @@ -643,6 +651,9 @@ module Stripe # This sub-hash contains details about the Bancontact payment method options to pass to invoices created by the subscription. sig { returns(T.nilable(Bancontact)) } def bancontact; end + # This sub-hash contains details about the Billie payment method options to pass to invoices created by the subscription. + sig { returns(T.nilable(Billie)) } + def billie; end # This sub-hash contains details about the Bizum payment method options to pass to invoices created by the subscription. sig { returns(T.nilable(Bizum)) } def bizum; end @@ -686,6 +697,7 @@ module Stripe @inner_class_types = { acss_debit: AcssDebit, bancontact: Bancontact, + billie: Billie, bizum: Bizum, blik: Blik, card: Card, diff --git a/rbi/stripe/resources/subscription_schedule.rbi b/rbi/stripe/resources/subscription_schedule.rbi index 9a409d668..8372dbe53 100644 --- a/rbi/stripe/resources/subscription_schedule.rbi +++ b/rbi/stripe/resources/subscription_schedule.rbi @@ -362,14 +362,45 @@ module Stripe @field_remappings = {} end end + class Status < ::Stripe::StripeObject + class Error < ::Stripe::StripeObject + # A machine-readable error code. + sig { returns(T.nilable(String)) } + def code; end + # A description of the error. + sig { returns(String) } + def message; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + # Attribute for field error + sig { returns(T.nilable(Error)) } + def error; end + # The lifecycle state of the pause operation. + sig { returns(String) } + def type; end + def self.inner_class_types + @inner_class_types = {error: Error} + end + def self.field_remappings + @field_remappings = {} + end + end # Time at which the subscription pauses. sig { returns(Integer) } def pause_at; end # Settings controlling billing behavior during the pause. sig { returns(T.nilable(Settings)) } def settings; end + # Attribute for field status + sig { returns(Status) } + def status; end def self.inner_class_types - @inner_class_types = {settings: Settings} + @inner_class_types = {settings: Settings, status: Status} end def self.field_remappings @field_remappings = {} @@ -393,14 +424,45 @@ module Stripe @field_remappings = {} end end + class Status < ::Stripe::StripeObject + class Error < ::Stripe::StripeObject + # A machine-readable error code. + sig { returns(T.nilable(String)) } + def code; end + # A description of the error. + sig { returns(String) } + def message; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + # Attribute for field error + sig { returns(T.nilable(Error)) } + def error; end + # The lifecycle state of the resume operation. + sig { returns(String) } + def type; end + def self.inner_class_types + @inner_class_types = {error: Error} + end + def self.field_remappings + @field_remappings = {} + end + end # Time at which the subscription resumes. sig { returns(Integer) } def resume_at; end # Attribute for field settings sig { returns(Settings) } def settings; end + # Attribute for field status + sig { returns(Status) } + def status; end def self.inner_class_types - @inner_class_types = {settings: Settings} + @inner_class_types = {settings: Settings, status: Status} end def self.field_remappings @field_remappings = {} diff --git a/rbi/stripe/resources/v2/core/account.rbi b/rbi/stripe/resources/v2/core/account.rbi index ce733fbc4..ccc3f3ff9 100644 --- a/rbi/stripe/resources/v2/core/account.rbi +++ b/rbi/stripe/resources/v2/core/account.rbi @@ -18897,22 +18897,22 @@ module Stripe @field_remappings = {} end end - # One or more documents that support the Bank account ownership verification requirement. Must be a document associated with the account’s primary active bank account that displays the last 4 digits of the account number, either a statement or a check. + # One or more documents that support the Bank account ownership verification requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a check. sig { returns(T.nilable(BankAccountOwnershipVerification)) } def bank_account_ownership_verification; end - # One or more documents that demonstrate proof of a company’s license to operate. + # One or more documents that demonstrate proof of a company's license to operate. sig { returns(T.nilable(CompanyLicense)) } def company_license; end - # One or more documents showing the company’s Memorandum of Association. + # One or more documents showing the company's Memorandum of Association. sig { returns(T.nilable(CompanyMemorandumOfAssociation)) } def company_memorandum_of_association; end - # Certain countries only: One or more documents showing the ministerial decree legalizing the company’s establishment. + # Certain countries only: One or more documents showing the ministerial decree legalizing the company's establishment. sig { returns(T.nilable(CompanyMinisterialDecree)) } def company_ministerial_decree; end - # One or more documents that demonstrate proof of a company’s registration with the appropriate local authorities. + # One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. sig { returns(T.nilable(CompanyRegistrationVerification)) } def company_registration_verification; end - # One or more documents that demonstrate proof of a company’s tax ID. + # One or more documents that demonstrate proof of a company's tax ID. sig { returns(T.nilable(CompanyTaxIdVerification)) } def company_tax_id_verification; end # A document verifying the business. @@ -18921,7 +18921,7 @@ module Stripe # One or more documents that demonstrate proof of address. sig { returns(T.nilable(ProofOfAddress)) } def proof_of_address; end - # One or more documents showing the company’s proof of registration with the national business registry. + # One or more documents showing the company's proof of registration with the national business registry. sig { returns(T.nilable(ProofOfRegistration)) } def proof_of_registration; end # One or more documents that demonstrate proof of ultimate beneficial ownership. @@ -19098,7 +19098,7 @@ module Stripe # Additional addresses associated with the business. sig { returns(T.nilable(T::Array[AdditionalAddress])) } def additional_addresses; end - # The company’s primary address. + # The company's primary address. sig { returns(T.nilable(Address)) } def address; end # The business gross annual revenue for its preceding fiscal year. @@ -19119,7 +19119,7 @@ module Stripe # An estimate of the monthly revenue of the business. Only accepted for accounts in Brazil and India. sig { returns(T.nilable(MonthlyEstimatedRevenue)) } def monthly_estimated_revenue; end - # The company’s phone number (used for verification). + # The company's phone number (used for verification). sig { returns(T.nilable(String)) } def phone; end # The business legal name. @@ -19383,7 +19383,7 @@ module Stripe # One or more documents that demonstrate proof that this person is authorized to represent the company. sig { returns(T.nilable(CompanyAuthorization)) } def company_authorization; end - # One or more documents showing the person’s passport page with photo and personal data. + # One or more documents showing the person's passport page with photo and personal data. sig { returns(T.nilable(Passport)) } def passport; end # An identifying document showing the person's name, either a passport or local ID card. @@ -19392,7 +19392,7 @@ module Stripe # A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. sig { returns(T.nilable(SecondaryVerification)) } def secondary_verification; end - # One or more documents showing the person’s visa required for living in the country where they are residing. + # One or more documents showing the person's visa required for living in the country where they are residing. sig { returns(T.nilable(Visa)) } def visa; end def self.inner_class_types @@ -19604,7 +19604,7 @@ module Stripe # The identification numbers (e.g., SSN) associated with the individual. sig { returns(T.nilable(T::Array[IdNumber])) } def id_numbers; end - # The individual's gender (International regulations require either "male” or "female"). + # The individual's gender (International regulations require either "male" or "female"). sig { returns(T.nilable(String)) } def legal_gender; end # Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. diff --git a/rbi/stripe/resources/v2/core/account_person.rbi b/rbi/stripe/resources/v2/core/account_person.rbi index 6ca4681eb..d96ef6210 100644 --- a/rbi/stripe/resources/v2/core/account_person.rbi +++ b/rbi/stripe/resources/v2/core/account_person.rbi @@ -235,7 +235,7 @@ module Stripe # One or more documents that demonstrate proof that this person is authorized to represent the company. sig { returns(T.nilable(CompanyAuthorization)) } def company_authorization; end - # One or more documents showing the person’s passport page with photo and personal data. + # One or more documents showing the person's passport page with photo and personal data. sig { returns(T.nilable(Passport)) } def passport; end # An identifying document showing the person's name, either a passport or local ID card. @@ -244,7 +244,7 @@ module Stripe # A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. sig { returns(T.nilable(SecondaryVerification)) } def secondary_verification; end - # One or more documents showing the person’s visa required for living in the country where they are residing. + # One or more documents showing the person's visa required for living in the country where they are residing. sig { returns(T.nilable(Visa)) } def visa; end def self.inner_class_types diff --git a/rbi/stripe/resources/v2/core/event_notification.rbi b/rbi/stripe/resources/v2/core/event_notification.rbi index e500b6755..3464c4d97 100644 --- a/rbi/stripe/resources/v2/core/event_notification.rbi +++ b/rbi/stripe/resources/v2/core/event_notification.rbi @@ -1,7 +1,6 @@ # File copied from our code generator; changes here will be overwritten. # frozen_string_literal: true -# frozen_string_literal: true # typed: true module Stripe diff --git a/rbi/stripe/resources/v2/core/health/alert.rbi b/rbi/stripe/resources/v2/core/health/alert.rbi index 0e0414224..a9ead2555 100644 --- a/rbi/stripe/resources/v2/core/health/alert.rbi +++ b/rbi/stripe/resources/v2/core/health/alert.rbi @@ -123,10 +123,13 @@ module Stripe end class AuthorizationRateDrop < ::Stripe::StripeObject class Dimension < ::Stripe::StripeObject + # Populated when type is acquirer. + sig { returns(T.nilable(String)) } + def acquirer; end # Populated when type is issuer. sig { returns(T.nilable(String)) } def issuer; end - # The type of the dimension. Determines which field in dimension_details is populated. + # The type of the dimension. Determines which field is populated. sig { returns(String) } def type; end def self.inner_class_types diff --git a/rbi/stripe/resources/v2/core/health/alert_history_entry.rbi b/rbi/stripe/resources/v2/core/health/alert_history_entry.rbi index c304feb74..7a4cd39c3 100644 --- a/rbi/stripe/resources/v2/core/health/alert_history_entry.rbi +++ b/rbi/stripe/resources/v2/core/health/alert_history_entry.rbi @@ -123,10 +123,13 @@ module Stripe end class AuthorizationRateDrop < ::Stripe::StripeObject class Dimension < ::Stripe::StripeObject + # Populated when type is acquirer. + sig { returns(T.nilable(String)) } + def acquirer; end # Populated when type is issuer. sig { returns(T.nilable(String)) } def issuer; end - # The type of the dimension. Determines which field in dimension_details is populated. + # The type of the dimension. Determines which field is populated. sig { returns(String) } def type; end def self.inner_class_types diff --git a/rbi/stripe/resources/v2/money_management/payout_intent.rbi b/rbi/stripe/resources/v2/money_management/payout_intent.rbi index b05046d42..b7ac9e13b 100644 --- a/rbi/stripe/resources/v2/money_management/payout_intent.rbi +++ b/rbi/stripe/resources/v2/money_management/payout_intent.rbi @@ -7,10 +7,44 @@ module Stripe module MoneyManagement # PayoutIntent represents an intent to send funds from a Financial Account to a payout method. class PayoutIntent < APIResource + class EstimatedFee < ::Stripe::StripeObject + class TaxAmount < ::Stripe::StripeObject + # Currency code. + sig { returns(String) } + def currency; end + # Tax amount value represented as a decimal string in major units. + sig { returns(String) } + def value_decimal; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + # The fee amount. + sig { returns(::Stripe::V2::Amount) } + def amount; end + # Tax charged for this fee, if applicable. Value expressed as a decimal string in major units. + sig { returns(T.nilable(TaxAmount)) } + def tax_amount; end + # Open Enum. The type of fee. + sig { returns(String) } + def type; end + def self.inner_class_types + @inner_class_types = {tax_amount: TaxAmount} + end + def self.field_remappings + @field_remappings = {} + end + end class From < ::Stripe::StripeObject # The currency of the financial account. sig { returns(String) } def currency; end + # Estimated amount to be debited from the financial account. + sig { returns(T.nilable(::Stripe::V2::Amount)) } + def debited; end # The FinancialAccount that funds are pulled from. sig { returns(String) } def financial_account; end @@ -21,6 +55,41 @@ module Stripe @field_remappings = {} end end + class FxQuote < ::Stripe::StripeObject + class Rates < ::Stripe::StripeObject + # The exchange rate going from_currency -> to_currency, represented as a decimal string + # (e.g., "1.1520") to preserve the full precision of the rate. + sig { returns(String) } + def exchange_rate; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + # Open Enum. Duration of the FX rate lock. + sig { returns(String) } + def lock_duration; end + # Timestamp when the rate lock expires. Null when rate locking is not supported. + sig { returns(T.nilable(String)) } + def lock_expires_at; end + # Open Enum. Lock status of the FX rate. + sig { returns(String) } + def lock_status; end + # Key: source currency. Value: exchange rate from source currency to to_currency. + sig { returns(T::Hash[String, Rates]) } + def rates; end + # The destination currency. + sig { returns(String) } + def to_currency; end + def self.inner_class_types + @inner_class_types = {rates: Rates} + end + def self.field_remappings + @field_remappings = {} + end + end class LatestPayout < ::Stripe::StripeObject # The ID of the OutboundPayment, if applicable. sig { returns(T.nilable(String)) } @@ -39,6 +108,17 @@ module Stripe end end class NextAction < ::Stripe::StripeObject + class Confirm < ::Stripe::StripeObject + # Open Enum. The reason the PayoutIntent requires confirmation. + sig { returns(String) } + def reason; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end class HandleFailure < ::Stripe::StripeObject # Open Enum. The reason for the failure. sig { returns(String) } @@ -50,6 +130,9 @@ module Stripe @field_remappings = {} end end + # Details about a confirmation required. Populated when type is confirm. + sig { returns(T.nilable(Confirm)) } + def confirm; end # Details about a failure that requires user action. Populated when type is handle_failure. sig { returns(T.nilable(HandleFailure)) } def handle_failure; end @@ -57,7 +140,7 @@ module Stripe sig { returns(String) } def type; end def self.inner_class_types - @inner_class_types = {handle_failure: HandleFailure} + @inner_class_types = {confirm: Confirm, handle_failure: HandleFailure} end def self.field_remappings @field_remappings = {} @@ -161,6 +244,9 @@ module Stripe @field_remappings = {} end end + # Estimated amount to be credited to the recipient in the destination currency. + sig { returns(T.nilable(::Stripe::V2::Amount)) } + def credited; end # The currency to send to the recipient. sig { returns(T.nilable(String)) } def currency; end @@ -183,6 +269,9 @@ module Stripe # The monetary amount to be sent. sig { returns(::Stripe::V2::Amount) } def amount; end + # Controls whether the intent requires explicit confirmation before transitioning to pending. + sig { returns(String) } + def confirmation_method; end # Time at which the PayoutIntent was created. # Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. sig { returns(String) } @@ -190,9 +279,15 @@ module Stripe # An arbitrary string attached to the PayoutIntent. Often useful for displaying to users. sig { returns(T.nilable(String)) } def description; end + # Estimated fees and taxes. + sig { returns(T.nilable(T::Array[EstimatedFee])) } + def estimated_fees; end # The FinancialAccount that funds are pulled from. sig { returns(From) } def from; end + # FX rate information for fee transparency. + sig { returns(T.nilable(FxQuote)) } + def fx_quote; end # Unique identifier for the PayoutIntent. sig { returns(String) } def id; end diff --git a/rbi/stripe/resources/v2/payments/off_session_payment.rbi b/rbi/stripe/resources/v2/payments/off_session_payment.rbi index 4b3f655c5..159818c8c 100644 --- a/rbi/stripe/resources/v2/payments/off_session_payment.rbi +++ b/rbi/stripe/resources/v2/payments/off_session_payment.rbi @@ -205,7 +205,7 @@ module Stripe # Provides industry-specific information about the amount. sig { returns(T.nilable(AmountDetails)) } def amount_details; end - # The “presentment amount” to be collected from the customer. + # The "presentment amount" to be collected from the customer. sig { returns(::Stripe::V2::Amount) } def amount_requested; end # The application associated with this OffSessionPayment. @@ -272,15 +272,15 @@ module Stripe # Details about the OffSessionPayment retries. sig { returns(RetryDetails) } def retry_details; end - # Text that appears on the customer’s statement as the statement descriptor for a - # non-card charge. This value overrides the account’s default statement descriptor. + # Text that appears on the customer's statement as the statement descriptor for a + # non-card charge. This value overrides the account's default statement descriptor. # For information about requirements, including the 22-character limit, see the # [Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). sig { returns(T.nilable(String)) } def statement_descriptor; end - # Provides information about a card charge. Concatenated to the account’s + # Provides information about a card charge. Concatenated to the account's # [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) - # to form the complete statement descriptor that appears on the customer’s statement. + # to form the complete statement descriptor that appears on the customer's statement. sig { returns(T.nilable(String)) } def statement_descriptor_suffix; end # Status of this OffSessionPayment, one of `pending`, `pending_retry`, `processing`, diff --git a/rbi/stripe/resources/v2/tax/operations_resolve_address_result.rbi b/rbi/stripe/resources/v2/tax/operations_resolve_address_result.rbi new file mode 100644 index 000000000..270f5136f --- /dev/null +++ b/rbi/stripe/resources/v2/tax/operations_resolve_address_result.rbi @@ -0,0 +1,76 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module V2 + module Tax + # The result of resolving an address to its tax precision level. + class OperationsResolveAddressResult < APIResource + class Address < ::Stripe::StripeObject + # The city. + sig { returns(T.nilable(String)) } + def city; end + # The two-letter country code. + sig { returns(T.nilable(String)) } + def country; end + # The first line of the street address. + sig { returns(T.nilable(String)) } + def line1; end + # The postal code. + sig { returns(T.nilable(String)) } + def postal_code; end + # The state or province. + sig { returns(T.nilable(String)) } + def state; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + class PrecisionDetails < ::Stripe::StripeObject + class Issue < ::Stripe::StripeObject + # A code describing the issue. + sig { returns(String) } + def code; end + # The address field with the issue. + sig { returns(String) } + def field; end + def self.inner_class_types + @inner_class_types = {} + end + def self.field_remappings + @field_remappings = {} + end + end + # Issues preventing higher precision. + sig { returns(T::Array[Issue]) } + def issues; end + def self.inner_class_types + @inner_class_types = {issues: Issue} + end + def self.field_remappings + @field_remappings = {} + end + end + # The normalized form of the input address. + sig { returns(Address) } + def address; 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 + # 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 + # The precision level of the resolved address. + sig { returns(String) } + def precision; end + # Details about the precision, including any issues. + sig { returns(PrecisionDetails) } + def precision_details; end + end + end + end +end \ No newline at end of file diff --git a/rbi/stripe/services/v2/money_management/payout_intent_service.rbi b/rbi/stripe/services/v2/money_management/payout_intent_service.rbi index 0d9888952..7a2356f2f 100644 --- a/rbi/stripe/services/v2/money_management/payout_intent_service.rbi +++ b/rbi/stripe/services/v2/money_management/payout_intent_service.rbi @@ -6,7 +6,7 @@ module Stripe module V2 module MoneyManagement class PayoutIntentService < StripeService - # Cancels a PayoutIntent. Only pending PayoutIntents or processing PayoutIntents with cancelable OutboundPayment/Transfer can be canceled. + # Cancels a PayoutIntent. Only pending PayoutIntents, processing PayoutIntents with cancelable OutboundPayment/Transfer, or requires_action PayoutIntents can be canceled. # # ** raises NotCancelableError sig { @@ -14,6 +14,14 @@ module Stripe } def cancel(id, params = {}, opts = {}); end + # Confirms a PayoutIntent that is in the requires_action state, transitioning it to pending. + # + # ** raises FxQuoteNeedsRefreshError + sig { + params(id: String, params: T.any(::Stripe::V2::MoneyManagement::PayoutIntentConfirmParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::MoneyManagement::PayoutIntent) + } + def confirm(id, params = {}, opts = {}); end + # Creates a PayoutIntent. # # ** raises FeatureNotEnabledError @@ -22,6 +30,12 @@ module Stripe } def create(params = {}, opts = {}); end + # Refreshes FX quote for a PayoutIntent. + sig { + params(id: String, params: T.any(::Stripe::V2::MoneyManagement::PayoutIntentFxQuoteParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::MoneyManagement::PayoutIntent) + } + def fx_quote(id, params = {}, opts = {}); end + # Returns a list of PayoutIntents. sig { params(params: T.any(::Stripe::V2::MoneyManagement::PayoutIntentListParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::ListObject) diff --git a/rbi/stripe/services/v2/tax/operation_service.rbi b/rbi/stripe/services/v2/tax/operation_service.rbi new file mode 100644 index 000000000..1a79fabed --- /dev/null +++ b/rbi/stripe/services/v2/tax/operation_service.rbi @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module V2 + module Tax + class OperationService < StripeService + # Resolves an address to its tax precision level. + sig { + params(params: T.any(::Stripe::V2::Tax::OperationResolveAddressParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Tax::OperationsResolveAddressResult) + } + def resolve_address(params = {}, opts = {}); end + end + end + end +end \ No newline at end of file diff --git a/rbi/stripe/services/v2/tax_service.rbi b/rbi/stripe/services/v2/tax_service.rbi index 4fb090896..12fbd5c46 100644 --- a/rbi/stripe/services/v2/tax_service.rbi +++ b/rbi/stripe/services/v2/tax_service.rbi @@ -6,6 +6,7 @@ module Stripe module V2 class TaxService < StripeService attr_reader :manual_rules + attr_reader :operations end end end \ No newline at end of file diff --git a/rbi/stripe/stripe_event_notification_handler.rbi b/rbi/stripe/stripe_event_notification_handler.rbi index 574244190..f5e2c416e 100644 --- a/rbi/stripe/stripe_event_notification_handler.rbi +++ b/rbi/stripe/stripe_event_notification_handler.rbi @@ -1,7 +1,6 @@ # File copied from our code generator; changes here will be overwritten. # frozen_string_literal: true -# frozen_string_literal: true # typed: true module Stripe @@ -103,12 +102,48 @@ module Stripe def on_v1_balance_available(&blk); end + sig do + params(blk: T.proc.params(event_notification: ::Stripe::Events::V1BalanceSettingsUpdatedEventNotification, client: ::Stripe::StripeClient).void).void + end + def on_v1_balance_settings_updated(&blk); + end + sig do params(blk: T.proc.params(event_notification: ::Stripe::Events::V1BillingAlertTriggeredEventNotification, client: ::Stripe::StripeClient).void).void end def on_v1_billing_alert_triggered(&blk); end + sig do + params(blk: T.proc.params(event_notification: ::Stripe::Events::V1BillingCreditBalanceTransactionCreatedEventNotification, client: ::Stripe::StripeClient).void).void + end + def on_v1_billing_credit_balance_transaction_created(&blk); + end + + sig do + params(blk: T.proc.params(event_notification: ::Stripe::Events::V1BillingCreditGrantCreatedEventNotification, client: ::Stripe::StripeClient).void).void + end + def on_v1_billing_credit_grant_created(&blk); + end + + sig do + params(blk: T.proc.params(event_notification: ::Stripe::Events::V1BillingCreditGrantUpdatedEventNotification, client: ::Stripe::StripeClient).void).void + end + def on_v1_billing_credit_grant_updated(&blk); + end + + sig do + params(blk: T.proc.params(event_notification: ::Stripe::Events::V1BillingMeterCreatedEventNotification, client: ::Stripe::StripeClient).void).void + end + def on_v1_billing_meter_created(&blk); + end + + sig do + params(blk: T.proc.params(event_notification: ::Stripe::Events::V1BillingMeterDeactivatedEventNotification, client: ::Stripe::StripeClient).void).void + end + def on_v1_billing_meter_deactivated(&blk); + end + sig do params(blk: T.proc.params(event_notification: ::Stripe::Events::V1BillingMeterErrorReportTriggeredEventNotification, client: ::Stripe::StripeClient).void).void end @@ -121,6 +156,18 @@ module Stripe def on_v1_billing_meter_no_meter_found(&blk); end + sig do + params(blk: T.proc.params(event_notification: ::Stripe::Events::V1BillingMeterReactivatedEventNotification, client: ::Stripe::StripeClient).void).void + end + def on_v1_billing_meter_reactivated(&blk); + end + + sig do + params(blk: T.proc.params(event_notification: ::Stripe::Events::V1BillingMeterUpdatedEventNotification, client: ::Stripe::StripeClient).void).void + end + def on_v1_billing_meter_updated(&blk); + end + sig do params(blk: T.proc.params(event_notification: ::Stripe::Events::V1BillingPortalConfigurationCreatedEventNotification, client: ::Stripe::StripeClient).void).void end @@ -433,6 +480,12 @@ module Stripe def on_v1_file_created(&blk); end + sig do + params(blk: T.proc.params(event_notification: ::Stripe::Events::V1FinancialConnectionsAccountAccountNumbersUpdatedEventNotification, client: ::Stripe::StripeClient).void).void + end + def on_v1_financial_connections_account_account_numbers_updated(&blk); + end + sig do params(blk: T.proc.params(event_notification: ::Stripe::Events::V1FinancialConnectionsAccountCreatedEventNotification, client: ::Stripe::StripeClient).void).void end @@ -451,6 +504,12 @@ module Stripe def on_v1_financial_connections_account_disconnected(&blk); end + sig do + params(blk: T.proc.params(event_notification: ::Stripe::Events::V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEventNotification, client: ::Stripe::StripeClient).void).void + end + def on_v1_financial_connections_account_expected_deactivation_date_updated(&blk); + end + sig do params(blk: T.proc.params(event_notification: ::Stripe::Events::V1FinancialConnectionsAccountReactivatedEventNotification, client: ::Stripe::StripeClient).void).void end @@ -475,6 +534,24 @@ module Stripe def on_v1_financial_connections_account_refreshed_transactions(&blk); end + sig do + params(blk: T.proc.params(event_notification: ::Stripe::Events::V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEventNotification, client: ::Stripe::StripeClient).void).void + end + def on_v1_financial_connections_account_supported_payment_method_types_updated(&blk); + end + + sig do + params(blk: T.proc.params(event_notification: ::Stripe::Events::V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEventNotification, client: ::Stripe::StripeClient).void).void + end + def on_v1_financial_connections_account_upcoming_account_number_expiry(&blk); + end + + sig do + params(blk: T.proc.params(event_notification: ::Stripe::Events::V1FinancialConnectionsAccountUpcomingDeactivationEventNotification, client: ::Stripe::StripeClient).void).void + end + def on_v1_financial_connections_account_upcoming_deactivation(&blk); + end + sig do params(blk: T.proc.params(event_notification: ::Stripe::Events::V1IdentityVerificationSessionCanceledEventNotification, client: ::Stripe::StripeClient).void).void end @@ -565,6 +642,12 @@ module Stripe def on_v1_invoice_payment_action_required(&blk); end + sig do + params(blk: T.proc.params(event_notification: ::Stripe::Events::V1InvoicePaymentAttemptRequiredEventNotification, client: ::Stripe::StripeClient).void).void + end + def on_v1_invoice_payment_attempt_required(&blk); + end + sig do params(blk: T.proc.params(event_notification: ::Stripe::Events::V1InvoicePaymentFailedEventNotification, client: ::Stripe::StripeClient).void).void end diff --git a/test/stripe/generated_examples_test.rb b/test/stripe/generated_examples_test.rb index 17db98993..4eb5959a2 100644 --- a/test/stripe/generated_examples_test.rb +++ b/test/stripe/generated_examples_test.rb @@ -10538,7 +10538,7 @@ class CodegennedExampleTest < Test::Unit::TestCase :get, "#{Stripe::DEFAULT_API_BASE}/v2/money_management/payout_intents" ).to_return( - body: '{"data":[{"object":"v2.money_management.payout_intent","amount":{"currency":"USD","value":96},"created":"1970-01-12T21:42:34.472Z","from":{"currency":"usd","financial_account":"financial_account"},"id":"obj_123","latest_payout":{"type":"outbound_payment"},"livemode":true,"status":"canceled","to":{}}],"next_page_url":null,"previous_page_url":null}', + body: '{"data":[{"object":"v2.money_management.payout_intent","amount":{"currency":"USD","value":96},"confirmation_method":"manual","created":"1970-01-12T21:42:34.472Z","from":{"currency":"usd","financial_account":"financial_account"},"id":"obj_123","latest_payout":{"type":"outbound_payment"},"livemode":true,"status":"canceled","to":{}}],"next_page_url":null,"previous_page_url":null}', status: 200 ) client = Stripe::StripeClient.new("sk_test_123") @@ -10551,7 +10551,7 @@ class CodegennedExampleTest < Test::Unit::TestCase :post, "#{Stripe::DEFAULT_API_BASE}/v2/money_management/payout_intents" ).to_return( - body: '{"object":"v2.money_management.payout_intent","amount":{"currency":"USD","value":96},"created":"1970-01-12T21:42:34.472Z","from":{"currency":"usd","financial_account":"financial_account"},"id":"obj_123","latest_payout":{"type":"outbound_payment"},"livemode":true,"status":"canceled","to":{}}', + body: '{"object":"v2.money_management.payout_intent","amount":{"currency":"USD","value":96},"confirmation_method":"manual","created":"1970-01-12T21:42:34.472Z","from":{"currency":"usd","financial_account":"financial_account"},"id":"obj_123","latest_payout":{"type":"outbound_payment"},"livemode":true,"status":"canceled","to":{}}', status: 200 ) client = Stripe::StripeClient.new("sk_test_123") @@ -10589,7 +10589,7 @@ class CodegennedExampleTest < Test::Unit::TestCase :get, "#{Stripe::DEFAULT_API_BASE}/v2/money_management/payout_intents/id_123" ).to_return( - body: '{"object":"v2.money_management.payout_intent","amount":{"currency":"USD","value":96},"created":"1970-01-12T21:42:34.472Z","from":{"currency":"usd","financial_account":"financial_account"},"id":"obj_123","latest_payout":{"type":"outbound_payment"},"livemode":true,"status":"canceled","to":{}}', + body: '{"object":"v2.money_management.payout_intent","amount":{"currency":"USD","value":96},"confirmation_method":"manual","created":"1970-01-12T21:42:34.472Z","from":{"currency":"usd","financial_account":"financial_account"},"id":"obj_123","latest_payout":{"type":"outbound_payment"},"livemode":true,"status":"canceled","to":{}}', status: 200 ) client = Stripe::StripeClient.new("sk_test_123") @@ -10602,7 +10602,7 @@ class CodegennedExampleTest < Test::Unit::TestCase :post, "#{Stripe::DEFAULT_API_BASE}/v2/money_management/payout_intents/id_123" ).to_return( - body: '{"object":"v2.money_management.payout_intent","amount":{"currency":"USD","value":96},"created":"1970-01-12T21:42:34.472Z","from":{"currency":"usd","financial_account":"financial_account"},"id":"obj_123","latest_payout":{"type":"outbound_payment"},"livemode":true,"status":"canceled","to":{}}', + body: '{"object":"v2.money_management.payout_intent","amount":{"currency":"USD","value":96},"confirmation_method":"manual","created":"1970-01-12T21:42:34.472Z","from":{"currency":"usd","financial_account":"financial_account"},"id":"obj_123","latest_payout":{"type":"outbound_payment"},"livemode":true,"status":"canceled","to":{}}', status: 200 ) client = Stripe::StripeClient.new("sk_test_123") @@ -10615,7 +10615,7 @@ class CodegennedExampleTest < Test::Unit::TestCase :post, "#{Stripe::DEFAULT_API_BASE}/v2/money_management/payout_intents/id_123/cancel" ).to_return( - body: '{"object":"v2.money_management.payout_intent","amount":{"currency":"USD","value":96},"created":"1970-01-12T21:42:34.472Z","from":{"currency":"usd","financial_account":"financial_account"},"id":"obj_123","latest_payout":{"type":"outbound_payment"},"livemode":true,"status":"canceled","to":{}}', + body: '{"object":"v2.money_management.payout_intent","amount":{"currency":"USD","value":96},"confirmation_method":"manual","created":"1970-01-12T21:42:34.472Z","from":{"currency":"usd","financial_account":"financial_account"},"id":"obj_123","latest_payout":{"type":"outbound_payment"},"livemode":true,"status":"canceled","to":{}}', status: 200 ) client = Stripe::StripeClient.new("sk_test_123") @@ -10623,6 +10623,32 @@ class CodegennedExampleTest < Test::Unit::TestCase payout_intent = client.v2.money_management.payout_intents.cancel("id_123") assert_requested :post, "#{Stripe::DEFAULT_API_BASE}/v2/money_management/payout_intents/id_123/cancel" end + should "Test v2 money management payout intent post 4 (service)" do + stub_request( + :post, + "#{Stripe::DEFAULT_API_BASE}/v2/money_management/payout_intents/id_123/confirm" + ).to_return( + body: '{"object":"v2.money_management.payout_intent","amount":{"currency":"USD","value":96},"confirmation_method":"manual","created":"1970-01-12T21:42:34.472Z","from":{"currency":"usd","financial_account":"financial_account"},"id":"obj_123","latest_payout":{"type":"outbound_payment"},"livemode":true,"status":"canceled","to":{}}', + status: 200 + ) + client = Stripe::StripeClient.new("sk_test_123") + + payout_intent = client.v2.money_management.payout_intents.confirm("id_123") + assert_requested :post, "#{Stripe::DEFAULT_API_BASE}/v2/money_management/payout_intents/id_123/confirm" + end + should "Test v2 money management payout intent post 5 (service)" do + stub_request( + :post, + "#{Stripe::DEFAULT_API_BASE}/v2/money_management/payout_intents/id_123/fx_quote" + ).to_return( + body: '{"object":"v2.money_management.payout_intent","amount":{"currency":"USD","value":96},"confirmation_method":"manual","created":"1970-01-12T21:42:34.472Z","from":{"currency":"usd","financial_account":"financial_account"},"id":"obj_123","latest_payout":{"type":"outbound_payment"},"livemode":true,"status":"canceled","to":{}}', + status: 200 + ) + client = Stripe::StripeClient.new("sk_test_123") + + payout_intent = client.v2.money_management.payout_intents.fx_quote("id_123") + assert_requested :post, "#{Stripe::DEFAULT_API_BASE}/v2/money_management/payout_intents/id_123/fx_quote" + end should "Test v2 money management payout method get (service)" do stub_request( :get, @@ -11481,6 +11507,27 @@ class CodegennedExampleTest < Test::Unit::TestCase manual_rule = client.v2.tax.manual_rules.deactivate("id_123") assert_requested :post, "#{Stripe::DEFAULT_API_BASE}/v2/tax/manual_rules/id_123/deactivate" end + should "Test v2 tax operation post (service)" do + stub_request( + :post, + "#{Stripe::DEFAULT_API_BASE}/v2/tax/operations/resolve_address" + ).to_return( + body: '{"object":"v2.tax.operations_resolve_address_result","address":{},"livemode":true,"precision":"none","precision_details":{"issues":[{"code":"required_for_improved_precision","field":"country"}]}}', + status: 200 + ) + client = Stripe::StripeClient.new("sk_test_123") + + operations_resolve_address_result = client.v2.tax.operations.resolve_address({ + address: { + city: "city", + country: "country", + line1: "line1", + postal_code: "postal_code", + state: "state", + }, + }) + assert_requested :post, "#{Stripe::DEFAULT_API_BASE}/v2/tax/operations/resolve_address" + end should "Test v2 test helpers financial address post (service)" do stub_request( :post, @@ -11673,6 +11720,21 @@ class CodegennedExampleTest < Test::Unit::TestCase end assert_requested :post, "#{Stripe::DEFAULT_API_BASE}/v2/money_management/currency_conversions" end + should "Test fx quote needs refresh error (service)" do + stub_request( + :post, + "#{Stripe::DEFAULT_API_BASE}/v2/money_management/payout_intents/id_123/confirm" + ).to_return( + body: '{"error":{"type":"fx_quote_needs_refresh","code":"payout_intent_fx_quote_expired"}}', + status: 400 + ) + client = Stripe::StripeClient.new("sk_test_123") + + assert_raises Stripe::FxQuoteNeedsRefreshError do + payout_intent = client.v2.money_management.payout_intents.confirm("id_123") + end + assert_requested :post, "#{Stripe::DEFAULT_API_BASE}/v2/money_management/payout_intents/id_123/confirm" + end should "Test insufficient funds error (service)" do stub_request( :post, diff --git a/test/stripe/list_object_test.rb b/test/stripe/list_object_test.rb index 0f4a888c2..be0189028 100644 --- a/test/stripe/list_object_test.rb +++ b/test/stripe/list_object_test.rb @@ -162,6 +162,21 @@ class ListObjectTest < Test::Unit::TestCase assert_equal expected, actual end + should "support break inside #auto_paging_each block" do + list = TestListObject.construct_from(data: [{ id: 1 }, { id: 2 }], + has_more: true, + url: "/things", + object: "list") + + actual = [] + list.auto_paging_each do |obj| + actual << obj + break if actual.size == 1 + end + + assert_equal 1, actual.size + end + should "provide #empty?" do list = Stripe::ListObject.construct_from(data: []) assert list.empty? diff --git a/test/stripe/search_result_object_test.rb b/test/stripe/search_result_object_test.rb index 4926a4480..282f90ddb 100644 --- a/test/stripe/search_result_object_test.rb +++ b/test/stripe/search_result_object_test.rb @@ -88,6 +88,21 @@ class SearchResultObjectTest < Test::Unit::TestCase assert_equal expected, actual end + should "support break inside #auto_paging_each block" do + list = TestSearchResultObject.construct_from(data: [{ id: 1 }, { id: 2 }], + has_more: true, + next_page: "next_page_token_1", + url: "/things") + + actual = [] + list.auto_paging_each do |obj| + actual << obj + break if actual.size == 1 + end + + assert_equal 1, actual.size + end + should "provide #empty?" do list = Stripe::SearchResultObject.construct_from(data: []) assert list.empty? diff --git a/test/stripe/stripe_object_int64_test.rb b/test/stripe/stripe_object_int64_test.rb new file mode 100644 index 000000000..df0825610 --- /dev/null +++ b/test/stripe/stripe_object_int64_test.rb @@ -0,0 +1,93 @@ +# frozen_string_literal: true + +require File.expand_path("../test_helper", __dir__) + +module Stripe + class StripeObjectInt64Test < Test::Unit::TestCase + # A test resource with an int64_string-encoded field. + class Int64Resource < Stripe::StripeObject + def self.field_encodings + { amount: :int64_string } + end + end + + # A nested inner class that has its own field_encodings. + class InnerDetail < Stripe::StripeObject + def self.field_encodings + { quantity: :int64_string } + end + end + + # A parent resource referencing the inner class via inner_class_types. + # This demonstrates that nested coercion works through each StripeObject + # applying its own field_encodings during update_attributes (not through + # V2TypeCoercion recursing into StripeObjects). + class ParentResource < Stripe::StripeObject + def self.field_encodings + { total: :int64_string } + end + + def self.inner_class_types + { detail: InnerDetail } + end + end + + context "response-side int64_string coercion via construct_from" do + should "deserialize a string field to Integer" do + obj = Int64Resource.construct_from(id: "obj_1", amount: "42") + assert_equal 42, obj.amount + assert_instance_of Integer, obj.amount + end + + should "handle large int64 values" do + obj = Int64Resource.construct_from(id: "obj_2", amount: "9223372036854775807") + assert_equal 9_223_372_036_854_775_807, obj.amount + end + + should "preserve negative values" do + obj = Int64Resource.construct_from(id: "obj_3", amount: "-100") + assert_equal(-100, obj.amount) + end + + should "preserve zero" do + obj = Int64Resource.construct_from(id: "obj_4", amount: "0") + assert_equal 0, obj.amount + assert_instance_of Integer, obj.amount + end + + should "pass through nil without error" do + obj = Int64Resource.construct_from(id: "obj_5", amount: nil) + assert_nil obj.amount + end + + should "leave non-encoded fields unaffected" do + obj = Int64Resource.construct_from(id: "obj_6", amount: "10", name: "test") + assert_equal "test", obj.name + end + end + + context "nested resource coercion (each layer applies its own field_encodings)" do + should "coerce both parent and nested inner-class fields" do + obj = ParentResource.construct_from( + id: "parent_1", + total: "500", + detail: { quantity: "25", label: "items" } + ) + + assert_equal 500, obj.total + assert_instance_of Integer, obj.total + + assert_equal 25, obj.detail.quantity + assert_instance_of Integer, obj.detail.quantity + + assert_equal "items", obj.detail.label + end + + should "handle nil nested object" do + obj = ParentResource.construct_from(id: "parent_2", total: "100", detail: nil) + assert_equal 100, obj.total + assert_nil obj.detail + end + end + end +end diff --git a/test/stripe/v2_list_object_test.rb b/test/stripe/v2_list_object_test.rb index f380ceebe..f4447a0fb 100644 --- a/test/stripe/v2_list_object_test.rb +++ b/test/stripe/v2_list_object_test.rb @@ -105,6 +105,21 @@ class V2ListObjectTest < Test::Unit::TestCase assert_equal expected, actual end + + should "support break inside #auto_paging_each block" do + list = TestV2ListObject.construct_from({ + data: [{ id: 1 }, { id: 2 }], + next_page_url: "/v2/things?page=page_2", + }, {}, nil, :v2, APIRequestor.new("sk_test_123")) + + actual = [] + list.auto_paging_each do |obj| + actual << obj + break if actual.size == 1 + end + + assert_equal 1, actual.size + end end context "#fetch_next_page" do diff --git a/test/stripe/v2_type_coercion_test.rb b/test/stripe/v2_type_coercion_test.rb new file mode 100644 index 000000000..47fedb09f --- /dev/null +++ b/test/stripe/v2_type_coercion_test.rb @@ -0,0 +1,185 @@ +# frozen_string_literal: true + +require File.expand_path("../test_helper", __dir__) +require "bigdecimal" + +module Stripe + class V2TypeCoercionTest < Test::Unit::TestCase + context "encode direction (request: native → wire)" do + context "int64_string" do + should "convert Integer to String" do + assert_equal "42", V2TypeCoercion.coerce_value(42, :int64_string, direction: :encode) + assert_equal "0", V2TypeCoercion.coerce_value(0, :int64_string, direction: :encode) + assert_equal "-7", V2TypeCoercion.coerce_value(-7, :int64_string, direction: :encode) + end + + should "pass through String" do + assert_equal "42", V2TypeCoercion.coerce_value("42", :int64_string, direction: :encode) + end + + should "convert Array of Integers" do + assert_equal %w[1 2 3], V2TypeCoercion.coerce_value([1, 2, 3], :int64_string, direction: :encode) + end + + should "handle mixed Array" do + assert_equal %w[1 already 3], V2TypeCoercion.coerce_value([1, "already", 3], :int64_string, direction: :encode) + end + end + + context "decimal_string" do + should "convert BigDecimal to String" do + assert_equal "99.999", V2TypeCoercion.coerce_value(BigDecimal("99.999"), :decimal_string, direction: :encode) + assert_equal "0.0", V2TypeCoercion.coerce_value(BigDecimal("0"), :decimal_string, direction: :encode) + end + + should "convert Integer to String" do + assert_equal "42", V2TypeCoercion.coerce_value(42, :decimal_string, direction: :encode) + end + + should "convert Float to String" do + assert_equal "3.14", V2TypeCoercion.coerce_value(3.14, :decimal_string, direction: :encode) + end + + should "pass through String" do + assert_equal "99.5", V2TypeCoercion.coerce_value("99.5", :decimal_string, direction: :encode) + end + + should "convert Array of BigDecimal" do + result = V2TypeCoercion.coerce_value( + [BigDecimal("1.1"), BigDecimal("2.2")], + :decimal_string, + direction: :encode + ) + assert_equal %w[1.1 2.2], result + end + end + end + + context "decode direction (response: wire → native)" do + context "int64_string" do + should "convert String to Integer" do + assert_equal 42, V2TypeCoercion.coerce_value("42", :int64_string, direction: :decode) + assert_equal 0, V2TypeCoercion.coerce_value("0", :int64_string, direction: :decode) + assert_equal(-7, V2TypeCoercion.coerce_value("-7", :int64_string, direction: :decode)) + end + + should "pass through Integer" do + assert_equal 42, V2TypeCoercion.coerce_value(42, :int64_string, direction: :decode) + end + + should "convert Array of Strings" do + assert_equal [1, 2, 3], V2TypeCoercion.coerce_value(%w[1 2 3], :int64_string, direction: :decode) + end + + should "handle mixed Array" do + assert_equal [1, 2, 3], V2TypeCoercion.coerce_value(["1", 2, "3"], :int64_string, direction: :decode) + end + end + + context "decimal_string" do + should "convert String to BigDecimal" do + assert_equal BigDecimal("99.999"), V2TypeCoercion.coerce_value("99.999", :decimal_string, direction: :decode) + assert_equal BigDecimal("0"), V2TypeCoercion.coerce_value("0", :decimal_string, direction: :decode) + assert_equal BigDecimal("-1.5"), V2TypeCoercion.coerce_value("-1.5", :decimal_string, direction: :decode) + end + + should "pass through BigDecimal" do + val = BigDecimal("3.14") + assert_equal val, V2TypeCoercion.coerce_value(val, :decimal_string, direction: :decode) + end + + should "convert Array of Strings" do + result = V2TypeCoercion.coerce_value(%w[1.1 2.2], :decimal_string, direction: :decode) + assert_equal [BigDecimal("1.1"), BigDecimal("2.2")], result + end + end + end + + context "nil handling" do + should "return nil as-is regardless of encoding" do + assert_nil V2TypeCoercion.coerce_value(nil, :int64_string, direction: :encode) + assert_nil V2TypeCoercion.coerce_value(nil, :int64_string, direction: :decode) + assert_nil V2TypeCoercion.coerce_value(nil, :decimal_string, direction: :encode) + assert_nil V2TypeCoercion.coerce_value(nil, { kind: :object, fields: {} }, direction: :encode) + end + end + + context "unknown encoding" do + should "return value as-is" do + assert_equal 42, V2TypeCoercion.coerce_value(42, :unknown_thing, direction: :encode) + assert_equal "hi", V2TypeCoercion.coerce_value("hi", :unknown_thing, direction: :decode) + end + end + + context "composite: object" do + should "coerce fields recursively (encode)" do + encoding = { kind: :object, fields: { amount: :int64_string } } + input = { amount: 100, name: "test" } + expected = { amount: "100", name: "test" } + assert_equal expected, V2TypeCoercion.coerce_value(input, encoding, direction: :encode) + end + + should "coerce fields recursively (decode)" do + encoding = { kind: :object, fields: { amount: :int64_string } } + input = { amount: "100", name: "test" } + expected = { amount: 100, name: "test" } + assert_equal expected, V2TypeCoercion.coerce_value(input, encoding, direction: :decode) + end + + should "return non-Hash as-is" do + encoding = { kind: :object, fields: { amount: :int64_string } } + assert_equal "not a hash", V2TypeCoercion.coerce_value("not a hash", encoding, direction: :encode) + end + + should "handle string keys" do + encoding = { kind: :object, fields: { amount: :int64_string } } + input = { "amount" => 100, "name" => "test" } + expected = { "amount" => "100", "name" => "test" } + assert_equal expected, V2TypeCoercion.coerce_value(input, encoding, direction: :encode) + end + end + + context "composite: array" do + should "coerce each element (encode)" do + encoding = { kind: :array, element: :int64_string } + assert_equal %w[1 2 3], V2TypeCoercion.coerce_value([1, 2, 3], encoding, direction: :encode) + end + + should "coerce each element (decode)" do + encoding = { kind: :array, element: :int64_string } + assert_equal [1, 2, 3], V2TypeCoercion.coerce_value(%w[1 2 3], encoding, direction: :decode) + end + + should "coerce array of objects" do + encoding = { kind: :array, element: { kind: :object, fields: { id: :int64_string } } } + input = [{ id: 1, name: "a" }, { id: 2, name: "b" }] + expected = [{ id: "1", name: "a" }, { id: "2", name: "b" }] + assert_equal expected, V2TypeCoercion.coerce_value(input, encoding, direction: :encode) + end + + should "return non-Array as-is" do + encoding = { kind: :array, element: :int64_string } + assert_equal "not an array", V2TypeCoercion.coerce_value("not an array", encoding, direction: :encode) + end + end + + context "coerce_fields" do + should "coerce matching fields and pass through others" do + schema = { amount: :int64_string, price: :decimal_string } + input = { amount: 100, price: BigDecimal("9.99"), name: "test" } + expected = { amount: "100", price: "9.99", name: "test" } + assert_equal expected, V2TypeCoercion.coerce_fields(input, schema, direction: :encode) + end + + should "return input when schema is nil or empty" do + input = { amount: 100 } + assert_equal input, V2TypeCoercion.coerce_fields(input, nil, direction: :encode) + assert_equal input, V2TypeCoercion.coerce_fields(input, {}, direction: :encode) + end + + should "return non-Hash as-is" do + assert_equal "not a hash", V2TypeCoercion.coerce_fields("not a hash", { x: :int64_string }, direction: :encode) + end + end + end +end