#_php-server-error

1 messages Ā· Page 1 of 1 (latest)

fluid merlinBOT
#

šŸ‘‹ 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/1326682907749912606

šŸ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

merry bobcat
wooden igloo
#

Thank you . I am going to check

fluid merlinBOT
wooden igloo
#

Still.. I can not proced it.

dark prairie
#

Hi šŸ‘‹

I am stepping in as my colleague had to go

wooden igloo
#

Hello !

dark prairie
#

First I want to point out that you have provided your full secret key and this is a public forum

#

You should never do this

#

please roll your key immediately

wooden igloo
#

Thank but this is test key,

dark prairie
#

Still, never do this and please roll your key immediately

wooden igloo
#

Ok

#

This is the code ( frontend file)

dark prairie
#

Okay but there should only be one line that is throwing the error you are reporting. Which line is it?

#

Most likely this one

const result = await response.json();

but I want to be sure we're on the same page

wooden igloo
#

When one error is resolved, the next error appears.

dark prairie
#

What error are you referring to?

#

What is the exact error message you are currently receiving and which line of code triggers this error?

wooden igloo
#

Required data is missing.

dark prairie
#

What data? What is the code that is generating this error?

wooden igloo
#

I don't know which line the error is related to. Also, I can't determine whether the issue is with the frontend index.html or the backend charge.php.

dark prairie
#

Where is this error showing up? Do you only see it in your browser console or does it show up in your PHP server logs?

wooden igloo
#

there is pop up

dark prairie
#

That appears to be coming from your front-end where you are specifically calling alert(). This is something your code is doing

#

If this is an error your PHP code is passing back to your front-end, you need to capture/log that in your PHP code

wooden igloo
#

yes

#

this error comes from this (backend)

// āœ… åæ…é ˆćƒ‡ćƒ¼ć‚æć®ćƒć‚§ćƒƒć‚Æ
if (empty($email) || empty($stripeToken) || empty($subOption) || empty($amount)) {
http_response_code(400);
echo json_encode([
'status' => 'error',
'message' => 'åæ…č¦ćŖćƒ‡ćƒ¼ć‚æćŒäøč¶³ć—ć¦ć„ć¾ć™ć€‚',
'received_data' => compact('email', 'stripeToken', 'subOption', 'amount', 'upsell')
]);
exit;
}

dark prairie
#

Okay so where is the error being raised?

#

Are you making a request to the Stripe APIs? Or is the error raised before that?

wooden igloo
dark prairie
#

I recommend you add more logging to your code to find out.

wooden igloo
#

How can I do that ?

dark prairie
#

I recommend you print out the full contents of any response you get from the Stripe API.

#

Additionally, are you seeing API requests in your Stripe Dashboard?

#

Specifically, ones that are failing?

#

If so, please provide the request IDs as text, eg. req_XXXXX

wooden igloo
#

req_sJ9b19ovcnn3L9

dark prairie
#

That request is successful

#

So that is not the source of the error

wooden igloo
#

then what is the source?

dark prairie
#

That is something you will need to figure out by debugging your own code