shahidneermunda/kseb-sdk
Composer 安装命令:
composer require shahidneermunda/kseb-sdk
包简介
A Laravel SDK to fetch and calculate KSEB utility bills.
README 文档
README
A lightweight Laravel package to fetch and parse KSEB utility bill information.
Features
- Laravel auto-discovery for provider and facade
- Simple facade and container-based usage
- Configurable endpoint, timeout, and CSS selector
- Safe amount parsing with consistent response format
- Bill payment request support through configurable payment endpoint
Requirements
- PHP
^8.1 - Laravel
^10.0or^11.0
Installation
Install with Composer:
composer require shahidneermunda/kseb-sdk
The package supports Laravel auto-discovery, so no manual provider registration is required in normal setups.
Configuration
Publish the package config:
php artisan vendor:publish --tag=config
Then update config/kseb.php as needed:
return [ 'quickpay_url' => env('KSEB_QUICKPAY_URL', 'https://wss.kseb.in/selfservices/quickpay'), 'payment_url' => env('KSEB_PAYMENT_URL', 'https://wss.kseb.in/selfservices/quickpay/pay'), 'timeout' => (int) env('KSEB_TIMEOUT', 15), 'bill_amount_selector' => env('KSEB_BILL_AMOUNT_SELECTOR', '#billAmount'), ];
You can also place these values in your .env:
KSEB_QUICKPAY_URL=https://wss.kseb.in/selfservices/quickpay KSEB_PAYMENT_URL=https://wss.kseb.in/selfservices/quickpay/pay KSEB_TIMEOUT=15 KSEB_BILL_AMOUNT_SELECTOR=#billAmount
Usage
Using the Facade
use Kseb; $bill = Kseb::getBill('1234567890'); return response()->json($bill);
Bill Payment
use Kseb; $payment = Kseb::payBill('1234567890', 1240.50, [ 'payment_mode' => 'UPI', 'payer_name' => 'John Doe', 'mobile' => '9876543210', ]); return response()->json($payment);
Using Dependency Injection
use Shahid\KsebSdk\KsebClient; class BillController { public function show(KsebClient $kseb) { $bill = $kseb->getBill('1234567890'); return response()->json($bill); } }
Response Format
[
'consumer_number' => '1234567890',
'amount' => 0.0,
'currency' => 'INR',
'status' => 'ok', // or 'error'
'error' => null, // error message when status is 'error'
'fetched_at' => '2026-04-15 12:34:56',
]
Bill Payment Response Format
[
'consumer_number' => '1234567890',
'amount' => 1240.50,
'currency' => 'INR',
'status' => 'ok', // or 'error'
'error' => null, // error message when status is 'error'
'transaction_id' => 'TXN12345',
'payment_status' => 'submitted', // e.g. submitted, success, failed
'response' => [], // raw response payload from payment endpoint
'paid_at' => '2026-04-15 12:40:00',
]
When an upstream request fails, status is returned as error and a short failure reason is included in error.
Notes
- Current implementation fetches the quick pay page and parses the configured bill amount selector.
- Depending on KSEB portal behavior, you may need to extend request flow (for example, posting consumer details) to fetch live bill amounts.
License
MIT
shahidneermunda/kseb-sdk 适用场景与选型建议
shahidneermunda/kseb-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 shahidneermunda/kseb-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 shahidneermunda/kseb-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 30
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-15