#adhamalhabil_37036

1 messages · Page 1 of 1 (latest)

storm spindleBOT
wispy iron
#

Can you give me some more details? I'm not really sure what you're asking yet

rare junco
#

$servername = "localhost";
$username = "root";
$password ="";
$dbname = "login_db";

$conn = new mysqli($servername, $username, $password, $dbname);

// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}

// Check if the entry ID is provided in the query parameter
if (isset($_GET['entry_id'])) {
$entryId = $_GET['entry_id'];
//$count = $_SESSION['count'];
// Fetch data for a specific form entry from the 'app' table
$sql = "SELECT * FROM app WHERE id = $entryId";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
    $formData = $result->fetch_assoc();
} else {
    echo "Form entry not found";
    exit();
}

} else {
echo "Entry ID not provided";
exit();
}

// Close the database connection
$conn->close();

try {
$paymentIntent = $stripe->paymentIntents->create([
'payment_method_types' => ['card'],
'amount' => 2700 *$entryId,
'currency' => 'cad',
]);
//sendAutoReply($_POST['name'],$_POST['email']);
} catch (\Stripe\Exception\ApiErrorException $e) {
http_response_code(400);
error_log($e->getError()->message);
?>
<h1>Error</h1>
<p>Failed to create a PaymentIntent</p>
<p>Please check the server logs for more information</p>
<?php
exit;
} catch (Exception $e) {
error_log($e);
http_response_code(500);
exit;
}
?>
when i change $conn to my server it return white page and did not return payment page

wispy iron
#

That's somethign you'll really need to debug on your end - that's purely code that you own that isn't really related to how you're using stripe