Jump to content
Mark

IP.Nexus 1.2 Dev Update: License Keys

IP.Nexus 1.1 was released at the beginning of this month bringing a number of new features such as product options, reporting tools, advertisement system improvements and more.
Already we have started work on IP.Nexus 1.2 - while release is still a while away, we'll be posting blog entries during development to show you the upcoming new features.


The first new feature in IP.Nexus 1.2 that we wanted to talk about is a license key system.
Many users are using IP.Nexus to sell digital products, and currently there is no way to keep track of where your products are being used. In IP.Nexus 1.2, you will have the ability to generate license keys and use an API to call back to Nexus to activate and check license keys.


Generating License Keys

When creating a product, there are now a number of options regarding how to handle license keys:


License keys are by default generated either as a random md5 hash or several blocks of random letters and numbers - developers can also upload a simple PHP file to a certain folder to add more methods if you have your own way of generating license keys.

You can also choose an "identifier" for the license keys. Identifiers are provided to the API when activating the license key (for example, your program could ask users for their license key and their name or Email address) - as an additional security measure. Identifiers can be the customer's name, Email address or any custom field with the purchase. This is of course optional.


Managing License Keys

In the Admin CP, there is a new box on the purchase screen which displays information about the license key:



The grey box shows you the license key, when it was generated and it's current status and the table below shows where it's being used (you can set how many times a license key can be used).

The dropdown menu at the top with the other buttons contains options to reset (which will clear uses and generate a new key) or cancel (which will make API calls to check the license key fail) the key.

Of course, all actions related to license keys is also logged in the customer history page.


Users can see their license keys in the client area:



Using the API

The API uses XML-RPC to send and retrieve data. Full developer documentation will be available when Nexus 1.2 is released, but to give you an overview, there are four methods:

activate
This is what you call when the user enters their license key, for example, on an installation screen. You send Nexus the license key, the identifier (if necessary) and any additional information you want to save (for example, the version number). If the license key is invalid, or the key has already been used the maximum number of times, Nexus will return an error - otherwise, Nexus will log the IP address used to activate and the additional information you sent and return a success message along with the "usage id" which is an ID number given to that installation for that license key.

check
This is used to check that a license key is still valid, for example, you may call this periodically from your application. You send Nexus the license key, the identifier and the usage ID (returned from the activate method) and Nexus will return the status of the license key (if it's active or cancelled).

info
This is used to fetch information about a license key. You send Nexus the license key and the identifier and Nexus returns data about the key (when it was generated, how many times it's been used, etc.) the purchase associated with it (it's ID number, when it expires, all custom fields, etc.) and information about any child purchases (that is, purchases associated with the purchase the license key is associated with.

updateExtra
This is used to update the additional information send in the activate method. You send Nexus the license key, the identifier, usage ID and new information and Nexus will update the information locally and return a success message.


×
×
  • Create New...