Giter Club home page Giter Club logo

softwarelicensemanager's Introduction

Want to sell desktop software (e.g. DotNet C# winform) and activate it via a key, this is how I did it for free.

Use Woocommerce to sell license and enable your WordPress setup to act as a validator API (service) with endpoints that will let you activate, validate and deactivate license keys via HTTP requests; this is a C# solutions to integrate the API within your desktop products.

Reverse Engineer of licensing in Wordpress/WooCommerce

Required Infrastructure

  1. Store

  2. Enable license key fields in product

  3. Software License Management (SLM) and Enable license key auto generation with notification on purchase

  4. REST API for desktop application


1. Store : Wordpress and WooCommerce

Install Wordpress Plugin: 'woocommerce' enables eCommerce Store

2. Field: Enable license key fields in product

Install Wordpress Plugin: 'WooCommerce License Keys' Version 1.0.11 By 10 Quality Enables "License Keys" with WooCommerce field in products.

3. Manage: Software licence manager dashboard

https://www.tipsandtricks-hq.com/software-license-manager-plugin-for-wordpress

Install Wordpress Plugin: Software License Manager Version 4.0 | By Tips and Tricks HQ - Dashboard

Install Wordpress Plugin: Software licence manager plugin Version 1.0 | By Aaron Bowie (We are AG) - Auto gen license

This is an updated version of Woocommerce Software License Manager By Omid Shamlu to work with the latest WooCommerce (3.0+) Features

Automatically creates license keys for each sale with WC Licensing is optional and can be activated/deactivated individually send generated license keys to your customers within your existing email notifications


Application code to query store: REST API / WebClient to check json query to woocommerce

Port of License Keys API client used to activate, validate and deactivate license keys from https://github.com/10quality/license-keys-php-client/blob/v1.0/src/Client.php

  LicenseResponse License = new LicenseResponse();

            using (WebClient client = new WebClient())
            {
                var response = client.UploadValues(txtLicenseServer.Text, new NameValueCollection()
                {
                    { "secret_key", txtKeyQuery.Text},
                    { "slm_action", "slm_check" },
                    { "license_key" , txtMyLicense.Text }
                });

                string result = System.Text.Encoding.UTF8.GetString(response);
                License = FromJson(result);
            }
	    
	    if (License != null)
            {
                lblResponse.Text = $"Result: {License.result} | Message: {License.message} | Key: {License.key}";

                txtFirstName.Text = License.first_name;
                txtLastName.Text = License.last_name;
                txtEmail.Text = License.email;
                txtCompany.Text = License.company_name;
                txtTransId.Text = License.txn_id;
                txtAllowedInstalls.Text = License.max_allowed_domains;

                txtProductref.Text = License.product_ref;

                listActivations.Items.Clear();

                foreach (RegDomains domain in License.registered_domains)
                {
                    listActivations.Items.Add(new ListViewItem(new string[] {
                        domain.id,
                        domain.registered_domain,
                        domain.item_reference,
                    }));

                    txtItem.Text = domain.item_reference;

                }

                listActivations.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
                listActivations.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
                listActivations.Refresh();
            }
            else
            {
                lblResponse.Text = "No Response?";
            }

        }
	    

Other Implementations

MVC

https://github.com/10quality/wpmvc-addon-license-key

It is confusing on how to enable software licensing, it is hidden in the free architecture, cannot work out what to buy...

https://www.tipsandtricks-hq.com/ecommerce/integrate-wp-estore-with-software-license-manager-plugin-3731

softwarelicensemanager's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.