sayedbilalhussain / pexcardsdk-laravel
Pex Cards PHP Laravel SDK
dev-main
2021-01-26 12:01 UTC
Requires
- guzzlehttp/guzzle: ~6.0|~7.0
This package is auto-updated.
Last update: 2024-09-26 21:18:02 UTC
README
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
- Renew Token (Only one month prior to expiry) Implementation note
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>);