132 posts
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 100+ items on Envato Market
+3 more
TigerModules says

I am wondering if anyone has every created a Regular Expression for the Envato Purchase Code. I am integrating Purchase Code verification with my new support suite and was just wondering.

If you have could you please share it :)

abhimanyusharma003
abhimanyusharma003 Recent Posts Threads Started
674 posts
  • Sells items exclusively on Envato Market
  • Has been a beta tester for an Envato feature
  • Has sold $10,000+ on Envato Market
  • Has referred 1+ members
+1 more
abhimanyusharma003 says

Why you need regex for this, envato send api request in json format, json decode will work fine

170 posts
  • Power Elite Author: Sold more than $1M on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Sells items exclusively on Envato Market
  • Made it to the Authors' Hall of Fame
+4 more
stmcan says

This may helps https://github.com/syamilmj/Aqua-Verifier/blob/master/aq-verifier.php It is a plugin for bbPress that verifies the purchase code.

132 posts
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 100+ items on Envato Market
+3 more
TigerModules says

Why you need regex for this, envato send api request in json format, json decode will work fine

I was hoping to avoid creating a module for my support system :) it has the ability to verify fields with regex.

170 posts
  • Power Elite Author: Sold more than $1M on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Sells items exclusively on Envato Market
  • Made it to the Authors' Hall of Fame
+4 more
stmcan says
132 posts
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 100+ items on Envato Market
+3 more
TigerModules says

You don’t need a regex for it as @abhimanyusharma003 mentioned Create the API url http://marketplace.envato.com/api/edge/USERNAME/API-KEY/verify-purchase:550e8400-e29b-41d4-a716-446655440000.json

and parse the data;

http://stackoverflow.com/questions/8344609/how-do-i-use-external-json
http://stackoverflow.com/questions/4343596/parsing-json-file-with-php Hope that helps :)

I know how to but I find Kayako so difficult to customise. It is the best system by far in way of managing tickets and kb’s but the code and MVC is complicated.

3093 posts
  • Located in Australia
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
  • Helped several times protecting Envato Market against copyright violations
+16 more
dtbaker Moderator says

I use this before quering the API to ensure the code is valid. When you start to hit the API limits you want to make sure the call is valid, and that you cache the results for a little bit of time.

$license_code = preg_replace('#([a-z0-9]{8})-?([a-z0-9]{4})-?([a-z0-9]{4})-?([a-z0-9]{4})-?([a-z0-9]{12})#','$1-$2-$3-$4-$5',strtolower($license_code));
if(strlen($license_code) == 36){
    $cache_timeout = 43200;
    // etc...
132 posts
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 100+ items on Envato Market
+3 more
TigerModules says

I use this before quering the API to ensure the code is valid. When you start to hit the API limits you want to make sure the call is valid, and that you cache the results for a little bit of time.
$license_code = preg_replace('#([a-z0-9]{8})-?([a-z0-9]{4})-?([a-z0-9]{4})-?([a-z0-9]{4})-?([a-z0-9]{12})#','$1-$2-$3-$4-$5',strtolower($license_code));
if(strlen($license_code) == 36){
    $cache_timeout = 43200;
    // etc...

Thanks DTBaker :)

132 posts
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 100+ items on Envato Market
+3 more
TigerModules says

Thanks again DTBaker. :)

I got it working in Kayako without a hitch. Just needed to make a few modifications but all is good.

1716 posts Time is what you desire most, but waste carelessly.
  • Has sold $125,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Sells items exclusively on Envato Market
+6 more
Firsh says

If you still manage hit the API limits with caching and pre-validation you can create multiple API keys and juggle them.

by
by
by
by
by
by