This commit is contained in:
2020-07-10 17:33:24 +00:00
parent bb8714ba4a
commit cdd0706881
2 changed files with 29 additions and 37 deletions

View File

@@ -460,6 +460,22 @@ oArP0E2Vbow3JMxq/oeXmHbrLMLQfYyXwFmciLFigOtkd45bfHdrbA==
public static string GetRavenTestKey(string dbid)
{
//Build a sample test key, sign it and return it
AyaNovaLicenseKey k = new AyaNovaLicenseKey();
k.LicenseFormat = "8";
k.RegisteredTo = "GZ TestCo Inc.";
k.DbId = dbid;
k.Features.Add(new LicenseFeature() { Feature = ACCOUNTING_FEATURE_NAME, Count = 0 });
k.Features.Add(new LicenseFeature() { Feature = SERVICE_TECHS_FEATURE_NAME, Count = 1000 });
k.MaintenanceExpiration = k.LicenseExpiration = DateTime.UtcNow.AddMonths(1);
k.Features.Add(new LicenseFeature() { Feature = TRIAL_FEATURE_NAME, Count = 0 });
k.Features.Add(new LicenseFeature() { Feature = RENTAL_FEATURE_NAME, Count = 0 });
return GenerateRavenKey(k);
}
//eoc
}
//eons
@@ -472,39 +488,4 @@ oArP0E2Vbow3JMxq/oeXmHbrLMLQfYyXwFmciLFigOtkd45bfHdrbA==
// public static string GetRavenTestKey(Guid dbid)
// {
// //Build a sample test key, sign it and return it
// AyaNovaLicenseKey k = new AyaNovaLicenseKey();
// k.LicenseFormat = "8";
// var vv = Math.Truncate((DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds);
// string sId = vv.ToString();
// if (sId.Contains(","))
// sId = sId.Split('.')[0];
// k.Id = $"00-{sId}";
// k.RegisteredTo = "Best Besterson Inc.";
// k.DbId = dbid;
// //add accounting and user features either way
// k.Features.Add(new LicenseFeature() { Feature = ACCOUNTING_FEATURE_NAME, Count = 0 });
// k.Features.Add(new LicenseFeature() { Feature = SERVICE_TECHS_FEATURE_NAME, Count = 1000 });
// //fake trial key or fake licensed key
// if (dbid == TEST_TRIAL_KEY_DBID)
// {
// k.MaintenanceExpiration = k.LicenseExpiration = DateTime.UtcNow.AddMonths(1);
// k.Features.Add(new LicenseFeature() { Feature = TRIAL_FEATURE_NAME, Count = 0 });
// }
// else
// {
// k.MaintenanceExpiration = DateTime.UtcNow.AddYears(1);
// k.LicenseExpiration = DateUtil.EmptyDateValue;//1/1/5555 as per spec
// }
// return genKey(k);
// }
// #endregion