From d456637b262dc92809d00de8a40cf12a87bd9c50 Mon Sep 17 00:00:00 2001 From: Shipu Ahamed Date: Thu, 30 Mar 2017 16:11:57 +0600 Subject: [PATCH 1/2] Fixed Missing Uses Namespace Fixed Missing Uses Namespace --- src/Api/AbstractApi.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Api/AbstractApi.php b/src/Api/AbstractApi.php index a2f1acd..b201199 100644 --- a/src/Api/AbstractApi.php +++ b/src/Api/AbstractApi.php @@ -3,6 +3,10 @@ namespace Nahid\EnvatoPHP\Api; use duncan3dc\Sessions\SessionInstance; +use GuzzleHttp\Exception\BadResponseException; +use GuzzleHttp\Exception\ClientException; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Exception\ServerException; use Nahid\EnvatoPHP\HttpManager\RequestHandler; use Nahid\EnvatoPHP\HttpManager\Response; From 509ccd1b2101104cfa381fa85e6bff94ea9dc57c Mon Sep 17 00:00:00 2001 From: Shipu Ahamed Date: Thu, 30 Mar 2017 16:22:01 +0600 Subject: [PATCH 2/2] Added Purchase Code Verify Example Added Purchase Code Verify Example --- readme.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 5e647c2..4a1684f 100644 --- a/readme.md +++ b/readme.md @@ -26,7 +26,7 @@ and add this facade in facades section Run this command in your terminal ```shell -php artisan vendor:publish --tag="envato" +php artisan vendor:publish --provider="Nahid\EnvatoPHP\EnvatoServiceProvider" ``` after publishing your config file then open `config/envato.php` and add your envato app credentials. @@ -81,7 +81,19 @@ $config = [ dd($user->data); ``` + ```php + // For envato purchase code verify + + use Nahid\EnvatoPHP\Facades\Envato; + $purchaseCode = 'purchase_code_here'; + $purchaseVerify = Envato::me()->sale($purchaseCode); + if($purchaseVerify->getStatusCode() == 200) { + dd($purchaseVerify->data); + } else { + dd("Invalid Purchase Code"); + } + ```