License domain validation inside the WP dashboard

Hi all,
I’ve read many threads and searched many forums around the web, without reaching a robust solution for that.
The question is simple:
I would like to build a simple solution inside a WP theme that allows the user to input their license code and that “validates” that code for that specific domain.
So,

  1. do you know some php module/class that I can embed in my theme that already makes the dirty work? I searched around but I found only code written 2-3 years ago. Obviously I could write some code to integrate with the new Envato API but I would like to be sure that no good solution is already available to the community;
  2. what actions are allowed if the license is not validated or is not allowed in the specific domain?

Thanks for your responses.
Simone