#fate_unexpected
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1262444391105167471
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- fate_unexpected, 2 hours ago, 10 messages
Hi ๐
Sorry I don't know what kind of Stripe integration you are referring to here. Could you please explain in more detail what you are building?
- Web or mobile
- Which programming language
Web. Im working on an endpoint that provide my Stripe products, in my local it works perfeclty but it doesnt work on my prod app, y checked all my version and the response of my prod endpoint is this one
Internal Server Error: Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.. StackTrace: at Stripe.StripeConfiguration.get_ApiKey()
at Stripe.StripeConfiguration.BuildDefaultStripeClient() in /_/src/Stripe.net/Infrastructure/Public/StripeConfiguration.cs:line 230
at Stripe.StripeConfiguration.get_StripeClient() in /_/src/Stripe.net/Infrastructure/Public/StripeConfiguration.cs:line 161
at Stripe.Service`1.get_Client() in /_/src/Stripe.net/Services/_base/Service.cs:line 56
at Stripe.Service`1.get_BaseUrl() in /_/src/Stripe.net/Services/_base/Service.cs:line 43
at Stripe.Service`1.SetupRequestOptions(RequestOptions requestOptions) in /_/src/Stripe.net/Services/_base/Service.cs:line 578
at Stripe.Service`1.RequestAsync[T](HttpMethod method, String path, BaseOptions options, RequestOptions requestOptions, CancellationToken cancellationToken) in /_/src/Stripe.net/Services/_base/Service.cs:line 275
at Stripe.Service`1.Request[T](HttpMethod method, String path, BaseOptions options, RequestOptions requestOptions) in /_/src/Stripe.net/Services/_base/Service.cs:line 253
at Stripe.PriceService.List(PriceListOptions options, RequestOptions requestOptions) in /_/src/Stripe.net/Services/Prices/PriceService.cs:line 70
at ApiCore.Controllers.StripeController.GetListIdsProducts() in C:\Users\stone\source\repos\redacore\ApiCore\Controllers\StripeController.cs:line 163
other staff member made me use the
System.Configuration.ConfigurationManager 4.5 but i cant use that version cuz of my Stripe version that is 45.3.0
What SDK? This ConfigurationManager doesn't look to me like Stripe code
This is my endpoint code
[HttpGet("stripe-products-ids")]
public IActionResult GetListIdsProducts()
{
try
{
var u = User.Claims;
var options = new PriceListOptions
{
Limit = 10,
Expand = new List<string> { "data.product" }
};
var service = new PriceService();
StripeList<Price> prices = service.List(options);
var activePrices = prices.Where(p => p.Active);
var productsInfo = activePrices.Select(p => new
{
Price = p.Id,
ProductId = p.Product.Id,
ProductName = p.Product?.Name,
Currency = p.Currency,
UnitAmount = p.UnitAmount
});
return Ok(productsInfo);
}
catch (Exception ex)
{
var errorMessage = $"Internal Server Error: {ex.Message}. StackTrace: {ex.StackTrace}";
Console.Error.WriteLine(errorMessage);
return StatusCode(500, errorMessage);
}
}
This is the line, where the problem are
StripeList<Price> prices = service.List(options);
I dont know if im calling the list in a wrong way
Please answer my question. What SDK are you using?
im using netcore 3.1
I don't know what that is. It kinda looks like this is a .NET integration
Yup it is .Net
Okay
So....looking at the error message. It sounds like your integration is having difficulty finding the API key. How are you initializing Stripe?
On my startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.Configure<StripeSettings> (Configuration.GetSection("AppSettings"));
StripeConfiguration.ApiKey = Configuration.GetSection("AppSettings")["SecretKey"];
}
And this runs successfully? Can you log what this value is to make sure it's passed properly?
Configuration.GetSection("AppSettings")["SecretKey"];
You do not, and should not, share the value here. But just make sure it's loading the API key properly
It has my sk in there
And thats what im mapping there on the ApiKey Configuration
Okay. I'm still trying to understand what the error message means.
The last staff member shared me this stackoverflow link
https://stackoverflow.com/questions/59935563/filenotfoundexception-could-not-load-file-or-assembly-system-configuration-con/59935998#59935998
I am trying to connect to Oracle database from .NET Core 3.1 using ADO.NET, here's my code:
private OracleConnection GetOracleConnection()
{
string conString = "Data Source=Q550.adr.XXXX.com;
The problem that i cant use this ConfigurationManager 4.5 cuz of my Stripe version
Okay so this is a known issue with ConfigurationManager?
Yup, it says that it can be fixed with 4.5 version, but cuz of my stripe version it automatically made me use the 4.7 version that in that Issue it says that it doesnt work to solve the problem
So there is some dependency conflict between the ConfigurationManager and Stripe?
Mhm and i wanted to know which Stripe version does work with ConfigurationManager 4.5
Our .NET SDK has versions pinned to specific Stripe API versions so just swapping out versions may be tricky
Taking a look at the Github Issues page for the SDK, it looks like there have been a few for ConfigurationManager. https://github.com/stripe/stripe-dotnet/issues?q=is%3Aissue+ConfigurationManager+is%3Aclosed
I can try another way to map my Stripe products, it can be a problem too but its weird that all my Stripe endpoints arent working online
I think your best option currently is to review the existing GH issues to see if anything there solves your problem. If not, you can create your own issue. Since this appears to be a conflict with your version of the .NET SDK and another package, I think that's the best way forward
