License Keys

Contrib type: 
Module
Status: 
Complete and working

Downloads

Latest version: 
1.1
Compatibility: 
Ubercart 1.x

The License Keys module allows a user to sell license keys along side an Ubercart Products. The most obvious application for license keys is for software products that need a license key for registration. Store Admins can import (and export) license keys by entering a list of keys in a text area and selecting the product SKU to associate with the keys. When a customer submits an order, a set number of license keys (based on qty of product purchased) are reserved for an order. Upon completion of order the license keys are mailed out to the customer. Additionally, volume discounts can be placed on products. Admins enter a qty range and a percentage to discount on the order. Customer will see the volume discount line item before they complete their order. Admins can view customer reports displaying how many keys have been purchased by each customer at Administer › Store administration › Reports > License keys reports.


PreviewAttachmentSize
uc_license_keys.tar.gz6.26 KB
mccool's picture
Offline
Joined: 12/10/2007
Juice: 33
possible problem?

Hi there.
Great contribution. Could be just what I'm looking for.
Should it email the licence key automatically when the order completes?
Currently I am assigning keys to a product SKU, and make a purchase of that SKU, but the license key is not assigned, nor emailed.
I can then assign it manually, and email it manually, but I assume this should be automated, no?
Any ideas would be greatly appreciated.

lgammo@drupal.org's picture
Offline
Joined: 08/13/2008
Juice: 4
Automatic generation of license keys

Hello,

I wrote a small add-on to the license key module. This add-on adds a tab that allows you to automatically generate any number of license keys of the size (in characters) you want. My key generation algorithm is very simple, but I think is sufficient.

If anyone is interested I can upload it to this site.

By the way, the original license key module had very long tab titles, so I modified my local copy to say: List, Edit, Email, Import instead of the original titles. Maybe the owner of the license keys module will take this into account in the next release of his great module.

Thank you,

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15459
Re: Automatic generation of license keys

I'm not sure the original author is gonna be around for further updates, so if you wanna package up your version as a 1.1 release or something, I can make you the author of the contrib so you can add it to the file attachments. At the very least, feel free to add it in a comment and maybe PM Shawn to see what he thinks. Smiling

lgammo@drupal.org's picture
Offline
Joined: 08/13/2008
Juice: 4
Ownership of the license keys module

Hello,

You mean own the original license key module? Sure I can do that for a while if no one objects. Eye-wink

I will need to figure out how the packaging works, and I would like someone to make a code review on my code to make sure all it safe and sound. Eye-wink

l.

bvlaar's picture
Offline
Joined: 07/09/2008
Juice: 75
auto

Hey guys, love the module here!
Just wondering if there is anyway to setup this module to automatically email the key associated with the order id and SKU?
Thanks

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4111
Re: auto

+1 for adding this feature in if it's not already.

Your other option would be to create a new theme function that overrides the current theme_uc_file_downloads_token function. You can add to this the license keys for each product, when the links are generated and emailed to the customer.

--
Help directly fund development: Donate via PayPal!

TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3292
Quote:+1 for adding this
Quote:

+1 for adding this feature in if it's not already.

It's there, triggered off the order status change in hook_order. I suspect the guy who's having trouble isn't set up to have his orders moved to "Completed" automatically.

<tr>.
torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4111
Re: Quote:+1 for adding this

Sweet, I don't have a need for the module so I don't have any experience with it.

--
Help directly fund development: Donate via PayPal!

bvlaar's picture
Offline
Joined: 07/09/2008
Juice: 75
still

I have the auto email set to "payment received" I bought stuff off my own site with these changes and still didn't get the cdkey in the email.
I need some help with this haha
Thanks

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4111
Re: still

When you complete a purchase, does the status of the order go to Payment Received, or to Completed?

--
Help directly fund development: Donate via PayPal!

bvlaar's picture
Offline
Joined: 07/09/2008
Juice: 75
recieved

It goes to payment received. But I went into the license keys notification settings I selected Payment received in the order statues drop down menu. Or does it need to be completed? If so, how do I make all my transactions automatically goto completed?
Thanks

bvlaar's picture
Offline
Joined: 07/09/2008
Juice: 75
anyone?

hey anyone here got any ideas? I really wanna use this module to it's full potential
Thanks

bvlaar's picture
Offline
Joined: 07/09/2008
Juice: 75
I think I may have figured it out

For some reason early on in using this module I went to "email license keys" in the license key module and loaded orders manually. Above it says
"This form will email a notification to the customer regarding any license key(s) their order may have had. If you have not specified an order number select one from the select box below."

So should I delete all those in the drop down? (how do I do that)
OR
Am I doing it wrong, could someone PM me that could help me out please! I'll pay you a little money too

schnizaare's picture
Offline
Joined: 10/25/2008
Juice: 4
Ditto

I also can't seem to get the license keys to show up anywhere for the customer. Not on the order email, or on the confirmation screen upon completing the order. The only way I can communicate the license keys to the customer is through the License Keys administration screen. And that is entirely manual. Help would very much be appreciated! Thanks.

sherifmayika's picture
Offline
Joined: 11/03/2008
Juice: 4
I am interested

Please upload.

sherifmayika's picture
Offline
Joined: 11/03/2008
Juice: 4
Software activation

I have small software that I want ot integrate with Ubercart, Besides the acivations keys emailed when a user purchases the software I want the software to be activated using my website, because I want the software one kye used by only one user.

I have the desktop application built in C++ which allows the user the give Username, password and key. and http:post request will be sent to the website URL, if logins and status is fine return something, then software gets activated,

I did see the remot admin modules for Drupal, But dont how to use those modules with Ubercart

Can any one give me an idea on this,

Thnks in advance

sherif

iswilson's picture
Offline
Joined: 11/21/2007
Juice: 15
Re: License Keys

I also had trouble getting this working at first. I discovered that if you are using paypal website payments standard as the payment method the section of code in uc_license_keys_order that attaches the license keys to an order never gets called (it is supposed to run when the submit button is pressed on the summary page). I am pretty sure it is an ubercart issue and not specific to this module.

Normal payment methods (ones that don't submit forms to external sites) work fine.

Attached is a patch for the uc_license_keys_order function. The code is almost identical but I shuffled things around a bit so that it all gets executed when the order status gets updated to whatever was selected in /admin/store/settings/notify/edit/license_keys.

Not running this on a live site yet but the patch has been tested successfully with paypal sandbox and the test cc gateway module.

AttachmentSize
uc_license_keys.module.patch 4.66 KB
blaze's picture
Offline
Joined: 03/19/2009
Juice: 22
Using a Checkout Field for Notification

OK, this is my scenario. I want the user to enter an email address in which they want to receive the license key. There is an attribute for the product called "email". I want to send the license key to that "email" address entered as an attribute. How can I do this?

Mike Wolden's picture
Offline
Joined: 08/10/2009
Juice: 9
Fantastic

Great job folks.
However I have a multi-line license key, which includes data relating to purchase date, so precalculated keys are a no go.
Is there any way there can be a function called which creates a license key on the spot, passing the order details of which product was purchased, including attributes and options selected?

Working on the ubercart 2.0 release using Drupal 6 (yay).

Mike

deang's picture
Offline
Joined: 08/25/2009
Juice: 13
Hi Guys, Im using the

Hi Guys,

Im using the UC_License_keys and would like to know if theres anyone out there thats tried to add the license key to a users order history for quick referencing, which in turn can be seen via 'My Account'

If no ones done so, then email or pm me if you want to earn a few $dollars

Thanks in advance.

jeremdow's picture
Offline
Joined: 08/03/2009
Juice: 4
Multiple products with keys on same order

Hi,

Not sure if anyone else noticed this - didn't see anything in the comments - but as is this module supports ordering any quantity of the same key, but not multiple products with different keys on the same order. I don't know if this is a bug or by design, but I needed it for my site - so wanted to upload my one line patch to make it work.

So that it will loop and add keys for any number of products, second check query in the submit case in uc_license_keys_order should check for used keys with the same order_id and the same model, not just the order_id.

The email section would need some work to present this better, but otherwise solves the issue for me.

AttachmentSize
uc_license_keys.module.patch 915 bytes
wigle's picture
Offline
Joined: 10/01/2009
Juice: 73
Re: License Keys

Any working version for Drupal 6 yet?

freixas's picture
Offline
Getting busy with the Ubercode.
Joined: 05/06/2008
Juice: 119
Ubercart Product Keys

Hello, everyone,

I've written a module called uc_product_keys for D6/UC2. The project is at http://drupal.org/project/uc_product_keys (the dev release may not be available till tomorrow).

This is not a port of the existing uc_license_keys. I looked over the list of notes here and added support for most of the things people mentioned.

The module is in alpha and I need people willing to help test it out. I've found that the Drupal community tends to catch a lot of the boundary cases that I miss.

For what it's worth, I also helped write the uc_addresses module. However, uc_product_keys is the first substantive module I've written from scratch. I expect to be making use of this module to sell some of my own software, so I will be highly motivated to maintain it.

Thanks in advance to anyone who helps with this effort.

freatida's picture
Offline
Joined: 10/20/2009
Juice: 108
Re: Ubercart Product Keys

hi freixas, I'm interested in your module. I tried installing it and got an error. I've filed an issue on the drupal project page.

md-2's picture
Offline
Joined: 11/04/2008
Juice: 52
hook_order 'submit' case doesn't get passed
function uc_license_keys_order($op, &$order, $arg2) {
  global $user;
      
  switch ($op) {
    case 'submit':

I've been digging around the UC license key code trying to figure out why emails are not getting sent for paid products but are getting sent for free products. After inserting some debug I've noticed that the switch case above never gets called. Instead of 'submit', 'new' is being passed and as far as I can see 'submit' never gets passed in my order process. Could this be causing a problem with the automation of email delivery?

Any help would be greatly appreciated

Thanks,
Mark

mradcliffe's picture
Offline
Joined: 05/14/2009
Juice: 5
Old news, but...

I probably should have commented on this a while ago, but I ported uc_license_keys to Drupal 6 and now maintain it on drupal.org. With an upgrade path.

bessie's picture
Offline
Joined: 11/22/2010
Juice: 8
Ubercart Product Key

Hello Mr. Freixas,

I am developing a new e-commerce website. I installed Ubercart Product Key, and I can add sequence, import keys, and associate sequence with products. Everything works very nicely.

But I have a question. Is there a easy way for selling upgrades. When we sale a software upgrade, it is different from selling a software. There are extra steps:

- Get from the customer the Product Key for upgrading
- Check entitlement
- if the customer is entitled, proceed to payment.
- Once order is completed, replace the older version license with the new license. Customers will not see any license information related to the license that has been upgraded to a new version

Thanks.

Bessie

freixas's picture
Offline
Getting busy with the Ubercode.
Joined: 05/06/2008
Juice: 119
Hi, Bessie, This answer is

Hi, Bessie,

This answer is rather late and I hope you've resolved your problems by now.

uc_product_keys will not support the process you use for software upgrades. You would have to write your own module for this.

The alternative would be to sell upgrade keys. uc_product_keys would support this. The customer would need a way to enter the upgrade key in the software package. The software could check for "entitlement" or the activation server could check. You would need to be clear on the prerequisites as the customer would have already paid for the upgrade key (in your scheme, they don't pay until you check that they are entitled).

crystal's picture
Offline
Joined: 05/04/2011
Juice: 9
where is this key license mod at?

By the way, we have a module adds license key functionality to the uc_file module.

where is this module that adds license keys at? whats the url? I look at your link and it has lots of mods?

how does this mod work and how much is it? what do I need for this mod to work?

I am looking to protect my ebooks in exe and pdf formats with an online activation website, does this mod help protect ebooks by inserting license keys in the ebooks and to have users activate it by my website?

what really is this mod about? and if its not what I described, do you know where I can get a mod or website like this?

crystal's picture
Offline
Joined: 05/04/2011
Juice: 9
how do I create the product key software? has it been made

I found out that I needed to do this? do you know how?

CONCEPTUAL MODEL
----------------

1. Create a software product.
2. Create a mechanism for generating product keys.
3. Place code in the software which prevents the software from
working without a valid product key.
4. Create a product sequence for the product.
5. Create the Ubercart product that sells the product key.
6. Tell the product to use the sequence you created.
7. If product keys are generated off-line, generate a batch of keys,
encrypt them if necessary and import them into the database.
8. User downloads software.
9. User purchases product key. If product keys are dynamically
generated, uc_product_keys will ask your code to generate the
keys and will send them to the customer. A non-dynamic key is
taken from the database. If uc_stock is used, the stock count
will be decremented.
10. User enters product key into the software and software becomes
operational.

Alternatively,

10. User enters product key and software communicates with the Web
site (using code you create). The software sends an installation
ID and the server returns an activation ID. This makes the
program operational.
11. The code can increment the activation count in the database. It
can also check for the revokation flag and avoid sending the
activatioon code.

crystal's picture
Offline
Joined: 05/04/2011
Juice: 9
how do I create the product key software? has it been made

I see that I need to do this? how do I do it?

CONCEPTUAL MODEL
----------------

1. Create a software product.
2. Create a mechanism for generating product keys.
3. Place code in the software which prevents the software from
working without a valid product key.
4. Create a product sequence for the product.
5. Create the Ubercart product that sells the product key.
6. Tell the product to use the sequence you created.
7. If product keys are generated off-line, generate a batch of keys,
encrypt them if necessary and import them into the database.
8. User downloads software.
9. User purchases product key. If product keys are dynamically
generated, uc_product_keys will ask your code to generate the
keys and will send them to the customer. A non-dynamic key is
taken from the database. If uc_stock is used, the stock count
will be decremented.
10. User enters product key into the software and software becomes
operational.

Alternatively,

10. User enters product key and software communicates with the Web
site (using code you create). The software sends an installation
ID and the server returns an activation ID. This makes the
program operational.
11. The code can increment the activation count in the database. It
can also check for the revokation flag and avoid sending the
activatioon code.