humayunjavaid/laravel-payzen
最新稳定版本:v1.0.0
Composer 安装命令:
composer require humayunjavaid/laravel-payzen
包简介
A simple package to generate Payzen PSID.
README 文档
README
Streamline Payzen payment integration in Laravel. Generate Payment Service Identifiers (PSIDs) for P2G, P2P, B2G, and B2B payments with ease.
Installation
You can install the package via composer:
composer require humayunjavaid/laravel-payzen
Set Up Environment
Check your .env file, and ensure that your following parameters are set with valid credentials obtained from Payzen.
PAYZEN_CLIENT_ID =
PAYZEN_CLIENT_SECRET_KEY =
PAYZEN_AUTH_URL = (Optional)
PAYZEN_PSID_URL = (Optional)
Optionally you can publish the config file with:
php artisan vendor:publish --tag="laravel-payzen-config"
This is the contents of the published config file:
return [ 'clientId' => env('PAYZEN_CLIENT_ID'), 'clientSecretKey' => env('PAYZEN_CLIENT_SECRET_KEY'), 'authUrl' => env('PAYZEN_AUTH_URL'), 'psidUrl' => env('PAYZEN_PSID_URL'), ];
Usage
Generate PSID method will return Illuminate\Http\Client\Response instance. That mean's, you have access to following methods.
$response->body() : string; $response->json() : array|mixed; $response->collect() : Illuminate\Support\Collection; $response->status() : int; $response->ok() : bool; $response->successful() : bool; $response->failed() : bool; $response->serverError() : bool; $response->clientError() : bool; $response->header($header) : string; $response->headers() : array;
Generate PSID
Payzen::setConsumerName('Dummy User') ->setCnic('123456789') ->setEmail('dummyuser@email.com') ->setMobileNumber('3324232321') ->setChallanNumber('2323232323') ->setServiceId('12') ->setAccountNumber('32323') ->setAccountTitle('Bibi Pak Damin') ->setDueDate('2023-08-29') ->setExpiryDate('2023-08-29') ->setAmountWithinDueDate(500) ->setAmountAfterDueDate(500) ->generate();
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-09-04