LimeLM + FastSpring Product Structure

Hi, I am trying to integrate LimeLM and Fastspring into my app, but I'm struggling with how to structure all I need.

My intent is to offer a free version of the app onto which can be added one of two licences, in-app.

1. A timed trial (e.g. for 30 days)2. A full licence

Both 1 & 2 would require an online registration/payment for which I would use FastSpring. The timed trial would have a 100% discount applied to it.

In my understanding LimeLM would have to be configured as one Product with one Version with Custom Fields for the trial or full license. FastSpring would send to LimeLM one of 2 products, one a 100% discounted product, the other a fully priced product.

What I don't understand is how to:1. Link the FastSpring products to the LimeLM products via PHP code - I assume it is via the optional arrays in the PHP - but what names/values should be used?2. Add custom fields for a timed trial. The dates seem to have to be manually generated for the date field option in the Custom Fields. How would you create a 30 day trial?

Grateful for your assistance.

1. Link the FastSpring products to the LimeLM products via PHP code - I assume it is via the optional arrays in the PHP - but what names/values should be used?

Well, it depends on how you want to do things. You'll obviously use our article and example code to get you most of the way there.

2. Add custom fields for a timed trial. The dates seem to have to be manually generated for the date field option in the Custom Fields. How would you create a 30 day trial?

Well, using PHP you can set the date to whenever you want. For example:

[///TODO: Use any feature values here$feature_names = array('update_expires');$feature_values = array(date('Y-m-d', strtotime('+30 days')));

Tell me if that helps.

Thanks for the reply. The PHP code works and helped me to understand.

For the references of others with this problem this is what I ended up doing:

On FastSpring I created 2 products (one for full license, one for trial license). Both used the PHP code to populate 4 Custom Fields (Full_License, Trial_License, Trial_Expiry, email).

The Trial License product also used a Coupon code to discount the package value by 100% so that it could be offered for free. (FastSpring doesn't allow free products).

On LimeLM I created 1 product with 1 version and with the same 4 custom fields. I can now extract the content of the custom fields within the app.

One small potential pitfall of this method is that the app now needs to compare the Trial_Expiry date with a system date (or web time server) to check its validity, rather than using the timed trial functionality of LimeLM. Extracting the date from the custom field generated by FastSpring requires building a custom date parsing function, as it is unlikely that the format you have chosen in the PHP script will be the same as the user selected format on the users machine.

Otherwise the system seems to function fine.

The Trial License product also used a Coupon code to discount the package value by 100% so that it could be offered for free. (FastSpring doesn't allow free products).

You could just offer it on your website directly.