Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › Selling a digital download with a license key
Tagged: PayPal, Software License Key
- This topic has 13 replies, 7 voices, and was last updated 12 years, 4 months ago by goldstrikn.
-
AuthorPosts
-
December 1, 2010 at 9:46 pm #2308BrewsterMember
Hi
I am looking for a way to intergrate a php license key generation script into estore so that after my download is purchased the license key can be displayed on the thank you page and sent in the email.
I have already written a license generate script and was planning to use it with ejunkie, but I prefered your self hosted solution.
Any help would be much appriciated.
Joe
December 2, 2010 at 1:40 am #26976amin007ParticipantUpdate: A serial/license key selling feature has been added to the plugin. Details of this feature here:
http://www.tipsandtricks-hq.com/ecommerce/how-to-use-the-seriallicense-key-code-selling-feature-1618
If you are PHP developer (look like you are one) then this should be pretty easy.
What sort of input does your license generation script needs?
December 2, 2010 at 7:31 pm #26977BrewsterMemberMy script ideally needs the customer’s email address and a transaction id – either the paypal transaction id or the transaction id/invoice number that the plugin generates.
Thanks for your help.
Joe
December 3, 2010 at 12:24 am #26978amin007ParticipantOkay here are the two ways to do what you are after:
1) WP eStore has an option where it passes the IPN received from PayPal to another script after the post payment processing. So you can use this option to send the IPN to your license generator script which will extract the customers email address and the transaction ID and use it. After you generate a license key simply send it via email separately. This option will not require any code modification on the eStore’s side.
2) You can include your script to the “paypal.php” file (which does the post payment processing for paypal payments). Then before the email is sent out call your license generator function and pass in the email and the transaction id. I am guessing the function returns the license key. Simply add this key to the email that eStore sends out. You will need to modify the “paypal.php” file if you want to go down this path.
December 3, 2010 at 9:37 pm #26979BrewsterMemberThanks – that was a big help. I have modified paypal.php and added entries to the end of the tags and vals arrays so that I the license key that I generate can be sent in the email with the download link. I also have a switch statement that checks the constructed_products_id variable to make sure that I generate the license key for the product that requires it.
May 24, 2011 at 3:39 am #26980DThrasherMemberThis sounds like exactly what I need as well. Is there any chance you could share your modifications to paypal.php? It’d be a big help.
May 25, 2011 at 1:29 am #26981amin007ParticipantIf you tell me what kind of system you have in place to generate the serial key I should be able to give you some guidance.
May 25, 2011 at 4:09 am #26982DThrasherMemberWe’ve built a Microsoft .NET application that uses a licensing component called CryptoLicensing (http://www.ssware.com/cryptolicensing/cryptolicensing_net.htm). Since our web host for WordPress can’t run Windows web services, we pre-generate the license keys for our application in advance and store them in a text file.
When PayPal sends us the IPN, we need to read the next available key out of the file, email it to the user, and record which PayPal transaction (including user name and email address) got assigned which license key.
I’ve seen other shopping cart and e-commerce solutions do something similar. It seems like something that could be done easily in eStore’s PHP script.
(Thank you for your quick response to my question. I really appreciate your help!)
May 25, 2011 at 7:07 am #26983amin007ParticipantYou basically write a simple PHP script that does the following:
1) Implement a function called “eStore_retrieve_third_party_license_key”.
2) The signature of this function looks like the following:
function eStore_retrieve_third_party_license_key($firstname, $lastname, $email)
3) This function will read the next available key from a text file (whatever your requirement is) and return this key as the return parameter.
You can additionally do some other stuff with the customer name and email address in here.
Once you have something like the above ready then I can tell you how to use it with eStore.
November 19, 2011 at 12:33 am #26984I want to assign license keys to product downloads that I will retrieve from a database table based on the product id. I am planning to create a function to find the next available number(s) for the product and associate it with the TXN_ID via a custom table.
I would like the serial numbers to be displayed on the post-payment page and in the email.
I saw the following code in paypal.php:
//Product license key generation if using the license manager
if (function_exists('wp_lic_manager_install'))
{
$product_license_data .= eStore_check_and_generate_license_key($retrieved_product,$this->ipn_data);
$this->debug_log('License Data...'.$product_license_data,true);
}If I create the ‘wp_lic_manager_install’ and ‘eStore_check_and_generate_license_key’ functions and include them in paypal.php, would that allow me to assign the key(s) and make them available through the {license_data} short code, or am I reading this wrong?
Will Binns
November 19, 2011 at 7:16 am #26985adminKeymasterYou are on the right track.
July 6, 2012 at 11:18 pm #26986goldstriknParticipantI have a strange issue. I don’t have that option in my item settings, per your link http://www.tipsandtricks-hq.com/ecommerce/how-to-use-the-seriallicense-key-code-selling-feature-1618. How do I enable this? I use version WP Estore 6.6.2. Is it enabled in this version?
Please let me know. Thanks.
July 7, 2012 at 12:59 am #26987IvyMemberIf you do not see this option in your eStore please load a fresh build of the plugin.
https://support.tipsandtricks-hq.com/forums/topic/re-install-or-load-a-fresh-build-of-the-plugins
July 9, 2012 at 1:42 am #26988goldstriknParticipantThanks that did it. I install a fresh new updated version and it was shown there. Thanks for the info
-
AuthorPosts
- You must be logged in to reply to this topic.