-
Notifications
You must be signed in to change notification settings - Fork 7
/
example.html
56 lines (49 loc) · 2.13 KB
/
example.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
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>SC2 Pay Test Page</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdn.steemjs.com/lib/latest/steem.min.js"></script>
<script src="sc2.min.js"></script>
<script src="sc2-pay.min.js"></script>
<script type="text/javascript">
function testPurchase() {
sc2_pay.requestPayment('SC2-Pay Test Payment', 'yabapmatt', 0.1, 'STEEM', 'payment id / memo', function(trans) {
if(trans) {
$('#result').val('Purchase Success!\r\nTransaction Details:\r\n' + JSON.stringify(trans));
} else {
$('#result').val('Purchase cancelled.');
}
})
}
function testPurchaseVessel() {
sc2_pay.requestPaymentVessel('SC2-Pay Test Payment', 'yabapmatt', 0.1, 'STEEM', 'payment id / memo', function(trans) {
if(trans) {
$('#result').val('Purchase Success!\r\nTransaction Details:\r\n' + JSON.stringify(trans));
} else {
$('#result').val('Purchase cancelled.');
}
})
}
</script>
</head>
<body>
<div class="container"style="margin-top: 20px;">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">Test / Example page for the SC2-Pay JavaScript library</h4>
</div>
<div class="panel-body">
<button onclick="testPurchase()">Test Purchase</button>
<button onclick="testPurchaseVessel()">Test Purchase with Vessel</button><br/>
Call: sc2_pay.requestPayment('SC2-Pay Test Payment', 'yabapmatt', 0.1, 'STEEM', 'payment id / memo', callback);
<div style="margin-top: 20px;">
Output:<br/>
<textarea id="result" style="width: 90%; height: 200px;"></textarea>
</div>
</div>
</div>
</div>
</body>
</html>