Clone, download, or copy the 'EnvatoPurchaseCodeVerifier' class to create your own Envato purchase verifier tool. You can go to index.php to see sample code. Read EnvatoPurchaseCodeVerifier.php to understand what the class is all about. It's really simple.
Contributions are highly appreciated!
-
Require the class file:
require_once 'EnvatoPurchaseCodeVerifier.php';
-
Use the code below to create an instance of 'EnvatoPurchaseCodeVerifier'. Create your own access token at: https://build.envato.com/create-token
$purchase = new EnvatoPurchaseCodeVerifier($access_token);
-
Then, check the user purchase code:
$verified = $purchase->verified($buyer_purchase_code); // Will return false if purchase code is invalid, otherwise the purchase data.
That's it! Happy Coding!