-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
69 lines (65 loc) · 1.74 KB
/
index.html
File metadata and controls
69 lines (65 loc) · 1.74 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
<head>
<script type="text/javascript">
window.addEventListener('message', receiveMessage, false);
function receiveMessage(event) {
//replace this with location of your iframe
if (event.origin == 'http://localhost') {
if (event.data == 'secreto') {
document.getElementById('payed').innerHTML = "<span style='color:green;'>Status: Payed!</span>";
}
else {
return;
}
}
}
function beginPayment() {
var frame, coin, amount, srcUrl;
coin = document.getElementById('coin').value;
amount = document.getElementById('amount').value;
srcUrl = "payment.php?" + "amount=" + amount + "&" + "coin=" + coin;
frame = document.createElement("IFRAME");
frame.setAttribute("src",srcUrl);
frame.setAttribute("id","frame");
document.getElementById('frameContainer').appendChild(frame);
}
</script>
<style>
iframe {
width: 500px;
height: 400px;
}
</style>
</head>
<html>
<body>
<table width="100%">
<tr>
<td style="vertical-align: top;">
<h1>Moolah iFrame Payments Example</h1>
</td>
</tr>
<tr>
<td style="vertical-align: top;">
<label for="coin">Select Coin: </label>
<select id="coin">
<option id="BTC" value="BTC" selected="selected">BTC</option>
<option id="DOGE" value="DOGE">DOGE</option>
<option id="LTC" value="LTC">LTC</option>
<option id="VTC" value="VTC">VTC</option>
</select>
<br/>
<label for="amount">Enter amount</label>
<input type="number" id="amount" placeholder="(in selected coin)" />
<br/>
<input type="button" id="initPay" value="Initiate" onclick="beginPayment();" />
<br/>
<h2 id="payed">Status: <span style='color:red;'>Not paid</span></h2>
</td>
<td style="vertical-align: top;">
<div id="frameContainer">
</div>
</td>
</tr>
</table>
</body>
</html>