Using Zygodact key generator with FASTSPRING

This document describes the steps how to build a remote license generator with LiveCode server and Zygodact to use with FASTSPRING.

This document does not describe the basic setup steps for the FASTSPRING seller account nor the steps how to add a product to your FASTSPRING seller account.

1. Requirements

You need

  1. A cgi key generator stack gen.rev, created with Zygodact Key Generator
  2. A hosting account with LiveCodeServer commercial. The community edition of LiveCodeServer does not work with Zygodact.
  3. A FASTSPRING seller account
  4. At least one product in the FASTSPRING seller account.

2. Adding the fullfilment action

In your FASTSPRING account under Products and Pages  open your product and click on Add under Fulfillment Actions

3. Choose Fulfillment Action

  1. Select Generate a License
  2. Select Remote Server Request
  3. Click Next

4. Configure Remote License - General

  1. Enter the URL to your license script.
  2. Select HTTP POST (recommended)
  3. Select UTF-8
  4. Select Single License Only
  5. press Create

5. Configure Remote License - Security

  1. Copy your Private Key. You will need it for your LivecodeServerScript.


Note: Please do not use the private key from the image below. This is just a sample. Your private key looks different.

Please don´t publish your private key!

6. Configure Remote License - Parameters

  1. Select the value Email Address for the parameter name, because i am using the customers email address for creating the license key in my sample script.
  2. Click Save

7. The script as an image

Copy the cgi stack "gen.rev" and your LiveCodeServer script onto your webserver.

Please take care that the storage path matches the URL you´ve entered in the FASTSPRING for the Remote License.


8. The Script as text (you can copy it)

global gname, gserial
-- Check if your script is called from FASTPRING, you will need your private key, which you copied from your FASTSPRING account.
put "" into  tConcatenate
put "YourFastspringPrivateKeyGoesHere" into tPrivateKey
put the keys of $_post into tList
sort tList ascending
filter tlist without "security_request_hash*"
repeat for each line tLine in tList
	put $_post[tLine] after tConcatenate
end repeat
put tPrivateKey after tConcatenate
put md5Digest(tConcatenate) into tDigest
get binarydecode("H*",tDigest,myHash)
if myHash is not $_post["security_request_hash"]
	put "unauthorized call"
	exit to top 
end if	
-- check end-- I use the customers email as registration name,
-- because the email address does not contain any foreign characters like characters with accents
put $_post["email"] into gName
-- now start the keygen stack. The stacks uses the global gName and creates the appropriate license key for it
start using stack "gen.rev"
if gSerial = "" then put "There was an error creating the license key" into gSerial
put gSerial

9. A simple Test in your browser

1. Open the URL to your script in your web browser

2. You should just see a "unauthorized call"

10. Test the Script from your FASTSPRING account

1. Click Run Test

11. Test result

  1. If the test is successful then you can see a license key under Licenses Captured.


If you see unauthorized call instead of a license key, then that would mean, that your script is using the wrong private key or there is an error in the script part which is responsible for the security check.

If you see a LiveCodeServer error, then there is some error in the script.


12. The script is working. That´s it, isn´t it?

Yes and No.

Yes, the remote license web service is working now.


And No.

To get an email with the license key sent to the customer you need to add a 2nd Fullfilment action.

  1. This time select Send Email / Show Web Notification.
  2. Click Next

13. Configure Email and Web Notification


On this Webpage you can now edit the email and web page delivery notification. You can even create multilingual notifications.


  1. Edit the template for plain text emails. See Sample License Delivery Email Template for more information
  2. Edit the template for html emails (optional). See HTML Email Content for more information
  3. Edit the template for the template for the web delivery (optional)
  4. Edit the phrases for multilanguage emails (optional). In my example i am using Template Code Logic for translations. See Translating Notification Emails for more information
  5. Edit some advanced options (optional)
  6. Click Save



14. That´s it!

You´re done.

Happy selling!


Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.