fastspring sbl

by Craig Haywood

HTML

<h2>To Complete A Purchase</h2>
<p>You can use any date in the future for the card expiration date, and you can use any values for other purchase data such as your name, so long as you used the test card numbers shown below.</p>
<ul>
    <li>Card Number: 4242 4242 4242 4242</li>
    <li>CVV Code: *E4FP</li>
</ul>

<!--
    Configure an add button to add an item to the cart.
-->
<button onclick=" pushToFastSpring();">Checkout</button>

<!--
    DEMO EFFECTS
        - The below div will be updated to include the returned data from the data-popup-webhook-received
-->
<br /><br /> <div id="log2"></div>
<br /><br />Data returned: <div id="log"></div>
<br /><br /> <div id="log3"></div>


<!--
    DEMO SETUP
        - Initialize the Store Builder Library
-->
<script
    id="fsc-api"
    src="https://sbl.onfastspring.com/sbl/0.8.6/fastspring-builder.min.js"
    type="text/javascript"
    data-storefront="fastspringexamples.test.onfastspring.com/popup-fastspringexamples"
    data-popup-webhook-received="dataPopupWebhookReceived"
    data-popup-closed="dataPopupClosed"
    data-continuous="true">
</script>

<script type="text/javascript">
	function pushToFastSpring() {
		fastspring.builder.recognize(
			{
				"email":"[email protected]",
				"firstName":"Bruce",
				"lastName":"Baxter"
			}
		);
    		fastspring.builder.reset;
    		fastspring.builder.add('phot-io-main-app');
        fastspring.builder.checkout();
        window.productbought = false;
	}
</script>
<script>
    function dataPopupClosed(data) {
       if (window.productbought == true) { 
    if (window.productbought2 == "phot-io-main-apptest")
    location.replace("https://www.w3schools.com");
  else
   location.replace("https://www.easycash4ads.com");
}       
      }
</script>
<!--
    Initialize the cart for demo purposes
-->


<!--
    dataPopupWebhookReceived
        - In this example, it will write div with the id log with the returned data.
-->
<script>
    function...

CSS

*E4FP