#tomas_code

1 messages ¡ Page 1 of 1 (latest)

lethal shoalBOT
#

👋 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/1291362128212787254

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

loud totem
#

hi there!

#

I'm not sure I follow. are you saying that this call sometimes work, sometimes return an object with an error, and sometimes throw an error?

#

and what exactly is the issue?

left hazel
#

Sometimes this call works. Sometimes instead of throwing an error, GetAsync returns successfully but with an error body instead of a legit Stripe response object

loud totem
#

can you share the error body you received?

left hazel
#

In our logs, we can only see that the paymentMethod.StripeResponse.Content is 'Stripe.StripeException, Stripe.net'

heavy plume
#

Hey! Taking over for my colleague. Let me catch up.

#

Could you please share the complete Stacktrace of the error ?

left hazel
#

The error is "Error resolving type specified in JSON 'Stripe.StripeException, Stripe.net'" in this method: public PaymentMethodDto DeserializeStripeResponse(string stripeResponseContent)
{
try
{
return JsonConvert.DeserializeObject<PaymentMethodDto>(stripeResponseContent);
}
catch (JsonException ex)
{
_logger.LogError(ex, "Error deserializing Stripe response: {Message}", ex.Message);
return new PaymentMethodDto()
{
Object = stripeResponseContent
};
}
} where we get Stripe response content via var paymentMethod = await _paymentMethodService.GetAsync(paymentMethodId); The GetAsync does not throw an error in this case

heavy plume
#

And what was the answer you got from Stripe API call ?

heavy plume
lethal shoalBOT