#vismaya_40545
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. 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.
- vismaya_40545, 1 hour ago, 3 messages
hi there, can you share the request id [0]? it'd look like req_xxx
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
req_45y0AvBs67rydh
Hi alex, Thanks for the response. This is the request ID
there's no 400 error there
https://dashboard.stripe.com/test/logs/req_45y0AvBs67rydh - are you sure you have the right request id?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I have created the session and there is no error.
What i am trying to do is display the end user about their verification request STATUS, right after their submission.
So i created a GET request
<?php
// Retrieve the session ID from the client-side
$sessionid = $_POST['sessionid'];
$stripe = new \Stripe\StripeClient($clientSecret);
try {
$verificationSession = $stripe->identity->verificationSessions->retrieve(
$sessionid,
[]
);
$status = $verificationSession->status;
echo json_encode(['status' => $status]);
} catch (\Stripe\Exception\ApiErrorException $e) {
// Handle errors, e.g., log the error or respond accordingly
echo 'Error: ' . $e->getMessage();
}
?>
This is giving me 400 error in my browser console
which line specifically is erroring?
verifyButton.addEventListener('click', function() {
// Get the VerificationSession client secret using the server-side endpoint you created
fetch('verify_identity.php', {
method: 'POST',
})
.then(function(response) {
return response.json();
})
.then(function(session) {
// Show the verification modal.
verify_sessionid = session.sessionid; // Assign the value here
clientSecret = session.clientSecret;
// Verify identity using the client-side method
return stripe.verifyIdentity(clientSecret);
})
.then(function(result) {
if (result.error) {
alert(result.error.message);
} else {
// Server-side verification using PHP
return fetch('confirmation.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ sessionID: verify_sessionid}),
});
}
})
.then(function(response) {
if (!response.ok) {
throw new Error('Server error: ' + response.statusText);
}
return response.json();
})
.then(function(status) {
// Handle the verification status as needed
alert('Verification Status: ' + status.status);
// You can redirect here if necessary
// window.location.href = 'verificationresult.php?message=' + encodeURIComponent(status.status);
})
.catch(function(error) {
console.error('Error:', error);
// Handle the error appropriately, e.g., show an error message to the user
alert('Error: ' + error.message);
});
});
</script>
This is my client side script.
The line where the fetch to confirmation.php is throwing the error.
The content of confirimation.php is the first code i sent you
okay sure, but which line in confirmation.php specifically is causing the 400 error? You should at least step through your code to track down which line that the error is occurring at. If you don't know how to use the debugger, you can add logging to track down which line the issue is occurring at.