PHPackages                             itpony/chinapay - 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. [Payment Processing](/categories/payments)
4. /
5. itpony/chinapay

ActiveLibrary[Payment Processing](/categories/payments)

itpony/chinapay
===============

ChinaPay 银联在线支付SDK

1.0.0(6y ago)439MITPHPPHP &gt;=5.6

Since Apr 2Pushed 6y agoCompare

[ Source](https://github.com/okxaas/chinapay)[ Packagist](https://packagist.org/packages/itpony/chinapay)[ RSS](/packages/itpony-chinapay/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

使用说明
====

[](#使用说明)

```
// 引入类库
use ITPony\ChinaPay;
```

```
$config = [
    // dev是测试环境，生产环境mode参数可不设置或者设置成pro即可
    'mode'	        	=> 'dev',
    'signFile'                  => '.pfx的商户交易证书所在地址',
    'signFilePassword'          => '证书密码',
    'verifyFile' 		=> 'cp.cer的验证证书所在地址',
    'signInvalidFieldsArray' 	=> 'Signature',
    'merId' 			=> '商户ID',
    'AccessType' 		=> 0,
];

$chinaPay = new ChinaPay($config);

$params = [
    'MerOrderNo' 	=> '15位订单号',
    'TranType'		=> 'B2C：0001，B2B：0002；其他类型请查阅官方文档',
    'TranDate'		=> '日期：格式yyyymmdd',
    'TranTime'		=> '时间：hhiiss',
    'OrderAmt'		=> '支付金额',
    'MerBgUrl'		=> '回调地址',
    'RemoteAddr'	=> '客户端IP',
];

// 该结果会返回一个地址和提交支付的参数，自行适配页面
$chinaPay->webB2bPay($params)

// 回调传入银联回调回来的数据即可使用
$chinapay->webB2Notify();
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

2235d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cb3da60bee38ec8f65306d59424e049fad8bdd58a5214bd10d7b749f02fee3c1?d=identicon)[OKXaas](/maintainers/OKXaas)

### Embed Badge

![Health badge](/badges/itpony-chinapay/health.svg)

```
[![Health](https://phpackages.com/badges/itpony-chinapay/health.svg)](https://phpackages.com/packages/itpony-chinapay)
```

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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