Skip to content
A .NET standard client for the Software License Manager WordPress Plugin (https://wordpress.org/plugins/software-license-manager/)
C#
Branch: master
Clone or download
Latest commit f584f85 Nov 29, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Tests/WPLMNETClient.NetFramework.Tests 1.0.1 Nov 29, 2019
src
.gitignore Update .gitignore Nov 29, 2019
LICENSE Initial commit Oct 25, 2019
README.md Update README.md Nov 29, 2019
WPLMNETClient.sln a Nov 10, 2019

README.md

NuGet

WordPressLicenseManagerNETClient

A .NET standard client for Software License Manager (https://wordpress.org/plugins/software-license-manager/)

NuGet

Install-Package WPLMNETClient

Examples

Actions

Four actions are available. You can create a new license, activate/deactivate a pending license or check the meta data of a license.

Configuration class

The configuration class is where you stored the credentials required. The secret key is only required to create a new license. The activation key is required to complete the other actions.

Sample

This sample shows how to activate a pending license. Deactivation and creation of license is very similar to this example.

       Configuration configuration = default(Configuration);
       ILicenseManager licenseManager = default(ILicenseManager);
       License license = default(License);
       public void Main()
       {
           // create configuration object
           configuration = new Configuration();
           configuration.PostURL = "http://chucknorris.co";
           configuration.ActivationKey = "abc";
           configuration.SecretKey = "123";
           // create license manager
           licenseManager = LicenseManagerFactory.New(configuration);
           // create license object 
           license = new License();
           license.Email = "charles@chucknorris.co";
           license.Key = "password123";
           license.FirstName = "Chuck";
           license.LastName = "Norris";
           license.CompanyName = "Chuck Norris Unlimited Liability Co";
           license.MaximumDomainAllowed = 1;
       
           ActivateLicenseKey();
       }


       
       public void ActivateLicenseKey()
       {
           var licenseResponse = licenseManager.PerformAction(WordPressLicenseManagerNETClient.Consts.Action.Activate, license);
           if (licenseResponse.Success == false)
               throw new Exception(licenseResponse.Message);
           else
               Assert.IsTrue(licenseResponse.Success);
       }
You can’t perform that action at this time.