I am using Vue and PHP for stripe payment. But somehow stripe payment page is not loaded. I received the below error.

header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST');
header('Access-Control-Allow-Headers: token, Content-Type');
require 'vendor/autoload.php';
$stripe = new \Stripe\StripeClient("sk_test_5dD7CtVhKdHjRYDFm2CXnuQj7B5ceOdxpWfkixuBn5KmhIDeuSV9onck8MFGyUvZdT00eGzYl6In");
$response = $stripe->checkout->sessions->create([
'success_url' => 'http://localhost:3000/sidebar/info/buy-now?success=true',
'cancel_url' => 'http://localhost:3000/sidebar/info/buy-now?success=false',
'line_items' => [
[
'price' => 'price_1LGPHSSEBFYnfFdusJm37r2t',
'quantity' => 1,
],
],
'mode' => 'subscription',
]);
echo json_encode($response);
VUE
let sessionId = ''
// let stripe = null as any;
onMounted(async () => {
fetchSessionId()
})
const fetchSessionId = () => {
fetch(`http://localhost/stripe/index.php`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
})
.then((response) => response.json())
.then((json) => {
sessionId = json.id
})
}
const redirect = async () => {
const stripe = await loadStripe(import.meta.env.VITE_STRIPE_API_KEY as string)
stripe?.redirectToCheckout({
sessionId: sessionId,
})
}
Any solution appreciated!