#fate_unexpected

1 messages ยท Page 1 of 1 (latest)

oak wrenBOT
#

๐Ÿ‘‹ 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.

lean ironBOT
#

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.

storm crescent
#

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
novel sundial
#

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

storm crescent
#

What SDK? This ConfigurationManager doesn't look to me like Stripe code

novel sundial
#

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

storm crescent
#

Please answer my question. What SDK are you using?

novel sundial
#

im using netcore 3.1

storm crescent
#

I don't know what that is. It kinda looks like this is a .NET integration

novel sundial
#

Yup it is .Net

storm crescent
#

Okay

#

So....looking at the error message. It sounds like your integration is having difficulty finding the API key. How are you initializing Stripe?

novel sundial
#

On my startup.cs

public void ConfigureServices(IServiceCollection services)
{
       services.Configure<StripeSettings>              (Configuration.GetSection("AppSettings"));
            StripeConfiguration.ApiKey = Configuration.GetSection("AppSettings")["SecretKey"];
}
storm crescent
#

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

novel sundial
#

It has my sk in there

#

And thats what im mapping there on the ApiKey Configuration

storm crescent
#

Okay. I'm still trying to understand what the error message means.

novel sundial
#

The problem that i cant use this ConfigurationManager 4.5 cuz of my Stripe version

storm crescent
#

Okay so this is a known issue with ConfigurationManager?

novel sundial
#

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

storm crescent
#

So there is some dependency conflict between the ConfigurationManager and Stripe?

novel sundial
#

Mhm and i wanted to know which Stripe version does work with ConfigurationManager 4.5

storm crescent
#

Our .NET SDK has versions pinned to specific Stripe API versions so just swapping out versions may be tricky

oak wrenBOT
storm crescent
novel sundial
#

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

storm crescent
#

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

novel sundial
#

Ok ok i will take a look on the git issue and see if someone else solve my problem

#

thank you so much for you help! handshake