fix(api): update PlaidClientOptions to set environment to Development in production

This commit is contained in:
Stevan Freeborn
2026-03-11 19:41:49 -05:00
parent 6c8ee3e203
commit e6f70f4ab4
@@ -1,3 +1,5 @@
using Microsoft.AspNetCore.Hosting;
namespace FiscalOS.Infra.DependencyInjection; namespace FiscalOS.Infra.DependencyInjection;
public static class ServiceCollectionExtensions public static class ServiceCollectionExtensions
@@ -31,6 +33,12 @@ public static class ServiceCollectionExtensions
var logger = sp.GetRequiredService<ILogger<PlaidClient>>(); var logger = sp.GetRequiredService<ILogger<PlaidClient>>();
var clientOptions = sp.GetRequiredService<IOptions<PlaidClientOptions>>(); var clientOptions = sp.GetRequiredService<IOptions<PlaidClientOptions>>();
var options = clientOptions.Value.ToPlaidOptions(); var options = clientOptions.Value.ToPlaidOptions();
if (sp.GetRequiredService<IWebHostEnvironment>().IsProduction())
{
options.Value.Environment = Going.Plaid.Environment.Development;
}
return new PlaidClient(options, factory, logger); return new PlaidClient(options, factory, logger);
}); });
services.AddSingleton<IPlaidAccountService>(PlaidAccountService.From); services.AddSingleton<IPlaidAccountService>(PlaidAccountService.From);