The Licensing Experience with Infralution and DotNetNuke

0

Posted by Cynic | Posted in .NET, C#, Databases, DotNetNuke, Online Marketing, Software, Solutions to Problems, Super Simple, Web Sites | Posted on 20-09-2011

Tags: ,

I don’t think that I’ve ever done a licensing or purchasing flow exactly the same way twice. Well, a couple times, but mostly I experiment with both major changes and minor tweaks.

This time around for the Super Simple Photo Resizer Social Edition, I’m doing things more or less right. There are a few things that still could be improved, and a few things that I’m not really all that happy with, but like my friend Nick Longo says, “Release at 80%.”

However, overall, I think the current functional set that I’ve got mapped out for Photo Resizer Social Edition are pretty good, and will deliver a solid user experience. My goals on the user-experience side are:

  1. Make it easy to purchase
  2. Make it easy to get and enter the license
  3. Make it easy to get a lost license back

Each of those has a real upside for users, and an upside for me as well (respectively):

  1. I make more money
  2. Fewer support emails
  3. Fewer support emails

But I also have some other goals.

  1. Cut down on piracy
  2. Cut down on piracy
  3. Cut down on piracy

For a little guy like me, piracy hurts. Badly. It also hurts users, because it removes the financial incentive to continue development. You’d be surprised at just how many people like to get paid for their work, and how much they enjoy having food on the table and paying their bills. 😉

I recently got an email from someone who purchased some other software that I write. This is part of that email:

I could have pirated the software if I wished as it is easy to crack which is something you need to work on, but I thought the software is so good that I would pay you the money for a genuine copy and support its future development.

I’m glad he bought a copy! It quite literally puts food on the table.

However, I don’t want to get into piracy here. Instead, I’d like to go over some of the things I’m doing with the new licensing scheme…

The flow looks something like this (click to zoom):

Super Simple Photo Resizer Social Edition Licensing Flow
Now, I’m leaving out a lot there because it would just be boring details, but that’s the basic flow.

The user gets 2 emails:

  1. PayPal receipt
  2. License email with account information

Now, in the past I’ve done licensing manually, which has been in many ways pretty easy, but it’s not been without its pain as well.

I’ve previously mentioned that I’m using the Infralution toolchain for licensing, but nothing is perfect “out of the box”, so I’ve done a good amount of customization. Having been burnt very badly in the past, I tend to purchase source code licenses whenever I can afford to. This leaves me the freedom to get down into things and tweak, fix, or just pimp-out stuff. Infralution offers source code along with their various products, which is another reason why I strongly recommend them to people whenever the topic of software licensing or payment integration arises.

I’ve also raved about how much I love DotNetNuke. It’s a fantastic CMS/portal written in ASP.NET (VB.NET in the past and now in C#), and comes with a BSDish license. However, I’ve been hesitant in the past to do much integration due to time constraints and other factors. However, this time around, I’m aiming to get things done more or less “right”.

Neither the Infralution ILS nor their IPN.NET integrate into DotNetNuke, so all of that is goodness that I need to take care of. Luckily, DotNetNuke is very well designed and integration isn’t really much of a problem. It’s really only a matter of getting it done and testing things out to make sure that they work. The trick is to try and make certain that I don’t step outside of the framework, and don’t create potential future issues for when I upgrade the DNN version. (Moving from DNN v2.1.2 to v3.x was a NIGHTMARE.)

ILS and IPN.NET take care of all the license generation and authentication, so the only thing needed is to get that into DNN. The relevant user-portion of the database is (click to zoom):

DotNetNuke Users Roles Database DiagramTo get ILS and IPN.NET working there, I needed to create 2 new entries in the database:

  • A Role for licensees
  • A ProfileProperty to store licenses

No new tables needed to be added, and no table modifications were needed. So, everything fits into DNN nice and cleanly.

A Note About the Database: When installing DNN, I would highly recommend using object qualifiers. These are prefixes for the database objects (tables, stored procedures, views), and will help to guarantee that well written modules that use them do not have conflicts. IPN.NET and ILS do not support object qualifiers, and have table names that could be used by other modules. As such, I’m very happy that I always stick with the wisdom of using object qualifiers because it’s made things much safer, and has allowed me the freedom to use the DNN database for the IPN.NET and ILS Authentication Server. Later on, this will let me create custom modules or do additional programming that let me access all user data in 1 place. The advantages here are never-ending.

When a user purchases a license through PayPal, PayPal then securely contacts my IPN.NET instance, and I then process the transaction by either updating the user’s existing profile, or creating a new user profile for the user and updating it with their new license information.

Since IPN.NET has no DNN integration, everything needs to work around that, and consequently, needs to be done at a low-level. Luckily, the DNN community is quite large, and there’s a lot of code out there to help with very low-level stuff like this.

The first step to integration is to create a user, and there’s some existing code out there that helped me get jump started:

Creating a DotNetNuke User via SQL

So starting from there, I’ve got a new account for the user and it has their license securely stored.

Next, there’s a password problem there… I certainly don’t want to use a known password, so that needs to change. Again, thanks to the DNN community, I’ve got the solution:

Updating a DotNetNuke User Password via SQL

However, what password do I create? What I wanted to do initially was to create a pass phrase instead of a password. However, being the grammar-Nazi that I am, and being constitutionally incapable of generating icky passphrases, I realized after some investigation that any decent passphrase generator would take me far longer than I was prepared to spend. So… Thank you again to the .NET community, I have a ready-made password generator that creates strong passwords of an arbitrary length:

Strong Passwords in C#

So that problem is also solved, in more detail that I’d care to bother with too! It creates passwords that look like these:

  • a+7P9A*rp6F&
  • So5={9WsM+g7
  • Ax8$+3JwD=a2
  • Ky8-i?H6Dw3&9%sS$rX54Q!f{2eLPp_7

The nice things about that password generator are that it

  • Leaves out ambiguous characters, e.g. I vs. | vs. l vs. 1 or 0 vs. o vs. O
  • Lets you choose the length of the password
  • Mixes in upper and lower case letters, numbers, and symbols

As far as being able to remember them? Bah! Not going to happen. Which is why I wanted to have a pass phrase generator, but, you do what you can with the time you have.

Now, code-wise, there are a few points where things need to get done:

  1. MS SQL Server stored procedures
  2. The IPN.NET project
    1. Default.aspx.cs
    2. Add in the RandomPassword.cs class
    3. Add in the “DnnLicenseIssuer.cs” class
    4. Modify the “Keys.htm” file

The MS SQL Server stored procedures won’t have any impact on DNN if done right. The prerequisite PropertyDefinitions and Roles need to be there, but that’s simple enough.

The RandomPassword.cs and DnnLicenseIssuer.cs classes won’t have any impact on the IPN.NET installation, so there’s a lot of freedom there.

However, changes to the Default.aspx.cs file will break across IPN.NET upgrades unless care is taken to migrate those changes to any new IPN.NET version. Luckily, everything that needs to be done can be done in this method:

private void ProcessPurchaseItem(PurchaseItem item, int quantity)

However, if you’ve actually sold a license, and the payment is successful, there’s only 1 spot that you need to modify, which will look something like this:

DnnLicenseIssuer dnnLi = new DnnLicenseIssuer(ipn, item, keys, false);
if (dnnLi.HasExistingAccount)
{
// Do stuff for license email
}
else
{
// Do stuff for license email
}

So you can easily minimize the impact there and make future upgrades very easily.

The “Do stuff” part contains customizations that I’ve written for the license email. If users have an existing account, then they get a different email than users that I’ve created an account for.

Of course it is possible to go further, and create users irrespective of whether the license payment succeeded or failed, and follow up later, however, it’s not one of my requirements at the moment.

The End Game

There’s a plan behind all this though. I’m not going to spill the beans quite yet, and it won’t get done for some time yet. However, all of this has a forward-looking purpose, and when I finally make it to that stage, I’ll post back on what I’m doing and the results.

Until then, check back at Super Simple over the next few weeks as the new Photo Resizer Social Edition is coming out very soon.

Cheers,

Ryan

Creating Urgency for Sales with Infralution Licensing System

0

Posted by Cynic | Posted in .NET, Business, C#, Databases, Money, Online Marketing, Software, Solutions to Problems, Super Simple | Posted on 15-09-2011

Tags: ,

I need to create a large number of “products” for Photo Resizer, but they’re really all just the same product with different prices. And not 2 or 3 prices, but more like 20 or 30 prices. Actually, I’ll likely end up creating more than 30, but that’s a detail.

It may seem strange to some people as to why I would do this. I’ve had people tell me to just set one price and be done with it. Well, that’s all fine and dandy, but it also shows a lack of understanding about how to sell software. Just because you’re a rock star coder, doesn’t mean you’re a rock star marketer.

So, what I’m going to cover now are some motivations and reasons for the problem, and how I’m solving it. There are of course other ways to create problems, and other ways to solve them too. 🙂

  • Urgency and creating urgency
  • The Infralution Licensing System and License Tracker
  • The Code: Creating massive numbers of products for the License Tracker database

Urgency and Creating Urgency

When you’re selling, you sometimes need to create a sense of urgency for people to BUY NOW! Not later. Not tomorrow. NOW! Stores do with with 1-day sales, or “on sale until <date>”. The same sort of thing can be done for software. You just tell people that there’s a deal to be had RIGHT NOW, and that if they don’t buy your product RIGHT NOW, then they’re going to miss out.

What happens when you do this is that you effectively remove a barrier to purchase for the customer. They have 1 less reason to “not buy”, and 1 more reason to buy. The more things you can do like this, the better. Typical things include telling potential customers how your product will benefit them and make their lives better, or offer free shipping, or… You get the point.

The way in which I am creating urgency is with an initial steep discount for the product that decreases; that is, the price increases over the course of the trial period. e.g. Today it’s $5 and tomorrow it’s $6, and the day after that… So… BUY NOW and SAVE~! I’ve done it before, and it works.

The Infralution Licensing System and License Tracker

There are lots of ways to license your software, but the one I like is from Infralution. The Infralution Licensing System, or ILS, integrates with their IPN.NET product as well, so it gives me a way to license the software and collect money for it; those are 2 very different things and should not be confused.

ILS includes a program to help keep track of licenses and customers called License Tracker, which up until now I’ve never used. Since I’m looking to automate as much as possible at this stage, I’m moving things over to it now.

License Tracker stores data in a database; I’m using MS SQL Server for that. To add a new product, you simply open up a new form and enter all the data then click OK. Sounds simple enough? Well… Not when you want to add in a truck load of products; it is extremely tedious and painful. I don’t want to copy and paste 500 million times, and I don’t want to change my mind later on and end up copying and pasting another 500 million times.

Since License Tracker is a database-connected application, all data in it is just the data in MS SQL Server. This makes it easy to deal with your data because you can simply connect to the database and do whatever you feel like. As such, I wrote a utility to generate SQL for products, or rather, for product variants, though it could also be used to create top level primary products as well.

My simple “SQL Generator for the Infralution Licensing System License Tracker ” (that’s a mouthful) lets you enter data for a product and generate product variants very quickly. It even lets you increase product costs by a set increment, and lets you auto-increment IPN item numbers. Here’s a screenshot of it (click to zoom):

SQL Generator for the Infralution Licensing System License TrackerIt’s pretty basic, but it saves product information and settings automatically so that you don’t need to enter everything the next time.

You simply fill in the form and click the “Generate SQL” button. The SQL is then appended to the Generated SQL text box at the bottom of the form. You can automate part of it with the Automatic Increments settings, or quickly change the price manually and click the Generate SQL button again. It’s MUCH faster than copying and pasting for every field.

Now, you do need to know what you are doing, and the “Parent Product ID” needs to be the primary key for the product’s parent in SQL Server, so this isn’t a utility for just anyone to use. However, if you use the Infralution Licensing System and License Tracker, you’ll already be familiar with everything in there, and you won’t have any problems in using it.

Once you have your SQL, you can simply review it to see that it’s what you want and run it in MS SQL Server Management Studio, or whatever you use to execute SQL against MS SQL Server.

After you run your SQL, simply open up License Tracker and all your products will be there.

The Code: Creating Massive Numbers of Products for the License Tracker Database

To make things easier, I’m including the full source code for download here. Please note that I’ve chosen for it to be licensed under the WTFPL 2.0, so you have maximum freedom to “Do What The F*** You Want To”. If you don’t like that license, then feel free to send me lots of money and I’ll give you another license. 😉

Download Source Code for SQL Generator for the Infralution Licensing System License Tracker

The download includes all source code and a debug build that you can run immediately.

The code is commented extensively, so you can consider that the “documentation”. If you have any questions, which I rather doubt anyone will, you can post a reply here. (Also email me to let me know to respond. You can email me through the contact page at http://renegademinds.com.)

I hope that helps someone out.

Cheers,

Ryan

RDBMS Table Design in Excel?

0

Posted by Cynic | Posted in Databases, Logic | Posted on 27-01-2011

Tags: , , ,

Image: jscreationzs / FreeDigitalPhotos.netI was just thinking about data mining relationships between atoms and chemical compounds, and about putting it all into a nice, neat RDBMS for that, when it occurred to me that I’m really not an expert in the field, and designing the database would require more knowledge than I have. However, in a process of table design on a subject that you’re not really familiar with, it also occurred to me that the best tool for the job is likely Microsoft Excel. In a spreadsheet you can add column effortlessly, and while you are doing that, you can fill in the rows. The process effectively lets you create the table and fill in the data slowly before you end up doing the “real” design.

I’m not advocating database design in Excel. Heck… I’m one of those radical freaks out there that would crucify anyone that dared not initially design for the 5th normal form and then denormalize for optimization. But in that specific case where you’re doing investigative work, Excel can be a very useful tool in table design.