This was more of a POC for me, but I dont like wasting code. I re-wrote the PHP license check example as an Adobe Flex library for used in Air or Flash projects. If you don't know what AS3 is you probably don't need this.
Here is the download link to
whmcsLicense.swc
AS3 Example
import net.mthosting.WhmcsLicense;
var test:WhmcsLicense = new WhmcsLicense("WHMCSURL","SecretKey","IP","DOMAIN","DIRECTORY");
var localkey:String = "";
test.check_license(CallBackFunction,"LicenseKey", localkey);
public function licCheck():void
{//this is the call back function after we have our results.
trace(test.results.toString());
}
There are a couple of differences between the PHP example and this. The off-line keys are not compatible with each other. This code uses epoch for time comparison. Also, the results are returned as XML and not an associative array.