forked from blacksnowmartin/SmartLearnChain
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatasciencepayment.html
More file actions
41 lines (36 loc) · 1.11 KB
/
Copy pathdatasciencepayment.html
File metadata and controls
41 lines (36 loc) · 1.11 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Data Science Payment</title>
<link rel="stylesheet" href="styles.css">
<script src="https://identity.ic0.app/lib/identity.js"></script>
</head>
<body style="background-image: url('img1.jpeg');"> <header>
<h1>Data Science Payment</h1>
</header>
<main>
<section class="payment-section">
<h2>Course Fee: 10 ICP</h2>
<button id="payButton">Pay Now</button>
<p id="response"></p>
</section>
</main>
<footer>
</footer>
<script>
async function payFees() {
try {
const actor = Actor.createActor("your-canister-id"); // Replace with your canister ID
await actor.call("payFees");
document.getElementById("response").textContent = "Payment successful!";
} catch (error) {
console.error(error);
document.getElementById("response").textContent = "Payment failed. Please try again.";
}
}
document.getElementById("payButton").addEventListener("click", payFees);
</script>
</body>
</html>