136 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
773 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

172 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.

136 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.

172 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
136 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.

3259 posts
  • 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
  • Won a competition
+15 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...
136 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 :)

136 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.

1768 posts Time is what you desire most, but waste carelessly.
  • Has sold $250,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 5 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.

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by