PHPackages                             hiworld/laravel-icbc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. hiworld/laravel-icbc

ActiveLibrary

hiworld/laravel-icbc
====================

ICBC Payment SDK for Laravel

v1.6(1y ago)018MITPHPPHP ^7.4|^8.0

Since Jan 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Hiworld-Inc/hiworld-icbc)[ Packagist](https://packagist.org/packages/hiworld/laravel-icbc)[ RSS](/packages/hiworld-laravel-icbc/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (8)Used By (0)

Laravel ICBC
============

[](#laravel-icbc)

工商银行支付 SDK 的 Laravel 封装包。

安装
--

[](#安装)

```
composer require hiworld/laravel-icbc
```

配置
--

[](#配置)

1. 发布配置文件：

```
php artisan vendor:publish --tag=icbc-config
```

2. 在 `.env` 文件中添加以下配置：

```
ICBC_APP_ID=your_app_id
ICBC_PRIVATE_KEY=your_private_key
ICBC_PUBLIC_KEY=icbc_public_key
ICBC_SIGN_TYPE=RSA
ICBC_CHARSET=UTF-8
ICBC_FORMAT=json
ICBC_ENCRYPT_KEY=your_encrypt_key
ICBC_ENCRYPT_TYPE=your_encrypt_type
ICBC_CA=your_ca
ICBC_PASSWORD=your_password
ICBC_SANDBOX=true  # 设置为 false 以使用生产环境
```

使用方法
----

[](#使用方法)

### 方法 1：使用 Facade

[](#方法-1使用-facade)

```
use Hiworld\LaravelIcbc\Facades\IcbcClient;
// 支付
$result = IcbcClient::pay([
    'order_no' => '123456',
    'amount' => '100.00',
    // 其他支付参数...
]);

// 查询订单
$result = IcbcClient::query([
    'order_no' => '123456'
]);

// 退款
$result = IcbcClient::refund([
    'order_no' => '123456',
    'refund_amount' => '100.00'
]);

// 撤销订单
$result = IcbcClient::cancel([
    'order_no' => '123456'
]);
```

### 方法 2：使用依赖注入

[](#方法-2使用依赖注入)

```
use Hiworld\LaravelIcbc\Services\IcbcService;

class PaymentController extends Controller
{
    protected $icbc;

    public function __construct(IcbcService $icbc)
    {
        $this->icbc = $icbc;
    }

    public function pay()
    {
        $result = $this->icbc->pay([
            'order_no' => '123456',
            'amount' => '100.00',
            // 其他支付参数...
        ]);

        return $result;
    }
}
```

支持的方法
-----

[](#支持的方法)

- `pay()` - 发起支付
- `query()` - 查询订单
- `refund()` - 退款
- `cancel()` - 撤销订单
- `execute()` - 执行自定义请求

注意事项
----

[](#注意事项)

1. 请确保在生产环境中妥善保管各种密钥信息
2. 建议在正式使用前先在测试环境进行充分测试
3. 如需要其他接口支持，可以使用 `execute()` 方法自定义请求

License
-------

[](#license)

MIT

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance43

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

7

Last Release

485d ago

PHP version history (2 changes)v1.0PHP ^7.3|^8.0

v1.1PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/10cf202cad6d92eb60131cd5853d6d49d7ca8f7d324994a8572bf2dfc7ec949c?d=identicon)[Hiworld-Inc](/maintainers/Hiworld-Inc)

---

Top Contributors

[![hwtdnet](https://avatars.githubusercontent.com/u/3921757?v=4)](https://github.com/hwtdnet "hwtdnet (26 commits)")

### Embed Badge

![Health badge](/badges/hiworld-laravel-icbc/health.svg)

```
[![Health](https://phpackages.com/badges/hiworld-laravel-icbc/health.svg)](https://phpackages.com/packages/hiworld-laravel-icbc)
```

###  Alternatives

[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[reachweb/statamic-livewire-filters

Livewire filters for Statamic collections.

1710.5k](/packages/reachweb-statamic-livewire-filters)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

116.6k](/packages/tomshaw-electricgrid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
