Selaa lähdekoodia

Fix billing flag condition, fix customer check condition

Mauricio Araujo 2 vuotta sitten
vanhempi
sitoutus
db0df3bb81

+ 1 - 0
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 && (

+ 3 - 0
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")
 	}