Skip to content
Merged
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions proto/sentry_protos/billing/v1/common/v1/payment_config.proto
Original file line number Diff line number Diff line change
@@ -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
}
}
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes because this goes to stripe for the webhooks 👍

optional sentry_protos.billing.v1.common.v1.PaymentConfig payment_config = 8;
}

message CaptureChargeResponse {
Expand Down
25 changes: 25 additions & 0 deletions rust/src/sentry_protos.billing.v1.common.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,31 @@ pub struct LineItemDetails {
#[prost(message, optional, tag = "6")]
pub billable_metric: ::core::option::Option<BillableMetric>,
}
/// 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<payment_config::Config>,
}
/// 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")]
Expand Down
12 changes: 12 additions & 0 deletions rust/src/sentry_protos.billing.v1.services.billing_details.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,15 @@ pub struct GetBillingDetailsResponse {
#[prost(message, optional, tag = "1")]
pub billing_details: ::core::option::Option<BillingDetails>,
}
#[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,
>,
}
6 changes: 6 additions & 0 deletions rust/src/sentry_protos.billing.v1.services.charge.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading