diff --git a/Cargo.lock b/Cargo.lock index a5dd75ca..f3279e67 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -717,7 +717,7 @@ checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "sentry_protos" -version = "0.109.0" +version = "0.110.0" dependencies = [ "prost", "prost-types", diff --git a/proto/sentry_protos/billing/v1/services/seer_feature_billing/v1/endpoint_auto_top_up_seer_wallet.proto b/proto/sentry_protos/billing/v1/services/seer_feature_billing/v1/endpoint_auto_top_up_seer_wallet.proto index 53626a98..488f5a8b 100644 --- a/proto/sentry_protos/billing/v1/services/seer_feature_billing/v1/endpoint_auto_top_up_seer_wallet.proto +++ b/proto/sentry_protos/billing/v1/services/seer_feature_billing/v1/endpoint_auto_top_up_seer_wallet.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package sentry_protos.billing.v1.services.seer_feature_billing.v1; import "google/protobuf/timestamp.proto"; +import "sentry_protos/billing/v1/common/v1/stripe_verification.proto"; // Buys the organization's configured top-up when its Seer wallet balance is // below the auto top-up threshold. Safe to repeat: calls with a current_ts in @@ -33,4 +34,11 @@ message AutoTopUpSeerWalletResponse { // Whether the top-up invoice was paid. Only meaningful when outcome is // OUTCOME_BILLED. bool paid = 3; + // Set when Stripe could not complete the top-up charge. + string failure_code = 4; + // Set when the customer must complete a 3D Secure challenge. + optional sentry_protos.billing.v1.common.v1.StripeVerification verification = 5; + // Set when outcome is OUTCOME_BILLED. The browser uses this to confirm a + // completed 3D Secure challenge with the payment endpoint. + optional string invoice_guid = 6; } diff --git a/proto/sentry_protos/billing/v1/services/seer_feature_billing/v1/endpoint_configure_seer_wallet_auto_top_up.proto b/proto/sentry_protos/billing/v1/services/seer_feature_billing/v1/endpoint_configure_seer_wallet_auto_top_up.proto new file mode 100644 index 00000000..45340de4 --- /dev/null +++ b/proto/sentry_protos/billing/v1/services/seer_feature_billing/v1/endpoint_configure_seer_wallet_auto_top_up.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; + +package sentry_protos.billing.v1.services.seer_feature_billing.v1; + +import "sentry_protos/billing/v1/services/seer_feature_billing/v1/endpoint_auto_top_up_seer_wallet.proto"; +import "sentry_protos/billing/v1/services/seer_wallet_config/v1/seer_wallet_config.proto"; + +// Replaces an organization's Seer wallet settings. When the request turns +// auto top-up on, the response includes the synchronous top-up check. +message ConfigureSeerWalletAutoTopUpRequest { + uint64 organization_id = 1; + sentry_protos.billing.v1.services.seer_wallet_config.v1.AutoTopUpConfig auto_top_up = 2; + sentry_protos.billing.v1.services.seer_wallet_config.v1.SpendConfig spend = 3; +} + +message ConfigureSeerWalletAutoTopUpResponse { + // Unset when the organization had not previously saved wallet settings. + optional sentry_protos.billing.v1.services.seer_wallet_config.v1.SeerWalletConfig previous_config = 1; + sentry_protos.billing.v1.services.seer_wallet_config.v1.SeerWalletConfig config = 2; + // Set only when this request turns auto top-up on. + optional AutoTopUpSeerWalletResponse synchronous_top_up = 3; +} diff --git a/rust/src/sentry_protos.billing.v1.services.seer_feature_billing.v1.rs b/rust/src/sentry_protos.billing.v1.services.seer_feature_billing.v1.rs index 8f1efde9..eb077d97 100644 --- a/rust/src/sentry_protos.billing.v1.services.seer_feature_billing.v1.rs +++ b/rust/src/sentry_protos.billing.v1.services.seer_feature_billing.v1.rs @@ -9,7 +9,7 @@ pub struct AutoTopUpSeerWalletRequest { #[prost(message, optional, tag = "2")] pub current_ts: ::core::option::Option<::prost_types::Timestamp>, } -#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct AutoTopUpSeerWalletResponse { #[prost(enumeration = "auto_top_up_seer_wallet_response::Outcome", tag = "1")] pub outcome: i32, @@ -20,6 +20,18 @@ pub struct AutoTopUpSeerWalletResponse { /// OUTCOME_BILLED. #[prost(bool, tag = "3")] pub paid: bool, + /// Set when Stripe could not complete the top-up charge. + #[prost(string, tag = "4")] + pub failure_code: ::prost::alloc::string::String, + /// Set when the customer must complete a 3D Secure challenge. + #[prost(message, optional, tag = "5")] + pub verification: ::core::option::Option< + super::super::super::common::v1::StripeVerification, + >, + /// Set when outcome is OUTCOME_BILLED. The browser uses this to confirm a + /// completed 3D Secure challenge with the payment endpoint. + #[prost(string, optional, tag = "6")] + pub invoice_guid: ::core::option::Option<::prost::alloc::string::String>, } /// Nested message and enum types in `AutoTopUpSeerWalletResponse`. pub mod auto_top_up_seer_wallet_response { @@ -99,6 +111,34 @@ pub struct CheckSeerCreditsResponse { #[prost(string, optional, tag = "2")] pub lease_id: ::core::option::Option<::prost::alloc::string::String>, } +/// Replaces an organization's Seer wallet settings. When the request turns +/// auto top-up on, the response includes the synchronous top-up check. +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ConfigureSeerWalletAutoTopUpRequest { + #[prost(uint64, tag = "1")] + pub organization_id: u64, + #[prost(message, optional, tag = "2")] + pub auto_top_up: ::core::option::Option< + super::super::seer_wallet_config::v1::AutoTopUpConfig, + >, + #[prost(message, optional, tag = "3")] + pub spend: ::core::option::Option, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ConfigureSeerWalletAutoTopUpResponse { + /// Unset when the organization had not previously saved wallet settings. + #[prost(message, optional, tag = "1")] + pub previous_config: ::core::option::Option< + super::super::seer_wallet_config::v1::SeerWalletConfig, + >, + #[prost(message, optional, tag = "2")] + pub config: ::core::option::Option< + super::super::seer_wallet_config::v1::SeerWalletConfig, + >, + /// Set only when this request turns auto top-up on. + #[prost(message, optional, tag = "3")] + pub synchronous_top_up: ::core::option::Option, +} #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetIsFreeSeerFeatureRequest { /// A Seer feature string, as recorded in LLM proxy cost data.