Keygen+FastSpring

Checkout with FastSpring, licensing with Keygen

In this example, we'll be working with a Node.js app that integrates Keygen and FastSpring together using a Popup Storefront embed. FastSpring is a popular way to get a checkout page up with minimal effort so that you can start selling your product.

This integration uses FastSpring to accept a one-time payment and generates a license key for the customer after a successful checkout. After purchase, the customer will be redirected to a success page which contains their license key which they can input inside of your product.

index.html

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Purchase Software</title>
  </head>
  <body>
    <h1>FastSpring Example</h1>
    <a href="#" data-fsc-item-path-value="example-product" data-fsc-action="Reset,Add,Checkout">
      Buy Now
    </a>
    <script>
      function onFSPopupClosed(order) {
        if (order.id) {
          window.location.replace("/success?orderId=" + order.id)
        }
      }
    </script>
    <!-- Replace this FastSpring Pop-up Storefront embed code with your own -->
    <script id="fsc-api" src="https://d1f8f9xcsvx3ha.cloudfront.net/sbl/0.7.4/fastspring-builder.min.js" type="text/javascript" data-popup-closed="onFSPopupClosed" data-storefront="keygen.test.onfastspring.com/popup-fastspring-example"></script>
  </body>
</html>