polopolaw/fkwallet
最新稳定版本:1.1.0
Composer 安装命令:
composer require polopolaw/fkwallet
包简介
Laravel package for fkwallet.io API integration
README 文档
README
Laravel package for integration with fkwallet.io API.
Quick Start
Using Facade
use Polopolaw\FKWallet\Facades\FKWallet; $balance = FKWallet::getBalance(); $currencies = FKWallet::getCurrencies(); $withdrawal = FKWallet::createWithdrawal(new \Polopolaw\FKWallet\DTO\Requests\WithdrawalRequest( new \Polopolaw\FKWallet\ValueObjects\Amount(100.0), new \Polopolaw\FKWallet\ValueObjects\CurrencyId(1), new \Polopolaw\FKWallet\ValueObjects\PaymentSystemId(5), '79261234567', 1, 'unique_order_id' ));
Using Proxy
You can specify a proxy for requests in two ways:
$balance = FKWallet::proxy('http://proxy.example.com:8080')->getBalance();
Using Custom Credentials
Override configured keys at runtime:
$balance = FKWallet::withCredentials('public_key', 'private_key')->getBalance();
Using Service
use Polopolaw\FKWallet\Contracts\FKWalletServiceInterface; $service = app(FKWalletServiceInterface::class); $balance = $service->getBalance();
Installation
Install the package via Composer:
composer require polopolaw/fkwallet
Configuration
Publish the configuration file:
php artisan vendor:publish --provider="Polopolaw\FKWallet\FKWalletServiceProvider" --tag="config"
Add the following to your .env file:
FKWALLET_API_URL=https://api.fkwallet.io/v1/ FKWALLET_PUBLIC_KEY=your_public_key_here FKWALLET_PRIVATE_KEY=your_private_key_here FKWALLET_TIMEOUT=30 FKWALLET_RETRY_ATTEMPTS=3
Available Methods
Note: All methods use the
FKWALLET_PUBLIC_KEYandFKWALLET_PRIVATE_KEYfrom your configuration file. Or you can pass as a parameter keys.
GET Methods
getBalance()- Get wallet balancegetHistory(?string $dateFrom, ?string $dateTo, int $page, int $limit)- Get transaction historygetCurrencies()- Get list of currenciesgetPaymentSystems()- Get payment systemsgetSbpList()- Get SBP banks listgetMobileCarrierList()- Get mobile carriers listgetWithdrawalStatus(string $orderId, OrderStatusType $type)- Get withdrawal statusgetTransferStatus(int $id)- Get transfer statusgetOnlineProductCategories()- Get online product categoriesgetOnlineProducts(int $categoryId)- Get online productsgetOnlineOrderStatus(string $orderId)- Get online order status
POST Methods
createWithdrawal(WithdrawalRequest $request)- Create withdrawalcreateTransfer(TransferRequest $request)- Create transfercreateOnlineOrder(OnlineOrderRequest $request)- Create online order
Documentation
For detailed documentation, see the docs directory.
To generate Docusaurus documentation:
cd docs
npm install
npm start
Testing
Run tests with Pest:
composer test
Requirements
- PHP 8.1+
- Laravel 9.0+ | 10.0+ | 11.0+
License
MIT
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-08