From edd6198999e956f9cccde0d67b8719b6b68188e3 Mon Sep 17 00:00:00 2001 From: Frank Date: Tue, 23 Sep 2025 17:58:26 -0400 Subject: [PATCH] zen: refund --- infra/console.ts | 4 +- .../workspace/payment-section.module.css | 4 + .../component/workspace/payment-section.tsx | 4 +- .../console/app/src/routes/stripe/webhook.ts | 35 +- .../core/migrations/0016_cold_la_nuit.sql | 1 + .../core/migrations/meta/0016_snapshot.json | 681 ++++++++++++++++++ .../core/migrations/meta/_journal.json | 9 +- .../console/core/src/schema/billing.sql.ts | 1 + 8 files changed, 733 insertions(+), 6 deletions(-) create mode 100644 packages/console/core/migrations/0016_cold_la_nuit.sql create mode 100644 packages/console/core/migrations/meta/0016_snapshot.json diff --git a/infra/console.ts b/infra/console.ts index 74c478ae..bd0af2b1 100644 --- a/infra/console.ts +++ b/infra/console.ts @@ -75,6 +75,7 @@ export const stripeWebhook = new WebhookEndpoint("StripeWebhookEndpoint", { "checkout.session.async_payment_succeeded", "checkout.session.completed", "checkout.session.expired", + "charge.refunded", "customer.created", "customer.deleted", "customer.updated", @@ -93,9 +94,6 @@ export const stripeWebhook = new WebhookEndpoint("StripeWebhookEndpoint", { "customer.subscription.resumed", "customer.subscription.trial_will_end", "customer.subscription.updated", - "customer.tax_id.created", - "customer.tax_id.deleted", - "customer.tax_id.updated", ], }) diff --git a/packages/console/app/src/component/workspace/payment-section.module.css b/packages/console/app/src/component/workspace/payment-section.module.css index ea8e2ed4..2e1afe78 100644 --- a/packages/console/app/src/component/workspace/payment-section.module.css +++ b/packages/console/app/src/component/workspace/payment-section.module.css @@ -40,6 +40,10 @@ &[data-slot="payment-amount"] { color: var(--color-text); + + &[data-refunded="true"] { + text-decoration: line-through; + } } } diff --git a/packages/console/app/src/component/workspace/payment-section.tsx b/packages/console/app/src/component/workspace/payment-section.tsx index 826ec7a5..5cdb0cd7 100644 --- a/packages/console/app/src/component/workspace/payment-section.tsx +++ b/packages/console/app/src/component/workspace/payment-section.tsx @@ -85,7 +85,9 @@ export function PaymentSection() { {formatDateForTable(date)} {payment.id} - ${((payment.amount ?? 0) / 100000000).toFixed(2)} + + ${((payment.amount ?? 0) / 100000000).toFixed(2)} +