polopolaw / fkwallet
Laravel package for fkwallet.io API integration
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/polopolaw/fkwallet
Requires
- php: ^8.1
Requires (Dev)
- marcocesarato/php-conventional-changelog: ^1.17
- orchestra/testbench: ^7.0|^8.0|^9.0
- pestphp/pest: ^2.0
- phpstan/extension-installer: ^1.3
- phpstan/phpstan: ^1.10
This package is auto-updated.
Last update: 2026-01-09 07:34:32 UTC
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