-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpayments.html
More file actions
192 lines (170 loc) · 5.95 KB
/
payments.html
File metadata and controls
192 lines (170 loc) · 5.95 KB
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Payment Page</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<style>
/* Global Styles */
body {
font-family: 'Inter', sans-serif;
margin: 0;
padding: 0;
background: linear-gradient(135deg, #1e3a8a, #162d6a);
color: #fff;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
/* Payment Container */
.payment-container {
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
padding: 30px;
border-radius: 15px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
width: 350px;
text-align: center;
animation: fadeIn 1s ease-in-out;
}
.payment-container h2 {
margin-bottom: 20px;
font-size: 24px;
font-weight: 600;
color: #fff;
}
/* Input Fields */
.input-group {
margin-bottom: 15px;
text-align: left;
}
.input-group label {
display: block;
margin-bottom: 5px;
font-weight: 500;
color: #ddd;
}
.input-group input {
width: 100%;
padding: 10px;
border: 1px solid rgba(255, 255, 255, 0.3);
border-radius: 8px;
background: rgba(255, 255, 255, 0.1);
color: #fff;
font-size: 14px;
transition: border-color 0.3s ease, background 0.3s ease;
}
.input-group input::placeholder {
color: #ccc;
}
.input-group input:focus {
border-color: #59d848;
background: rgba(255, 255, 255, 0.2);
outline: none;
}
/* Pay Now Button */
.pay-button {
width: 100%;
padding: 12px;
background: #59d848;
color: #fff;
border: none;
border-radius: 8px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: background 0.3s ease, transform 0.3s ease;
}
.pay-button:hover {
background: #4cc73d;
transform: translateY(-2px);
}
.pay-button:active {
transform: translateY(0);
}
/* Card Icons */
.card-icons {
display: flex;
justify-content: center;
gap: 15px;
margin-top: 20px;
}
.card-icons i {
font-size: 24px;
color: rgba(255, 255, 255, 0.7);
transition: color 0.3s ease;
}
.card-icons i:hover {
color: #59d848;
}
/* Animations */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(-20px); }
to { opacity: 1; transform: translateY(0); }
}
</style>
</head>
<body>
<div class="payment-container">
<h2>Payment Details</h2>
<form id="paymentForm" onsubmit="processPayment(event)">
<!-- Card Number -->
<div class="input-group">
<label for="cardNumber">Card Number</label>
<input type="text" id="cardNumber" placeholder="1234 5678 9012 3456" required>
</div>
<!-- Expiry Date -->
<div class="input-group">
<label for="expiryDate">Expiry Date</label>
<input type="text" id="expiryDate" placeholder="MM/YY" required>
</div>
<!-- CVV -->
<div class="input-group">
<label for="cvv">CVV</label>
<input type="text" id="cvv" placeholder="123" required>
</div>
<!-- Name on Card -->
<div class="input-group">
<label for="nameOnCard">Name on Card</label>
<input type="text" id="nameOnCard" placeholder="John Doe" required>
</div>
<!-- Pay Now Button -->
<button type="submit" class="pay-button">Pay Now</button>
</form>
<!-- Card Icons -->
<div class="card-icons">
<i class="fab fa-cc-visa"></i>
<i class="fab fa-cc-mastercard"></i>
<i class="fab fa-cc-amex"></i>
<i class="fab fa-cc-paypal"></i>
</div>
</div>
<script>
// Function to process payment
function processPayment(event) {
event.preventDefault(); // Prevent form submission
// Get query parameters from URL
const urlParams = new URLSearchParams(window.location.search);
const busId = urlParams.get('bus_id');
const busName = urlParams.get('bus_name');
const source = urlParams.get('source');
const destination = urlParams.get('destination');
const fare = urlParams.get('fare');
const seats = urlParams.get('seats');
const pickup = urlParams.get('pickup');
const dropoff = urlParams.get('dropoff');
const mobile = urlParams.get('mobile');
const email = urlParams.get('email');
const idCard = urlParams.get('idCard');
// Simulate payment processing
setTimeout(() => {
alert("Payment Successful! Your ticket has been booked.");
// Redirect to a success page or display booking details
window.location.href = `booking_success.html?bus_id=${busId}&bus_name=${busName}&source=${source}&destination=${destination}&fare=${fare}&seats=${seats}&pickup=${pickup}&dropoff=${dropoff}&mobile=${mobile}&email=${email}&idCard=${idCard}`;
}, 1000);
}
</script>
</body>
</html>