#paul-geoghegan_error
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/1265718098087116920
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello
svelte-stripe is a third-party library as far as I know so we won't know much about the workings of it.
Are you seeing any errors in your stripe logs for the API request? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Hi, no I don't think there was any error. I think the error is with the actual stripe NPM package as svelte-stripe is just for the UI side not the actual payment intents but I could be wrong. I think the request is fine it's just the response that is the problem. As I mentioned it said that it received invalid json from Stripe so it seems like it's just not able to read the response.
Based on what I've seen in their docs: https://www.sveltestripe.com/
The guide instructs you to create an endpoint inside the svelte app? I'm not really familiar with the set up but seems like the issue is between the app trying to parse the response from Stripe.
In your Stripe logs, you can verify the response that was sent back to the API request. It should be JSON. We've not heard of any other issues around the format..
I'll try take another look. As I mentioned it seems odd since it works perfectly with my test keys just not with my live ones.
Yeah there has to be some error that you're missing.. Is your server only printing out "invalid json was returned by stripe"?
Is there a way to see the exact response that you received?
Not really, it only happens with my live keys so I can't really check. I will say I have dug a bit deeper and there is no last used date for the live API keys but my test ones have the correct date. Looking through the logs there is also no reference to a payment intent being created in live mode either.
Gotcha. If there are no logs of PaymentIntent being created then I believe the request is failing before it reaches Stripe.
If you're hosting your backend server separately, it is possible that your deployed app is unreachable.. Have you tried invoking the production API routes from something like Postman or CURL?
I suspect your production server is returning some HTML error which is causing "Invalid json" error but your error log prints it out as this error was returned by Stripe
No I haven't yet. I will need to do a few things to get things up and running again as I had to roll back the website to the old one since Stripe wasn't working.
Gotcha. Based on what you've shared so far, I'm almost certain that the issue isn't with Stripe API.. As if the response from Stripe was malformed, you'd still see a request in your logs..
Since there are no live mode logs, It is highly likely that the request is failing in transit before it reaches Stripe..