Ability to work with license keys

2 replies [Last post]
Dean
Offline
Joined: 01/15/2010
Status: 
Answered

 An example would be that the store owner has .exe files zipped up and in order for the customer to  install the product they need to purchase a license key.

Example, customer pruchases a product, once payment is received the system will send out an email and also store the license key in the current orders.

when ever a payment is received the system will automatically assign a user a license key which cannot be re-used. all new orders throughout your still will be assigned to a new license key and so forth.

The admin would have the ability to upload lists of license keys and assign them to a product.

Suggestions ?

Leighton Whiting
Offline
Joined: 06/02/2009
Dean, I think this would be

Dean,
I think this would be better served as a separate module from File Downloads Suite. My modules provide hooks that you could use to send the license key to the user from a list that you have created. It would be simple to make. Here is an example:

  1. // Implementation of hook_process_ipn()
  2. function yourmodule_process_ipn($type, $ipn, $customVars) {
  3.   if ($type == 'paypal file') {
  4.     if ($customVars['uid']) {
  5.       $account = user_load($customVars['uid']);
  6.     }
  7.     else {
  8.       $account = user_load(array('mail' => $customVars['mail']));
  9.     }
  10.     // Retrieve your code from your database,
  11.     // or however you have it stored, and send it in an email
  12.     // Then mark that license key as being used
  13.   }
  14. }

That is the hook function you would need. Now you would just need to make a database table to store your license keys, and a page where you can enter new keys, and you are done!

Good Luck!

Sincerely,
Leighton Whiting

pablogy
Offline
Joined: 02/01/2010
Adding feature to MS

Is it possible to impliment this feature in MS modules for those of us who are not able to do this.

I like the idea of sending a key for product sold.

Twitter Feed