fix(api): update PlaidClientOptions to set environment to Development in production
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user