From db0df3bb81d1c186cf20ffb918fa80bb5f762089 Mon Sep 17 00:00:00 2001 From: Mauricio Araujo Date: Wed, 15 May 2024 15:47:22 -0400 Subject: [PATCH] Fix billing flag condition, fix customer check condition --- dashboard/src/main/home/app-dashboard/apps/Apps.tsx | 1 + internal/billing/usage.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/dashboard/src/main/home/app-dashboard/apps/Apps.tsx b/dashboard/src/main/home/app-dashboard/apps/Apps.tsx index 1cf262c592..c3e0a2f6d7 100644 --- a/dashboard/src/main/home/app-dashboard/apps/Apps.tsx +++ b/dashboard/src/main/home/app-dashboard/apps/Apps.tsx @@ -486,6 +486,7 @@ const Apps: React.FC = () => { /> )} {!currentProject?.sandbox_enabled && + currentProject?.billing_enabled && trialExpired && !hasPaymentEnabled && showBillingModal && ( diff --git a/internal/billing/usage.go b/internal/billing/usage.go index 4cbb2b0290..55b19b5d5e 100644 --- a/internal/billing/usage.go +++ b/internal/billing/usage.go @@ -136,6 +136,9 @@ func (m LagoClient) CheckIfCustomerExists(ctx context.Context, projectID uint, e customerID := m.generateLagoID(CustomerIDPrefix, projectID, enableSandbox) _, lagoErr := m.client.Customer().Get(ctx, customerID) if lagoErr != nil { + if lagoErr.ErrorCode == "customer_not_found" { + return false, nil + } return exists, telemetry.Error(ctx, span, fmt.Errorf(lagoErr.ErrorCode), "failed to get customer") }