Callbacks Documentation
Edit on
Codepen.io
Codepen.io
data-access-key
Required for making requests with the secure payload. Please refer to Passing Sensitive Data with Secure Requests for more information.
x
46
1
<!--
2
Button to call the custom function to make the secure call
3
-->
4
<button onclick="pushToFastSpring();">Secure Checkout</button>
5
6
<!--
7
Custom function to make the fastspring.builder.secure() call
8
and fastspring.builder.checkout().
9
-->
10
<script type="text/javascript">
11
function pushToFastSpring() {
12
fastspring.builder.secure(
13
{
14
"contact": {
15
"email":"myName@email.com",
16
"firstName":"John",
17
"lastName":"Doe"
18
},
19
"items":
20
[
21
{
22
"product": "phot-io-main-app",
23
"quantity": 1,
24
"pricing": {
25
"price": {
26
"USD": 19.00
27
}
28
}
29
}
30
]
31
});
32
fastspring.builder.checkout();
33
}
34
</script>
35
36
<!--
37
DEMO SETUP
38
- Initialize the Store Builder Library
39
-->
40
<script
41
id="fsc-api"
42
src="https://sbl.onfastspring.com/sbl/1.0.2/fastspring-builder.min.js"
43
type="text/javascript"
44
data-storefront="fastspringexamples.test.onfastspring.com/popup-fastspringexamples"
45
data-access-key="F27MS9SST4W3UHRNBE1ISA">
46
</script>
1
1
1
1