forked from bitpay/lemonade-stand
-
Notifications
You must be signed in to change notification settings - Fork 2
/
invoice.html
40 lines (36 loc) · 1.18 KB
/
invoice.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
<!DOCTYPE html>
<html>
<head>
<title>Lemonade Stand</title>
<base href="{{baseUrl}}" />
<script src="/socket.io/socket.io.js"></script>
<script src="js/jquery/dist/jquery.js"></script>
<script src="js/jquery-qrcode/jquery.qrcode.min.js"></script>
<script src="js/bitcore-lib-btcp/bitcore-lib-btcp.js"></script>
</head>
<body>
<h1>Lemonade Stand - Store Demo</h1>
<h2>Invoice</h2>
<div id="qrcode"></div>
<p>Please send {{amount}} BTCP to {{address}}</p>
<h2>Transactions Received</h2>
<ul id="txids">
</ul>
<script type="text/javascript">
$('#qrcode').qrcode("bitcoinprivate:{{address}}?amount={{amount}}");
</script>
<script language="javascript">
var bitcore = require('bitcore-lib-btcp');
var socket = io('http://localhost:8001');
socket.on('bitcoind/addresstxid', function(data) {
var address = bitcore.Address(data.address);
if (address.toString() == '{{address}}') {
var txidsElm = document.getElementById('txids');
var elm = document.createTextNode('txid: ' + data.txid);
txidsElm.appendChild(elm);
}
});
socket.emit('subscribe', 'bitcoind/addresstxid', ['{{address}}']);
</script>
</body>
</html>