<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
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.