From 88e8cfbf40ef371e217ab23a016883e99d7fdec0 Mon Sep 17 00:00:00 2001 From: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com> Date: Wed, 11 Mar 2026 20:09:41 -0500 Subject: [PATCH] fix(infra): update PlaidClientOptions to retrieve environment variable for production check --- .../DependencyInjection/ServiceCollectionExtensions.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/FiscalOS.Infra/DependencyInjection/ServiceCollectionExtensions.cs b/src/FiscalOS.Infra/DependencyInjection/ServiceCollectionExtensions.cs index 30f50ee..d321139 100644 --- a/src/FiscalOS.Infra/DependencyInjection/ServiceCollectionExtensions.cs +++ b/src/FiscalOS.Infra/DependencyInjection/ServiceCollectionExtensions.cs @@ -34,7 +34,9 @@ public static class ServiceCollectionExtensions var clientOptions = sp.GetRequiredService>(); var options = clientOptions.Value.ToPlaidOptions(); - if (sp.GetRequiredService().IsProduction()) + var env = System.Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); + + if (env is not null && env.Equals("Production", StringComparison.OrdinalIgnoreCase)) { options.Value.Environment = Going.Plaid.Environment.Production; }