Select Page
Methods Documentation
Edit on
Codepen.io

fastspring.builder.authenticate(securePayload, secureKey)

Takes secure payload (encrypted or plain text, depending on the storefront state) and secure key as input and if payload contains customer id redirects customer to the account/subscription management page.


x
36
 
1
<!--
2
    DEMO INFO
3
    fastspring.builder.authenticate() accepts a json object containing the customer
4
    account id and the current epoch timestamp in milliseconds.  When making this call,
5
    the customer will be redirected to the account portal.
6
7
    Note: This demo will not work in the code pen style since iframes are blocked.
8
    Click the [+] at the top of the page to see this work outside of the pen.
9
-->
10
<button onclick="pushToFastSpring();">Recognize Buyer and Checkout</button>
11
12
<!--
13
    Custom function to make the fastspring.builder.authenticate() call
14
-->
15
<script type="text/javascript">
16
    function pushToFastSpring() {
17
        fastspring.builder.authenticate(
18
            {
19
                "account":"bZS1Rwf2ReyFP0DuiAzxIw",
20
                "timestamp": 1570025899000
21
            }
22
        );
23
    }
24
</script>
25
26
<!--
27
    DEMO SETUP
28
        - Initialize the Store Builder Library
29
-->
30
<script
31
    id="fsc-api"
32
    src="https://sbl.onfastspring.com/sbl/1.0.2/fastspring-builder.min.js"
33
    type="text/javascript"
34
    data-storefront="fastspringexamples.test.onfastspring.com/popup-fastspringexamples"
35
    data-access-key="F27MS9SST4W3UHRNBE1ISA">
36
</script>
1
 
1
1
 
1

Related Topics