-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.html
99 lines (91 loc) · 2.75 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
88
89
90
91
92
93
94
95
96
97
98
99
<!DOCTYPE html>
<html>
<head>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Spreedly Express Demo Page</title>
<script src="https://core.spreedly.com/iframe/express-3.min.js" id="express-script"></script>
<script type="text/javascript">
var environmentKey= "TbWAYgG7qaagGBh7hPjXQxS4DM4"
var options = {
company_name: "Food 'n Stuff",
sidebar_top_description: "This is where you can buy all your food and most of your stuff",
sidebar_bottom_description: "2 ground beef </br> 2 crows",
amount: "$24.24"}
var enableButton = function(){
document.getElementById("ready-to-pay").disabled = false;
}
SpreedlyExpress.onInit(enableButton);
var handlePaymentToken = function(token, formData) {
document.getElementById('full_name').value = formData["full_name"]
document.getElementById('month').value = formData["month"]
document.getElementById('year').value = formData["year"]
document.getElementById('token').value = token
document.getElementById('payment-form').submit();
}
SpreedlyExpress.onPaymentMethod(handlePaymentToken);
SpreedlyExpress.init(environmentKey,options);
</script>
<style>
#content{
width:500px;
margin:0 auto;
}
.results {
visibility: hidden;
}
</style>
</head>
<body>
<div class="container" id="content">
<h1> Food 'n Stuff </h1>
<h2> Invoice</h2>
<table class="table table-bordered table-striped table-hover table-condensed">
<tr>
<th>Item Number</th>
<th>Description</th>
<th>Quantity</th>
<th>Price</th>
<th>Total</th>
</tr>
<tr>
<td>F-01</td>
<td>Ground Beef</td>
<td>2</td>
<td>10.12</td>
<td>10.12</td>
</tr>
<tr>
<td>S-03</td>
<td>Crow</td>
<td>2</td>
<td>2.00</td>
<td>4.00</td>
</tr>
<tr>
<td>Total</td>
<td></td>
<td>4 items</td>
<td></td>
<td>24.24</td>
</tr>
</table>
<br/>
<div class="form-group">
<div class="col-sm-offset-3 col-sm-5">
<button id="ready-to-pay" onclick="SpreedlyExpress.openView();" class="btn btn-primary btn-block" disabled="true">Buy Now</button>
</div>
</div>
<form class="form-horizontal" role="form" action="/result.html" method="GET" id="payment-form">
<div class="col-sm-offset-3 col-sm-5">
<input class="results" type="text" id="full_name" name="full_name" required>
<input class="results" type="text" id="month" name="month" required>
<input class="results" type="text" id="year" name="year" required>
<input class="results" type="text" id="token" name="payment_method_token" required>
</div>
</form>
</div>
</body>
</html>