forked from yash19sinha/coffee-bean
-
Notifications
You must be signed in to change notification settings - Fork 0
/
payment.html
155 lines (147 loc) · 9.21 KB
/
payment.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-zCbKRCUGaJDkqS1kPbPd7TveP5iyJE0EjAuZQTgFLD2ylzuqKfdKlfG/eSrtxUkn" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-fQybjgWLrvvRgtW6bFlB7jaZrFsaBXjsOMm/tB9LTS58ONXgqbR9W8oWht/amnpF" crossorigin="anonymous"></script>
<link rel="stylesheet" href="css/styles.css">
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@9"></script>
<script src="https://kit.fontawesome.com/cc5e355fff.js" crossorigin="anonymous"></script>
<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=Montserrat:wght@400;900&family=Ubuntu:ital@0;1&display=swap" rel="stylesheet">
<script>
$(function() {
$('[data-toggle="tooltip"]').tooltip()
})
</script>
<style>
body{
background-color: #CA965C;
}
</style>
</head>
<body>
<div class="container py-5"><br>
<!-- For demo purpose -->
<h2 class="pay-text">Payment Gateway</h2><br>
<div class="row">
<div class="col-lg-8 mx-auto">
<div class="card ">
<div class="card-header">
<div class="bg-white shadow-sm pt-4 pl-2 pr-2 pb-2">
<!-- Credit card form tabs -->
<ul role="tablist" class="nav bg-light nav-pills rounded nav-fill mb-3">
<li class="nav-item"> <a data-toggle="pill" href="#credit-card" class="nav-link active "> <i class="fas fa-credit-card mr-2"></i> Credit Card </a> </li>
<li class="nav-item"> <a data-toggle="pill" href="#net-banking" class="nav-link "> <i class="fas fa-mobile-alt mr-2"></i> Net Banking </a> </li>
</ul>
</div> <!-- End -->
<!-- Credit card form content -->
<div class="tab-content">
<!-- credit card info-->
<div id="credit-card" class="tab-pane fade show active pt-3">
<form action="index.html" method="get" onsubmit="return validateForm();">
<div class="form-group"> <label for="username">
<h6>Card Owner</h6>
</label> <input type="text" name="username" placeholder="Card Owner Name" class="form-control" required> </div>
<div class="form-group"> <label for="cardNumber">
<h6>Card number</h6>
</label>
<div class="input-group"> <input type="text" name="cardNumber" placeholder="Valid card number" class="form-control " required>
<div class="input-group-append"> <span class="input-group-text text-muted"> <i class="fab fa-cc-visa mx-1"></i> <i class="fab fa-cc-mastercard mx-1"></i> <i class="fab fa-cc-amex mx-1"></i> </span> </div>
</div>
</div>
<div class="row">
<div class="col-sm-8">
<div class="form-group"> <label><span class="hidden-xs">
<h6>Expiration Date</h6>
</span></label>
<div class="input-group"> <input type="number" placeholder="MM" name="" class="form-control" required> <input type="number" placeholder="YY" name="" class="form-control" required> </div>
</div>
</div>
<div class="col-sm-4">
<div class="form-group mb-4"> <label data-toggle="tooltip" title="Three digit CV code on the back of your card">
<h6>CVV <i class="fa fa-question-circle d-inline"></i></h6>
</label> <input type="password" required class="form-control"> </div>
</div>
</div>
<div class="card-footer">
<button onclick ="bugfix(
'Payment Success',
'Thankyou For Choosing Us'
)" type="submit" class="subscribe btn btn-primary btn-block shadow-sm"> Confirm Payment </button>
</form>
</div>
</div> <!-- End -->
<script>
function bugfix(string1,string2){
var inputs = document.querySelectorAll('input[required]');
for (var i = 0; i < inputs.length; i++) {
if (!inputs[i].value) {
return ;
}
}
Swal.fire(string1,string2)
return ;
}
</script>
<script>
function validateForm() {
var inputs = document.querySelectorAll('input[required]');
for (var i = 0; i < inputs.length; i++) {
if (!inputs[i].value) {
alert('Please fill in all the required fields.');
return false;
}
}
alert('Payment Done Successfully');
window.location.href = 'index.html';
return true;
}
</script>
<!-- bank transfer info -->
<div id="net-banking" class="tab-pane fade pt-3">
<div class="form-group "> <label for="Select Your Bank">
<h6>Select your Bank</h6>
<form action="index.html" method="get" >
</label> <select class="form-control" required id="ccmonth">
<option value="" selected disabled>--Please select your Bank--</option>
<option>Bank 1</option>
<option>Bank 2</option>
<option>Bank 3</option>
<option>Bank 4</option>
<option>Bank 5</option>
<option>Bank 6</option>
<option>Bank 7</option>
<option>Bank 8</option>
<option>Bank 9</option>
<option>Bank 10</option>
</select> </div>
<div class="form-group">
<p> <button type="submit" class="btn btn-primary" onclick ="netBankCheck()"><i class="fas fa-mobile-alt mr-2"></i> Confirm Payment</button> </p>
</form>
<script>
function netBankCheck() {
var selectedBank = document.getElementById("ccmonth").value;
if (selectedBank === "") {
// alert("Please select your Bank for Net Banking.");
Swal.fire(
"Error",
"Please Select A Bank For Net Banking"
)
event.preventDefault(); // Prevent the form from submitting if the bank is not selected
} else {
alert("Net Banking option selected: " + selectedBank + ". Payment done successfully.");
}
}
</script>
</div>
<p class="text-muted">Note: After clicking on the button, you will be directed to a secure gateway for payment. After completing the payment process, you will be redirected back to the website to view details of your order. </p>
</div> <!-- End -->
<!-- End -->
</div>
</div>
</div>
</div>
</body>
</html>