PHPackages                             kagami10074/lianlianpay - 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. kagami10074/lianlianpay

ActiveLibrary[Payment Processing](/categories/payments)

kagami10074/lianlianpay
=======================

连连支付 SDK for PHP.

07PHP

Since Jan 22Pushed 5y agoCompare

[ Source](https://github.com/kagamiii/lianlianpay)[ Packagist](https://packagist.org/packages/kagami10074/lianlianpay)[ RSS](/packages/kagami10074-lianlianpay/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

 LianLianPay
=============

[](#-lianlianpay-)

 连连支付 SDK for PHP..

 感谢原作者

原地址
---

[](#原地址)

[原作者地址](https://github.com/achais/lianlianpay)
----------------------------------------------

[](#原作者地址)

安装
--

[](#安装)

```
$ composer require achais/lianlianpay:dev-master -vvv
```

```
$ composer require kagami10074/lianlianpay:dev-master -vvv
```

使用
--

[](#使用)

配置

```
use Kagami10074\LianLianPay\LianLianPay;

$config = [
    'debug' => true, // 开启调试

    // 银行卡收款参数
    'bank_pay' => [
        'oid_partner' => '', // 商户号
        'notify_url' => 'http://localhost/', // 付款结果异步回调地址
        'url_return' => 'http://localhost/', // 付款完成后转向到此地址
    ],

    // 实时付款参数
    'instant_pay' => [
        'oid_partner' => '', // 商户号
        'notify_url' => 'http://localhost/', // 付款结果异步回调地址
        'url_return' => 'http://localhost/', // 付款完成后转向到此地址
        'production' => false, // 是否生产环境
        'platform' => '', // 来源标识，写上自己的域名
    ],

    // 退款参数
    'instant_pay' => [
        'oid_partner' => '', // 商户号
        'notify_url' => 'http://localhost/', // 付款结果异步回调地址
    ],

    // 日志
    'log' => [
        'level' => 'debug',
        'permission' => 0777,
        'file' => '/tmp/logs/lianlianpay-' . date('Y-m-d') . '.log', // 日志文件, 你可以自定义
    ],
];

$llp = new LianLianPay($config);
```

> 不管使用什么功能, 配置信息和实例化 LianLianPay 是必须的

#### 银行卡收款

[](#银行卡收款)

```
use Kagami10074\LianLianPay\LianLianPay;

$config = []; // 配置信息如上
$llp = new LianLianPay($config);

$time_stamp =  date("YmdHis");
$user_id = '';
//虚拟物品
$busi_partner='101001';
//商户订单号
$no_order = '1607915741';
//商户订单时间
$dt_order = '20201214094610';
$name_goods = '测试商品名';
$money_order ='0.1';

//基础类风控参数
$base_risk_item=[
    //测试商户充值话费
    "frms_ware_category"=>"1010",
    //用户在趣买货中的ID，可与user_id一致
    "user_info_mercht_userno"=>"",
    "user_info_bind_phone"=>"",
    "user_info_dt_register"=>"",
    "goods_name"=>"测试商品名",
];
//虚拟类风控参数
$high_risk_item=[
    "frms_charge_phone"=>""
];

$risk_item =  json_encode(array_merge($base_risk_item,$high_risk_item));

$ret = $llp->bankPay->payment($time_stamp, $user_id, $busi_partner, $no_order, $dt_order,$money_order,$risk_item, $name_goods);

结果:
array [
    "ret_code" => "4002"
    "ret_msg" => "疑似重复提交订单"
]
```

#### 实时付款

[](#实时付款)

> 更多详情查看原作者说明 [原作者地址](https://github.com/achais/lianlianpay)

```
use Kagami10074\LianLianPay\LianLianPay;

$config = []; // 配置信息如上
$llp = new LianLianPay($config);

$moneyOrder = '0.02'; // 付款金额
$cardNo ='6212261203****'; // 收款卡号
$acctName = '起风'; // 收款人姓名
$infoOrder = '代付'; // 订单描述。说明付款用途，5W以上必传。
$memo = '余额提现'; // 收款备注。 传递至银行， 一般作为订单摘要展示。

$ret = $llp->instantPay->payment($moneyOrder, $cardNo, $acctName, $infoOrder, $memo); // 付款申请

结果:
Collection {#287 ▼
  #items: array:7 [▼
    "confirm_code" => "836765"
    "no_order" => "202004021****"
    "oid_partner" => "20190902****"
    "ret_code" => "4002"
    "ret_msg" => "疑似重复提交订单"
    "sign" => "W4Y4R6rjyWJYupN508Q5E1****"
    "sign_type" => "RSA"
  ]
}
```

#### 退款

[](#退款)

```
use Kagami10074\LianLianPay\LianLianPay;

$config = []; // 配置信息如上
$llp = new LianLianPay($config);

$no_refund = ''; // 商户退款流水号
$dt_refund =''; // 商户退款时间，格式为 YYYYMMddHHmmss
$money_refund = '19.99'; // 取值范围为 0.01 ~ 99999999
$no_order = ''; // 原收款请求中传入的商户订单号
$dt_order = ''; // 原商户订单时间。格式为 YYYYMMddHHmmss

$ret = $llp->refundPay->payment($no_refund, $dt_refund, $money_refund, $no_order, $dt_order);

结果:
array [
    "ret_code" => "0000"
    "ret_msg" => "交易成功"
]

$no_refund = ''; //商户退款流水号
$dt_refund = ''; // 商户退款时间，格式为 YYYYMMddHHmmss

//退款状态主动查询
$ret = $llp->refundPay->queryPayment($no_refund, $dt_refund);

结果:
array [
    "ret_code" => "0000"
    "ret_msg" => ""
    "sta_refund" => "2"
]
```

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/f32bcc9f6dcf4653d00cdb6c1622daf852e71886e95f8cfb6ead7f7e46d0fd44?d=identicon)[ka\_gami](/maintainers/ka_gami)

---

Top Contributors

[![kagamiii](https://avatars.githubusercontent.com/u/30517840?v=4)](https://github.com/kagamiii "kagamiii (17 commits)")

### Embed Badge

![Health badge](/badges/kagami10074-lianlianpay/health.svg)

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

###  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)
