From d08753234cafb8e668a6fc54f4bd5acbdb0cd807 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Thu, 4 Sep 2025 18:06:59 -0400 Subject: [PATCH] notes --- .../webhook/stripe_artcraft_webhook_handler.rs | 2 +- .../ignore_known_unwanted_events.rs | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/crates/service/plugins/billing_artcraft/src/endpoints/webhook/stripe_artcraft_webhook_handler.rs b/crates/service/plugins/billing_artcraft/src/endpoints/webhook/stripe_artcraft_webhook_handler.rs index c791da1296..cb1c55fdbb 100644 --- a/crates/service/plugins/billing_artcraft/src/endpoints/webhook/stripe_artcraft_webhook_handler.rs +++ b/crates/service/plugins/billing_artcraft/src/endpoints/webhook/stripe_artcraft_webhook_handler.rs @@ -40,7 +40,7 @@ For one-off payments (eg. credits packs), we see this typical sequence of events - checkout.session.completed (EventId("evt_1S3guvEobp4xy4TlxY7TVlUs")) -- Can use, but `payment_intent.succeeded` is better - charge.updated (EventId("evt_3S3gutEobp4xy4Tl1RgfG4NL")) -- IGNORE - */ +*/ #[derive(Serialize)] diff --git a/crates/service/plugins/billing_artcraft/src/endpoints/webhook/webhook_event_handlers/ignore_known_unwanted_events.rs b/crates/service/plugins/billing_artcraft/src/endpoints/webhook/webhook_event_handlers/ignore_known_unwanted_events.rs index 229fd3b484..e4de3bdbc2 100644 --- a/crates/service/plugins/billing_artcraft/src/endpoints/webhook/webhook_event_handlers/ignore_known_unwanted_events.rs +++ b/crates/service/plugins/billing_artcraft/src/endpoints/webhook/webhook_event_handlers/ignore_known_unwanted_events.rs @@ -10,14 +10,18 @@ pub fn ignore_known_unwanted_events(webhook_payload: &Event) -> Option { // charge.succeeded - building block event and also used for older legacy integrations. - // Use `invoice.paid` as billing success signal for subscriptions instead. - // Suggested also to use `payment_intent.succeeded` for add-on purchase + // Use `invoice.paid` as billing success signal for subscriptions. + // Use `payment_intent.succeeded` for one-off and add-on purchases. + } + EventObject::ChargeUpdated(_) => { + // This doesn't track the payment status, and we don't care about fraud, risk, + // receipt, etc. updates. } EventObject::CustomerCreated(_) | EventObject::CustomerDeleted(_) | EventObject::CustomerUpdated(_) => { - // Only necessary if we want to know about customer object metadata changes, - // e.g. their stripe email. + // We don't need to know about Stripe customer object metadata changes, + // eg. stripe email change. } EventObject::PaymentIntentCreated(_) => { // Not very actionable for us. We only care about successful payments.