139 posts
  • Has been part of the Envato Community for over 3 years
  • Located in Australia
  • Sells items exclusively on Envato Market
  • Has been a beta tester for an Envato feature
+2 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
933 posts
  • Interviewed on an Envato blog
  • Had an item that was trending
  • Sells items exclusively on Envato Market
  • Has been a beta tester for an Envato feature
+3 more
abhimanyusharma003
says

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

176 posts
  • Power Elite Author: Sold more than $1M on Envato Market
  • Has been part of the Envato Community for over 6 years
  • Has sold $1M+ on Envato Market and is now a Power Elite Author
  • Had an item that was trending
+6 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.

139 posts
  • Has been part of the Envato Community for over 3 years
  • Located in Australia
  • Sells items exclusively on Envato Market
  • Has been a beta tester for an Envato feature
+2 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.

176 posts
  • Power Elite Author: Sold more than $1M on Envato Market
  • Has been part of the Envato Community for over 6 years
  • Has sold $1M+ on Envato Market and is now a Power Elite Author
  • Had an item that was trending
+6 more
stmcan
says
139 posts
  • Has been part of the Envato Community for over 3 years
  • Located in Australia
  • Sells items exclusively on Envato Market
  • Has been a beta tester for an Envato feature
+2 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.

5362 posts
  • Achieved the monthly Community Superstar Award
  • Created a helpful tool/app using the Envato API
  • Became a Top 20 Author of the Month
  • Had an item that was trending
+19 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...
139 posts
  • Has been part of the Envato Community for over 3 years
  • Located in Australia
  • Sells items exclusively on Envato Market
  • Has been a beta tester for an Envato feature
+2 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 :)

139 posts
  • Has been part of the Envato Community for over 3 years
  • Located in Australia
  • Sells items exclusively on Envato Market
  • Has been a beta tester for an Envato feature
+2 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.

1826 posts Time is what you desire most, but waste carelessly.
  • Became a Top 20 Author of the Month
  • Has sold $250,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Made it to the Authors' Hall of Fame
+7 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