diff --git a/Cargo.lock b/Cargo.lock index 23fe7597..d0fbd538 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -717,7 +717,7 @@ checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "sentry_protos" -version = "0.8.21" +version = "0.8.22" dependencies = [ "prost", "prost-types", diff --git a/proto/sentry_protos/billing/v1/common/v1/payment_config.proto b/proto/sentry_protos/billing/v1/common/v1/payment_config.proto new file mode 100644 index 00000000..a3381d8d --- /dev/null +++ b/proto/sentry_protos/billing/v1/common/v1/payment_config.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package sentry_protos.billing.v1.common.v1; + +// Stripe-specific payment information for an organization. +message StripePaymentData { + optional string customer_stripe_id = 1; + optional string default_payment_method_id = 2; +} + +// Payment provider configuration with support for multiple providers. +message PaymentConfig { + oneof config { + StripePaymentData stripe = 1; + // Future payment providers (e.g., PayPal, Braintree) can be added here + } +} diff --git a/proto/sentry_protos/billing/v1/services/billing_details/v1/endpoint_get_stripe_payment_data.proto b/proto/sentry_protos/billing/v1/services/billing_details/v1/endpoint_get_stripe_payment_data.proto new file mode 100644 index 00000000..8b5e8196 --- /dev/null +++ b/proto/sentry_protos/billing/v1/services/billing_details/v1/endpoint_get_stripe_payment_data.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + +package sentry_protos.billing.v1.services.billing_details.v1; + +import "sentry_protos/billing/v1/common/v1/payment_config.proto"; + +message GetStripePaymentDataRequest { + uint64 organization_id = 1; +} + +message GetStripePaymentDataResponse { + sentry_protos.billing.v1.common.v1.StripePaymentData stripe_payment_data = 1; +} diff --git a/proto/sentry_protos/billing/v1/services/charge/v1/endpoint_capture_charge.proto b/proto/sentry_protos/billing/v1/services/charge/v1/endpoint_capture_charge.proto index a65d4527..2a6b7161 100644 --- a/proto/sentry_protos/billing/v1/services/charge/v1/endpoint_capture_charge.proto +++ b/proto/sentry_protos/billing/v1/services/charge/v1/endpoint_capture_charge.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package sentry_protos.billing.v1.services.charge.v1; import "google/protobuf/timestamp.proto"; +import "sentry_protos/billing/v1/common/v1/payment_config.proto"; // How the charge should be executed against the payment provider. enum ChargeMethod { @@ -25,6 +26,8 @@ message CaptureChargeRequest { uint64 organization_id = 4; google.protobuf.Timestamp current_ts = 5; optional string invoice_id = 6; + optional string invoice_guid = 7; + optional sentry_protos.billing.v1.common.v1.PaymentConfig payment_config = 8; } message CaptureChargeResponse { diff --git a/rust/src/sentry_protos.billing.v1.common.v1.rs b/rust/src/sentry_protos.billing.v1.common.v1.rs index 98ca588b..e0d91b61 100644 --- a/rust/src/sentry_protos.billing.v1.common.v1.rs +++ b/rust/src/sentry_protos.billing.v1.common.v1.rs @@ -202,6 +202,31 @@ pub struct LineItemDetails { #[prost(message, optional, tag = "6")] pub billable_metric: ::core::option::Option, } +/// Stripe-specific payment information for an organization. +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct StripePaymentData { + #[prost(string, optional, tag = "1")] + pub customer_stripe_id: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag = "2")] + pub default_payment_method_id: ::core::option::Option< + ::prost::alloc::string::String, + >, +} +/// Payment provider configuration with support for multiple providers. +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct PaymentConfig { + #[prost(oneof = "payment_config::Config", tags = "1")] + pub config: ::core::option::Option, +} +/// Nested message and enum types in `PaymentConfig`. +pub mod payment_config { + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] + pub enum Config { + /// Future payment providers (e.g., PayPal, Braintree) can be added here + #[prost(message, tag = "1")] + Stripe(super::StripePaymentData), + } +} #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct PricingTier { #[prost(int64, tag = "1")] diff --git a/rust/src/sentry_protos.billing.v1.services.billing_details.v1.rs b/rust/src/sentry_protos.billing.v1.services.billing_details.v1.rs index 10a2ec9f..2d54390b 100644 --- a/rust/src/sentry_protos.billing.v1.services.billing_details.v1.rs +++ b/rust/src/sentry_protos.billing.v1.services.billing_details.v1.rs @@ -37,3 +37,15 @@ pub struct GetBillingDetailsResponse { #[prost(message, optional, tag = "1")] pub billing_details: ::core::option::Option, } +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct GetStripePaymentDataRequest { + #[prost(uint64, tag = "1")] + pub organization_id: u64, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct GetStripePaymentDataResponse { + #[prost(message, optional, tag = "1")] + pub stripe_payment_data: ::core::option::Option< + super::super::super::common::v1::StripePaymentData, + >, +} diff --git a/rust/src/sentry_protos.billing.v1.services.charge.v1.rs b/rust/src/sentry_protos.billing.v1.services.charge.v1.rs index 8815869f..7e1f8304 100644 --- a/rust/src/sentry_protos.billing.v1.services.charge.v1.rs +++ b/rust/src/sentry_protos.billing.v1.services.charge.v1.rs @@ -13,6 +13,12 @@ pub struct CaptureChargeRequest { pub current_ts: ::core::option::Option<::prost_types::Timestamp>, #[prost(string, optional, tag = "6")] pub invoice_id: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, optional, tag = "7")] + pub invoice_guid: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "8")] + pub payment_config: ::core::option::Option< + super::super::super::common::v1::PaymentConfig, + >, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CaptureChargeResponse {