You can use FastSpring and they can host the code for you -- it requires minimal code fiddling. You just edit one line and paste it into their interface. They handle all the rest. See: Automate license generation with FastSpring.
Tell me if this helps.