Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Include configuration file
- //require_once '../config.php';
- // Include database connection file
- include_once '../db_connection.php';
- // Fetch Plans from database
- $sqlQ = "SELECT * FROM plans";
- $stmt = $con->prepare($sqlQ);
- $stmt->execute();
- $stmt->store_result();
- ?>
- <!DOCTYPE html>
- <html lang="en" dir="ltr">
- <head>
- <meta charset="utf-8">
- <title>SIMCOPRO Subscription Payments</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>Stripe Subscription Payment Gateway Integration</h1>
- <div class="panel">
- <div class="panel-heading">
- <h3 class="panel-title">Subscription with Stripe</h3>
- <div>
- <p class="panel-title">Choose a Plan</p>
- <select id="subscription_plan" class="form-control">
- <?php
- if ($stmt->num_rows > 0) {
- $stmt->bind_result($id, $name, $price, $interval);
- while ($stmt->fetch()) {
- $interval_str = ($interval_count > 1)?$interval_count.' '.$interval.'s':$interval;
- ?>
- <option value="<?php echo $id; ?>"><?php echo $name.' [$'.$price.'/'.$interval_str.']'; ?></option>
- <?php
- }
- }
- ?>
- </select><!-- end select -->
- </div><!-- end div -->
- </div><!-- end panel-heading -->
- <div class="panel-body">
- <!-- display status message -->
- <div id="paymentResponse" class="hidden"></div>
- <!-- display subscription form -->
- <form id="subscrForm" action="" method="post">
- <div class="row g-3">
- <div class="col-md-12 form-group">
- <label for="name">Your Name</label>
- <input type="text" class="form-control" id="name" placeholder="Your Name">
- </div>
- <div class="col-md-12 form-group">
- <label for="email">Your Email</label>
- <input type="email" class="form-control" id="email" placeholder="Your Email">
- </div>
- <div class="col-12 form-group">
- <div id="card-element">
- <!-- Stripe.js will create card input elements here -->
- </div>
- </div>
- <!-- Form submit button -->
- <button id="submitBtn" class="btn btn-primary-gradient rounded-pill py-3 px-5 text-center">
- <div class="spinner hidden" id="spinner"></div>
- <span id="buttonText">Proceed</span>
- </button>
- </div>
- </form>
- </div><!-- end panel-body -->
- </div><!-- end panel -->
- </div><!-- end container -->
- </main>
- <!-- Stripe JS Library -->
- <script src="https://js.stripe.com/v3/"></script>
- <!-- Custom Script to process checkout with Stripe API -->
- <script src="js/checkout.js" STRIPE_PUBLISHABLE_KEY="<?php echo STRIPE_PUBLISHABLE_KEY; ?>" defer></script>
- <script src="..js/main.js"></script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement