PHPackages                             anerg2046/payment - 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. anerg2046/payment

ActiveLibrary[Payment Processing](/categories/payments)

anerg2046/payment
=================

payment alipay weixinpay vnetone

v1.0.18(7y ago)35.6k↓65%3MITPHPPHP &gt;=5.6.0

Since Apr 16Pushed 7y ago1 watchersCompare

[ Source](https://github.com/anerg2046/payment)[ Packagist](https://packagist.org/packages/anerg2046/payment)[ RSS](/packages/anerg2046-payment/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (1)Versions (20)Used By (0)

支付类
===

[](#支付类)

===============

安装方法
----

[](#安装方法)

```
composer require anerg2046/payment

```

> 类库使用的命名空间为`\\anerg\\Payment`

运行环境
----

[](#运行环境)

- PHP 5.6+
- composer

支持的支付渠道
-------

[](#支持的支付渠道)

- [支付宝支付/Alipay](#%E6%94%AF%E4%BB%98%E5%AE%9D%E6%94%AF%E4%BB%98%E6%96%B9%E5%BC%8F)
- [微信支付/Wxpay](#%E5%BE%AE%E4%BF%A1%E6%94%AF%E4%BB%98%E6%96%B9%E5%BC%8F)
- [盈华讯方短信支付/Vnetone](#%E7%9B%88%E5%8D%8E%E8%AE%AF%E6%96%B9%E6%94%AF%E4%BB%98%E6%96%B9%E5%BC%8F)

统一订单信息
------

[](#统一订单信息)

```
$params = [
    'order_no' => '*************', //商户订单号，无论什么渠道
    'fee' => 100, //支付金额，统一使用【分】为单位，无论什么支付渠道
    'body' => '商品名称', //无论什么渠道
    'detail' => '商品描述', //无论什么渠道
    'client_ip' => '127.0.0.1', //客户端IP
    'limit_pay' => '*****', //禁用的支付方式
    'attach' => '附加参数', //用户自定义值，会在回调或回跳的时候原样返回的值
    'refund_no' => '****************', //退款单号
    'refund_fee' => 100, //退款金额
];
```

- 注意，这些参数在所有渠道中的官方文档定义可能不一样，在这里我做了统一处理
- 当你在订单信息要传递参数的时候可以选择使用以上的参数名，当然也可以使用官方的参数名
- 未出现在上面的参数名，你需要使用官方的要求的参数名

典型用法
----

[](#典型用法)

```
try {
    $ret = Pay::支付渠道名称($配置文件信息)->支付方式名称($统一订单信息);
    var_dump($ret);
}catch(\Exception $e) {
    echo $e->getMessage();
}
```

支持的支付方式
-------

[](#支持的支付方式)

### 支付宝支付方式

[](#支付宝支付方式)

- PC网站支付/Web
- 手机网站支付/Wap
- 手机APP支付/App
- 扫码支付/Scan

```
//支付宝配置文件
return [
    'app_id' => '*************',
    'pem_private' => '/pathto/private.pem', //用户私钥
    'pem_public' => '/pathto/public.pem', //支付宝公钥
];
```

> 支付方式名称

method描述Web电脑支付Wap手机网站支付AppAPP支付Scan扫码支付### 微信支付方式

[](#微信支付方式)

- PC网站支付/Web
- 手机网站支付/Wap
- 手机APP支付/App
- 扫码支付/Scan

```
//微信配置文件
return [
    'app_id' => '***********',
    'app_secret' => '*******************',
    'mch_id' => '****************',
    'md5_key' => '*******************',
    'notify_url' => 'http://test.com/wxpay/notify',
    'pem_cert' => '/pathto/apiclient_cert.pem',
    'pem_key' => '/pathto/apiclient_key.pem',
];
```

> 支付方式名称

method描述Pub公众号支付AppAPP支付Scan扫码支付### 盈华讯方支付方式

[](#盈华讯方支付方式)

- PC网站短信支付/Web
- 手机网站短信支付/Wap

```
//微信配置文件
return [
    'web' => [
        'app_id' => '****',
        'app_secret' => '****',
        'return_url' => 'http://test.com/vpay_suc.php',
        'quit_url' => 'http://test.com/vpay.php',
	],
	'wap' => [
        'app_id' => '****',
        'app_secret' => '****',
        'return_url' => 'http://test.com/vpay_suc.php',
        'quit_url' => 'http://test.com/vpay.php',
	],
];
```

> 支付方式名称

method描述WebWEB网站短信支付WapWAP网站短信支付

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

Established project with proven stability

 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 ~17 days

Total

19

Last Release

2650d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/36bcee878f423e0e8e8c3bc57cd4198f3f255137b76b74446688b8e9df517336?d=identicon)[anerg2046](/maintainers/anerg2046)

---

Top Contributors

[![anerg2046](https://avatars.githubusercontent.com/u/3120629?v=4)](https://github.com/anerg2046 "anerg2046 (11 commits)")

### Embed Badge

![Health badge](/badges/anerg2046-payment/health.svg)

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

###  Alternatives

[chargebee/chargebee-php

ChargeBee API client implementation for PHP

768.0M9](/packages/chargebee-chargebee-php)[imdhemy/google-play-billing

Google Play Billing

491.3M5](/packages/imdhemy-google-play-billing)[bitpay/sdk

Complete version of the PHP library for the new cryptographically secure BitPay API

42337.5k4](/packages/bitpay-sdk)[buckaroo/sdk

Buckaroo payment SDK

12189.1k9](/packages/buckaroo-sdk)[contica/facturador-electronico-cr

Un facturador de código libre para integrar facturación electrónica en Costa Rica a un proyecto PHP

2128.8k](/packages/contica-facturador-electronico-cr)[karson/mpesa-php-sdk

172.2k](/packages/karson-mpesa-php-sdk)

PHPackages © 2026

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