Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

An example WinForms projects to show how to use the C# Library for the License Manager for WooCommerce.

License

Notifications You must be signed in to change notification settings

g4m3r0/LicenseManager-for-WooCommerce-.Net-Library-Example

Repository files navigation

The example of the latest version (> 2.0.0) are now inside the main repository located at https://github.com/g4m3r0/LicenseManager-for-WooCommerce-.Net-Library

LicenseManager for WooCommerce .Net Library WinForms Example

An example WinForms projects to show how to use the C# Library for the License Manager for WooCommerce. The C# Library is avialable here: LicenseManager for WooCommerce .Net Library.

Minimal usage example

// Create a license manager (WordPress Host URL, Consumer API Key, Consumer API Secret)
var licenseManager = new("http://domain.com", "ck_3e68d6156f48ddb61b1748ca548f632b1d19d446", "cs_6a74509a3c4127bf19340ef873fd9349eca07g78");

// Activate a license key (this will increase the TimesActivated counter if successful)
var (success, errorMessage) = await _licenseManager.ActivateLicenseAsync(licenseKey, productId);

MessageBox.Show(success
                ? $"License {licenseKey} was successfully activated for product {productId}."
                : $"Something went wrong: {errorMessage}");
                
// Check if a license key is valid for a specific product
var (success, errorMessage) = await _licenseManager.ValidateLicenseAsync(licenseKey, productId);

MessageBox.Show(success
                ? $"License {licenseKey} was successfully validated for product {productId}."
                : $"Something went wrong: {errorMessage}");

Contributors

Made with contrib.rocks.

About

An example WinForms projects to show how to use the C# Library for the License Manager for WooCommerce.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages