Ok got it, I manage this situation using the custom field, but I need a little help if is possible. The license that my customer buy through FastSpring is generated with your php script, now each license have a duration of 1 year, what I need to do is set as custom field the expiration day, for now I did:
<?php//TODO: set your API key found in http://wyday.com/limelm/settings/$api_key = 'MY KEY';
//TODO: set the version id to generate & find keys for// the version id is found in the url. For example http://wyday.com/limelm/version/100/// the version id is 100.$version_id = '4877';
//custom fields$feature_names = array('customer_email', 'license_renew');$feature_values = array($email, "????????");
$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');
if ($feature_names !== null){ $post_data['feature_name'] = $feature_names; $post_data['feature_value'] = $feature_values;}
// urlencode $post_data$post_string = '';foreach ($post_data as $key => $value){ if (is_array($value)) { foreach ($value as $sub_value) { $post_string .= $key.'[]='.urlencode($sub_value).'&'; } } else $post_string .= $key.'='.urlencode($value).'&';}
$post_string = rtrim($post_string, '& ');
$request = curl_init('https://wyday.com/limelm/api/rest/');curl_setopt($request, CURLOPT_HEADER, 0);curl_setopt($request, CURLOPT_ENCODING, "");curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);curl_setopt($request, CURLOPT_POSTFIELDS, $post_string);curl_setopt($request, CURLOPT_SSL_VERIFYPEER, TRUE);
try{ $jObj = json_decode(curl_exec($request));
if ($jObj->stat == 'ok') { foreach ($jObj->pkeys->pkey as $pkey) { echo $pkey->key."\r\n"; } } else { // Uncomment the next line to see the error LimeLM is giving you. //echo $jObj->message; }}catch (Exception $e){ // Uncomment the next line to see the exception. //echo 'Failure: '.$e->getMessage();}?>
as you can see in the license_renew field I need to set the expiration date, which is exactly one year from the day of purchase. FastSpring have a variable for this or I need to call some php function to calculate the next year?
And, last question: how can I check if the software license is expired with Ta?
Thanks for any help.