承接 shahidneermunda/kseb-sdk 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

shahidneermunda/kseb-sdk

最新稳定版本:v1

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.0 or ^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

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固