-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
96 lines (71 loc) · 3.13 KB
/
index.html
File metadata and controls
96 lines (71 loc) · 3.13 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
<html>
<head>
<meta name="viewport" content="width=device-width">
<script id="bolt-track"
type="text/javascript"
src="https://connect-sandbox.bolt.com/track.js"
data-publishable-key="u4CM94MLQ-ot.vMCZmn6V3iAs.7e4df2f66b57737b5fb94c0bf5fe667d115af11558b81f34c0f300a92116abcf"></script>
<script id="bolt-connect"
type="text/javascript"
src="https://connect-sandbox.bolt.com/connect.js"
data-publishable-key="u4CM94MLQ-ot.vMCZmn6V3iAs.7e4df2f66b57737b5fb94c0bf5fe667d115af11558b81f34c0f300a92116abcf"></script>
</head>
<body>
<div class="bolt-checkout-button">
</div>
</body>
<script>
var cart = {
"orderToken": "0cacea092f4b9f00465981db93f79c26953af0d116095a683bdd3ca8f8c01271",
"authcapture": true
};
var hints = {
"prefill": {
"firstName": "Bolt",
"lastName": "User",
"email": "email@example.com",
"phone": "1112223333",
"addressLine1": "1235 Howard St",
"addressLine2": "Unit D",
"city": "San Francisco",
"state": "California",
"zip": "94103",
"country": "US" // ISO Alpha-2 format expected
}
};
var callbacks = {
check: function() {
// This function is called just before the checkout form loads.
// This is a hook to determine whether Bolt can actually proceed
// with checkout at this point. This function MUST return a boolean.
return true;
},
onCheckoutStart: function() {
// This function is called after the checkout form is presented to the user.
alert("HELLO")
},
onShippingDetailsComplete: function() {
// This function is called when the user proceeds to the shipping options page.
// This is applicable only to multi-step checkout.
},
onShippingOptionsComplete: function() {
// This function is called when the user proceeds to the payment details page.
// This is applicable only to multi-step checkout.
},
onPaymentSubmit: function() {
// This function is called after the user clicks the pay button.
},
success: function(transaction, callback) {
// This function is called when the Bolt checkout transaction is successful.
// ... Add your code here ...
// **IMPORTANT** callback must be executed at the end of this function if `success`
// is defined.
callback();
},
close: function() {
// This function is called when the Bolt checkout modal is closed.
}
};
BoltCheckout.configure(cart, hints, callbacks);
</script>
</html>