PHPackages                             tiangang/phppay - 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. tiangang/phppay

ActiveLibrary[Payment Processing](/categories/payments)

tiangang/phppay
===============

php pay

1.0.3(6y ago)010MITPHP

Since Sep 4Pushed 6y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (5)Used By (0)

 接口文档
=====

[](#-接口文档)

composer require tiangang/phppay

### 使用：

[](#使用)

#### 引入文件

[](#引入文件)

use tiangang/phppay as pay;

---

#### 实例化

[](#实例化)

$pay = new pay();

---

#### 设置基础参数

[](#设置基础参数)

*$appid 应用id*
*$mch\_id 商铺id*
*$privatekey 秘钥*

$pay-&gt;setBasicConfiguration($appid,$mch\_id,$privatekey);

---

#### app微信支付

[](#app微信支付)

*$body 简介*
*$total 金额 单位分*
*$out\_trade\_no 订单号(自定义唯一)*
*$notify\_url 支付回调地址*

$res = $pay-&gt;APPWxPay($body, $total, $out\_trade\_no,$notify\_url);

##### 返回参数判断:

[](#返回参数判断)

$res\['code'\] == 1 成功
$res\['code'\] == 0 失败

---

#### app微信退款

[](#app微信退款)

*$weixinOrderId 商户订单号*
*$money 退款金额 单位分*
*$order\_id 退款订单 (自定义唯一)*
*$zs1 apiclient\_cert.pem 证书的地址路径*
*$zs2 apiclient\_key.pem 证书的地址路径*

$res = $pay-&gt;returnOrderId($weixinOrderId,$money,$order\_id,$zs1,$zs2);

##### 返回参数判断：

[](#返回参数判断-1)

$res\['code'\] == 1 成功
$res\['code'\] == 0 失败

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

4

Last Release

2439d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8610cc806ab6424282762b4ef98797b8b8cf8e6943135b4a4d25c15dbc2564eb?d=identicon)[tiangang](/maintainers/tiangang)

### Embed Badge

![Health badge](/badges/tiangang-phppay/health.svg)

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

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