#emily24-id
1 messages · Page 1 of 1 (latest)
i see
in the checkout example i have cs_ is used as a way for the customer to query their transaction after it's complete
wasn't sure if it was a bad idea
Hi, can you quote in the code block you are referring to? That articles is not from Stripe official doc and I am not quite familiar with it
// Check whether stripe checkout session is not empty
if(!empty($_GET['session_id'])){
$session_id = $_GET['session_id'];
// Fetch transaction data from the database if already exists
$sql = "SELECT * FROM orders WHERE checkout_session_id = '".$session_id."'";
$result = $db->query($sql);
if($result->num_rows > 0){
$orderData = $result->fetch_assoc();
$paymentID = $orderData['id'];
$transactionID = $orderData['txn_id'];
$paidAmount = $orderData['paid_amount'];
$paidCurrency = $orderData['paid_amount_currency'];
$paymentStatus = $orderData['payment_status'];
$ordStatus = 'success';
$statusMsg = 'Your Payment has been Successful!'; ```
session_id is a GET request containing the checkout_session_id
after the transaction is complete