-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
100 lines (89 loc) · 3.23 KB
/
index.html
File metadata and controls
100 lines (89 loc) · 3.23 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
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
100
<!DOCTYPE html>
<html>
<head>
<title>Ross Program Store</title>
<script src="https://js.stripe.com/v3"></script>
</head>
<body>
<div id="error-message"></div>
The 2019 Ross Program Store is now closed. Please come back next year
to purchase more t-shirts with quadratic reciprocity.
<select id="size">
<option value="small">Small</option>
<option value="medium">Medium</option>
<option value="large">Large</option>
<option value="x-large">X-Large</option>
<option value="xx-large">2X-Large</option>
<option value="xxx-large">3X-Large</option>
</select>
<select id="ink">
<option value="black-ink">Black ink</option>
<option value="white-ink">White ink</option>
</select>
<select id="color">
<option value="aqua">aqua</option>
<option value="army">army</option>
<option value="ash">ash</option>
<option value="asphalt">asphalt</option>
<option value="baby-blue">baby blue</option>
<option value="black">black</option>
<option value="cranberry">cranberry</option>
<option value="creme">creme</option>
<option value="eggplant">eggplant</option>
<option value="forest">forest</option>
<option value="fuchsia">fuchsia</option>
<option value="gold">gold</option>
<option value="grass">grass</option>
<option value="heather">heather</option>
<option value="kelly">kelly</option>
<option value="lemon">lemon</option>
<option value="light-blue">light blue</option>
<option value="light-pink">light pink</option>
<option value="lime">lime</option>
<option value="mint">mint</option>
<option value="navy">navy</option>
<option value="olive">olive</option>
<option value="orange">orange</option>
<option value="pink">pink</option>
<option value="purple">purple</option>
<option value="red">red</option>
<option value="royal">royal</option>
<option value="silver">silver</option>
<option value="slate">slate</option>
<option value="sunshine">sunshine</option>
<option value="teal">teal</option>
<option value="turquoise">turquoise</option>
<option value="white">white</option>
</select>
<button id="checkout" role="link">
Checkout
</button>
<script>
var stripe = Stripe('pk_live_EVv0HE4EnEnGBfjY2iBzPnuS003Q0UNubO');
var checkoutButton = document.getElementById('checkout');
checkoutButton.addEventListener('click', function () {
// When the customer clicks on the button, redirect
// them to Checkout.
var e = document.getElementById("size");
var size = e.options[e.selectedIndex].value;
var e = document.getElementById("ink");
var ink = e.options[e.selectedIndex].value;
var e = document.getElementById("color");
var color = e.options[e.selectedIndex].value;
stripe.redirectToCheckout({
items: [{sku: 'shirt_' + size + '_' + ink + '_' + color, quantity: 1}],
successUrl: 'https://rossprogram.org/store/success.html',
cancelUrl: 'https://rossprogram.org/store/index.html'
})
.then(function (result) {
if (result.error) {
// If `redirectToCheckout` fails due to a browser or network
// error, display the localized error message to your customer.
var displayError = document.getElementById('error-message');
displayError.textContent = result.error.message;
}
});
});
</script>
</body>
</html>