Fastsprint PHP Script

Hi,

We have used the PHP script with Fastspring and it is working fine. The one question is how to make it so that the user will get one key that is good for 2 activations when the order goes through? The default is 1 key 1 activation and I can't see how to change that.

Paul DembowskiLiberty Street Software

Hey Paul,

If you look at the top of the FastSpring PHP script you'll see the following:

$post_data = array(    'method' => 'limelm.pkey.generate',    'version_id' => $version_id,    'num_keys' => 1,    'num_acts' => $quantity,    'email' => $email,    'api_key' => $api_key,    'nojsoncallback' => 1,    'format' => 'json');

So if you want to generate 2 activations for every order, you can change the "num_acts" line to the following:

'num_acts' => $quantity * 2,

Does that make sense?

Yes that fixes the problem, thanks.

One related question. We also setup the PayPal scripts for delivery of the license codes. They are also working fine but need to know how to setup the 1 key - 2 activations there as well. Have looked through the PaymentSettings.php and payment.php scripts and don't see exactly where the change should occur. Thanks in advance.

In the PaymentSettings.php file you'll see a "SendPKeys()" function, in which there will be the following line:

$xml = new SimpleXMLElement(LimeLM::GeneratePKeys($LimeLM_VersionID, 1, $quantity, $email));

To generate 2 activations for every 1 product key, then modify it like this:

$xml = new SimpleXMLElement(LimeLM::GeneratePKeys($LimeLM_VersionID, 1, $quantity * 2, $email));