PHPackages                             nason/xrtpay - 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. nason/xrtpay

ActiveLibrary[Payment Processing](/categories/payments)

nason/xrtpay
============

xrtpay

v0.0.9(4y ago)011MITPHPPHP &gt;=7.0

Since Jul 16Pushed 4y ago1 watchersCompare

[ Source](https://github.com/nason-ma/xrtpay)[ Packagist](https://packagist.org/packages/nason/xrtpay)[ RSS](/packages/nason-xrtpay/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

 xrtpay
========

[](#-xrtpay-)

 信瑞泰支付.

[![StyleCI build status](https://camo.githubusercontent.com/26b102a79b1b3f845fabe75d79ff973ee75ac65a655543b95c6183d5b79b2fb3/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3338363137373239392f736869656c64)](https://camo.githubusercontent.com/26b102a79b1b3f845fabe75d79ff973ee75ac65a655543b95c6183d5b79b2fb3/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3338363137373239392f736869656c64)[![GitHub](https://camo.githubusercontent.com/508bbaf9fde8aafb239e3fba4330ceed80cd3b15df5cb245a1aaf0e7608b075a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6e61736f6e2d6d612f7872747061793f6c6162656c3d6c6963656e7365)](https://camo.githubusercontent.com/508bbaf9fde8aafb239e3fba4330ceed80cd3b15df5cb245a1aaf0e7608b075a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6e61736f6e2d6d612f7872747061793f6c6162656c3d6c6963656e7365)[![GitHub release (latest by date)](https://camo.githubusercontent.com/437492ce5b29c14dd73f5e0aec25f8175e0434d705e00d728fada620b30733b8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6e61736f6e2d6d612f787274706179)](https://camo.githubusercontent.com/437492ce5b29c14dd73f5e0aec25f8175e0434d705e00d728fada620b30733b8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6e61736f6e2d6d612f787274706179)

安装
--

[](#安装)

```
$ composer require nason/xrtpay -vvv
```

配置
--

[](#配置)

在使用本扩展之前，需要获取到信瑞泰支付的相关秘钥，需要开通微信支付。

使用
--

[](#使用)

```
use Nason\Xrtpay\Weixin\WeixinJsPay;
use Nason\Xrtpay\Xrtpay;

$payOptions = [
    'mch_id'        => 'xxxxxxxxxx', // 信瑞泰商户号
    'sub_appid'     => 'xxxxxxxxxx', // 微信公众号或者微信小程序 appid
    'notify_url'    => 'http://127.0.0.1/notify', // 接收支付回调通知的url，需绝对路径，255字符内
    'out_trade_no'  => 'xxxxxxxxxx', // 商户订单号
    'body'          => '测试商品', // 商品描述
    'sub_openid'    => 'xxxxxxxxxx', // 用户 openid
    'total_fee'     => '123', // 支付金额，单位：分
    'mch_create_ip' => '127.0.0.1', // 订单生成的机器 IP
];
// 信瑞泰密钥
$key = 'xxxxxxxxxx';

$weixinJsPay = new WeixinJsPay($key, $payOptions);
// 可设置其他非必需参数
$weixinJsPay->attach('product')->raw()->limitCreditPay();

try {
    $result = Xrtpay::pay($weixinJsPay);
} catch (\Exception $e) {
    // todo
}
```

获取公众账号 JS 支付 url
----------------

[](#获取公众账号-js-支付-url)

```
use Nason\Xrtpay\Weixin\WeixinJsPay;

$jsUrl = WeixinJsPay::getJsPayUrl($tokenId);
```

关闭支付订单
------

[](#关闭支付订单)

```
use Nason\Xrtpay\XrtpayReverse;

$options = [
    'mch_id'       => 'xxxxxxxxxx', // 信瑞泰商户号
    'out_trade_no' => 'xxxxxxxxxx', // 商户订单号
];
// 信瑞泰密钥
$key = 'xxxxxxxxxx';

$xrtpayReverse = new XrtpayReverse($key, $options);
$result = $xrtpayReverse->reverse();
```

支付回调验签
------

[](#支付回调验签)

```
use Nason\Xrtpay\Xrtpay;

// 信瑞泰密钥
$key = 'xxxxxxxxxx';
// 信瑞泰回调通知数据
$notifyData = [];

// true or false
$result = Xrtpay::verifySign($key, $notifyData);
```

其他
--

[](#其他)

- 自己看着代码用吧，反正也就几个文件。

参考
--

[](#参考)

- [信瑞泰支付文档](http://doc.xrtinfo.com/docs/trade_and_orders/trade_and_orders-1bnl0kibtrvd6)

Contributing
------------

[](#contributing)

You can contribute in one of three ways:

1. File bug reports using the [issue tracker](https://github.com/nason/xrtpay/issues).
2. Answer questions or fix bugs on the [issue tracker](https://github.com/nason/xrtpay/issues).
3. Contribute new features or update the wiki.

*The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.*

License
-------

[](#license)

MIT

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1766d ago

### Community

Maintainers

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

---

Top Contributors

[![nason-ma](https://avatars.githubusercontent.com/u/64300557?v=4)](https://github.com/nason-ma "nason-ma (25 commits)")

### Embed Badge

![Health badge](/badges/nason-xrtpay/health.svg)

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

###  Alternatives

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

PHPackages © 2026

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