Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //include configuration file
- // require_once 'config.php';
- //include the database connection file
- require_once '../db_connection.php';
- $payment_id = $statusMsg = '';
- $status = 'error';
- // check wheter the subscription ID is not empty
- if(!empty($_GET['sid'])){
- $subscr_id = base64_decode($_GET['sid']);
- // Fetch subscription info from database
- $sqlQ = "SELECT S.id, S.stripe_subscription_id, S.paid_amount, S.paid_amount_currency, S.plan_interval, S.plan_period_start,
- S.plan_period_end, S.customer_name, S.customer_email, S.status, P.name as plan_name, P.price as plan_amount FROM user_subscriptions as S
- LEFT JOIN plans as P On P.id = S.plan_id WHERE S.id = ?";
- $stmt = $con->prepare($sqlQ);
- $stmt->bindParam("i", $subscr_id);
- $stmt->execute();
- $stmt->store_result();
- if($stmt->num_rows > 0){
- //Subscription and transaction detail
- $stmt->bind_result($subscription_id, $stripe_subscription_id, $paid_amount, $paid_amount_currency, $plan_interval, $plan_period_start,
- $plan_period_end, $customer_name, $customer_email, $subscr_status, $plan_name, $plan_amount);
- $stmt->fetch();
- $status = 'success';
- $statusMsg = 'Yor subscription Payment has been Successful!';
- }else{
- $statusMsg = 'Transaction has been failed!';
- }
- }else{
- header("Location:index.php");
- exit();
- }
- ?>
- <!DOCTYPE html>
- <html lang="en" dir="ltr">
- <head>
- <meta charset="utf-8">
- <title>SIMCOPRO Home</title>
- <meta content="width=device-width, initial-scale=1.0" name="viewport">
- <meta content="" name="keywords">
- <meta content="" name="SIMCOPRO Subscription Payments Stripe">
- <!-- Google Web Fonts -->
- <link rel="preconnect" href="https://fonts.googleapis.com">
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
- <link href="https://fonts.googleapis.com/css2?family=Heebo:wght@400;500&family=Jost:wght@500;600;700&display=swap" rel="stylesheet">
- <!-- Icon Font Stylesheet -->
- <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.0/css/all.min.css" rel="stylesheet">
- <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.1/font/bootstrap-icons.css" rel="stylesheet">
- <!-- Libraries Stylesheet -->
- <link href="lib/animate/animate.min.css" rel="stylesheet">
- <!-- Customized Bootstrap Stylesheet -->
- <link href="../css/bootstrap.min.css" rel="stylesheet">
- <!-- Template Stylesheet -->
- <link href="css/style.css" rel="stylesheet">
- </head>
- <body>
- <main>
- <div class="container">
- <h1>SIMCOPRO HomePage</h1>
- <div class="panel">
- <div class="panel-heading">
- <h3 class="panel-title">HomePage</h3>
- </div><!-- end panel-heading -->
- <div class="panel-body">
- <?php if(!empty($subscription_id)){?>
- <h1 class="<?php echo $status; ?>"> <?php echo $statusMsg; ?> </h1>
- <h4>Payment Information</h4>
- <p><b>Reference Number:</b> <?php echo $subscription_id;?></p>
- <p><b>Subscription ID:</b> <?php echo $stripe_subscription_id;?></p>
- <p><b>Paid Amount:</b> <?php echo $paid_amount.' '.$paid_amount_currency;?></p>
- <p><b>Status:</b> <?php echo $subscr_status;?></p>
- <h4>Subscription Information</h4>
- <p><b>Plan Name:</b> <?php echo $plan_name;?></p>
- <p><b>Amount:</b> <?php echo $plan_amount.' '.STRIPE_CURRENCY;?></p>
- <p><b>Plan Interval:</b> <?php echo $plan_interval;?></p>
- <p><b>Period Start:</b> <?php echo $plan_period_start;?></p>
- <p><b>Period End:</b> <?php echo $plan_period_end;?></p>
- <h4>Customer Information</h4>
- <p><b>Name:</b> <?php echo $customer_name;?></p>
- <p><b>Email:</b> <?php echo $customer_email;?></p>
- <?php }else{?>
- <h1 class="error">Your transaction has been failed!</h1>
- <p class="error"><?php echo $statusMsg; ?></p>
- <?php } ?>
- </div>
- <a href="index.php" class="btn_link">Back to Home Page</a>
- </div><!-- end panel -->
- </div>
- </main>
- <!-- Stripe JS Library -->
- <script src=""></script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment