Looking to hire Laravel developers? Try LaraJobs

pexcardsdk-laravel maintained by sayedbilalhussain

Description
Pex Cards PHP Laravel SDK
Author
Last update
2021/01/26 13:01 (dev-main)
License
Links
Downloads
0

Comments
comments powered by Disqus

PEXCARD SDK -PHP-laravel

Pex Cards PHP SDK | Pex Cards PHP Laravel SDK

Usage

  • requirements
PHP >= 7.0
Laravel >= 5.8
Guzzle >= 6.0
  • Installation
composer require sayedbilalhussain/pexcardsdk-laravel
  • Publish Config
php artisan vendor:publish

After Publishing Mention Api Credentials

  • Add PexCard Administrator Username and Password and required credentials in config/pex.php.

Auth Tokens / Api Auth Token/Key

  • Create Token
use SayedBilalHussain\PexCardSdk\Services\PexService;

$pexService = new PexService();
$pexService->generateUserToken() //this will return auth token
use SayedBilalHussain\PexCardSdk\Services\PexService;

$pexService = new PexService();
$pexService->setToken(<token>);
$pexService->renewToken();
$pexService->getToken(); 
  • Revoke/Logout from all created tokens
use SayedBilalHussain\PexCardSdk\Services\PexService;

$pexService = new PexService();
$pexService->revokeTokens();
  • Revoke/Logout from specific token
use SayedBilalHussain\PexCardSdk\Services\PexService;

$pexService = new PexService();
$pexService->revokeToken(<token>);
  • Detail of Tokens (Expiry/App)
use SayedBilalHussain\PexCardSdk\Services\PexService;

$pexService = new PexService();
$pexService->getTokenDetail(<token>); // this will return detail of all apps and related tokens with detail

Card Funding

  • Fund card
use SayedBilalHussain\PexCardSdk\Services\PexService;

$pex = new PexService();
$pex->setToken(<token>); \\recently generated token
$pex->FundCard(<cardID>,<amount>);