-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.html
87 lines (74 loc) · 2.22 KB
/
index.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
<html>
<head>
<style>
body {
font-family: 'Lucida Grand', Helvetica, Arial, sans-serif;
}
h1 {
padding-bottom: 6px;
margin-right: 350px;
border-bottom: 1px solid #aaa;
}
#test-form {
font-size: 80%;
background-color: #e6e6e6;
border-radius: 8px;
position: absolute;
padding: 12px;
top: 10px;
right: 10px;
width: 300px;
}
label {
display: inline-block;
width: 100px;
text-align: right;
}
</style>
<script src="/dnode.js" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
DNode(function(){
this.chargeSucceeded = function(charge) {
var chargeLi = $('<li></li>');
$(chargeLi).text("Charge for $"+(charge.amount/100).toFixed(2) +
" with description '"+charge.description+"' succeeded!");
$('#charges').prepend(chargeLi);
document.getElementById('cash_register').play();
}
}).connect();
$('form').submit(function(){
setTimeout(function(){
$('input[type=text]').val('');
}, 0)
})
});
</script>
</head>
<body>
<div>
<h1>Payments!</h1>
</div>
<ul id="charges">
</ul>
<div id="test-form">
<h2>Create a test payment</h2>
<p>This will make an actual test payment on the configured test account,
and use our actual webhook system to send the webhook, which will then show up here.
It may take a minute, so be patient!</p>
<form action="/test-payment" method="POST" target="hidden">
<label for="amount">Amount: </label>
<input id="amount" name="amount" type="text" />
<br />
<label for="amount">Description: </label>
<input id="description" name="description" type="text" />
<br />
<label for="submit"> </label>
<input type="submit" value="Send" />
</form>
<iframe name="hidden" id="hidden" width="0" height="0" style="width:0; height:0;"></iframe>
</div>
<audio id="cash_register" src="/cash_register.wav" style="display:none;" preload></audio>
</body>
</html>