From 7175f3e2f4cf1d7eaf96046f32bd079e820af0b4 Mon Sep 17 00:00:00 2001 From: Nathan Flurry Date: Tue, 2 Jan 2024 02:35:32 +0000 Subject: [PATCH] Upadate billing schema --- lib/util/env/src/lib.rs | 4 ++-- proto/backend/billing.proto | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/util/env/src/lib.rs b/lib/util/env/src/lib.rs index 288ab7bb6c..563f3ea36c 100644 --- a/lib/util/env/src/lib.rs +++ b/lib/util/env/src/lib.rs @@ -181,8 +181,8 @@ pub fn billing() -> Option<&'static RivetBilling> { } /// The current stripe API token. -pub async fn stripe_token() -> Result { - read_secret(&["stripe", "token"]).await +pub async fn stripe_secret_key() -> Result { + read_secret(&["stripe", "secret_key"]).await } /// The current stripe webhook secret. diff --git a/proto/backend/billing.proto b/proto/backend/billing.proto index fc59d05f02..3796ecfd55 100644 --- a/proto/backend/billing.proto +++ b/proto/backend/billing.proto @@ -17,3 +17,17 @@ message RegionTierMetrics { int64 uptime = 4; // in seconds } +message Team { + rivet.common.Uuid team_id = 1; + optional string stripe_customer_id = 2; + optional int64 payment_method_attached_ts = 3; + optional int64 payment_method_valid_ts = 4; + optional int64 payment_failed_ts = 5; + optional int64 payment_succeeded_ts = 6; +} + +message Game { + rivet.common.Uuid game_id = 1; + int64 create_ts = 2; + optional string stripe_customer_id = 3; +}