PHPackages                             gatepay-io/gatepay.io-php - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. gatepay-io/gatepay.io-php

ActiveLibrary[HTTP &amp; Networking](/categories/http)

gatepay-io/gatepay.io-php
=========================

gatepay rpc client for php

1.0.1(7y ago)5132PHP

Since Apr 30Pushed 7y ago1 watchersCompare

[ Source](https://github.com/gatepay-io/gatepay.io-php)[ Packagist](https://packagist.org/packages/gatepay-io/gatepay.io-php)[ RSS](/packages/gatepay-io-gatepayio-php/feed)WikiDiscussions master Synced 4d ago

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

gatepay.io-php
==============

[](#gatepayio-php)

gatepay.io php sdk

[![home](https://camo.githubusercontent.com/a736971d1fdfe1282401fdb1dcc1a08086dba4b01fb3526bd798b3ce666ebdff/68747470733a2f2f676174657061792e6761746563646e2e636f6d2f7374617469632f746865646f63732f312e332e312f6173736574732f696d672f62616e6e65725f61646d696e2e706e67)](https://camo.githubusercontent.com/a736971d1fdfe1282401fdb1dcc1a08086dba4b01fb3526bd798b3ce666ebdff/68747470733a2f2f676174657061792e6761746563646e2e636f6d2f7374617469632f746865646f63732f312e332e312f6173736574732f696d672f62616e6e65725f61646d696e2e706e67)

这是一个个人收款系统Gatepay.io 提供的收款接口，如果你是一个开发者或者站长或者知识付费、内容创造的从业人员，对你会有帮助。

这个系统主要特点就是零费率和点对点即时到账到自己的收款微信或者支付宝上，不参与具体的交易细节。

\--------------------——准备工作开始-----------------------------------

在使用这个SDK之前需要去gatepay.io 注册一个账户，然后在管理后台-&gt;账户配置里填写几个必填的选项。

1. 支付成功后回调地址, 作用是 如果收款成功了，会跳转到你预先设定的一个通知地址，如果是做一个会员充值的应用， 那么这个通知地址的作用就是给会员加钱。
2. 支付成功后前台跳转地址，作用是 如果收款成功了，这个页面要跳转到哪里去，如果是做一个会员充值的应用，那么这个前台跳转地址应该是跳转到会员中心的首页或者钱包的首页。
3. 用户支付后未到账（可能超时付款），支付页面显示的反馈按钮链接， 这个就是如果用户支付超时，则页面跳转到哪里去，这个可填可不填

[![help_01](https://camo.githubusercontent.com/da02a8ed25b8c7599b9ba91020d42911cf481b695cdb4766011bb2e988e988d8/68747470733a2f2f676174657061792e6761746563646e2e636f6d2f6173736574732f696d672f68656c702f68656c705f30312e706e67)](https://camo.githubusercontent.com/da02a8ed25b8c7599b9ba91020d42911cf481b695cdb4766011bb2e988e988d8/68747470733a2f2f676174657061792e6761746563646e2e636f6d2f6173736574732f696d672f68656c702f68656c705f30312e706e67)

4. 个人任意金额支付宝二维码, 手机支付宝-&gt;收钱-&gt;不填金额-&gt;保存图片，上传到后台就可以了。
5. 个人任意金额微信二维码，手机微信-&gt;我-&gt;支付-&gt;收付款-&gt;二维码收款-&gt;不填金额-&gt;保存图片，上传到后台就可以了。
6. 支付宝ID,手机支付宝扫描下面的二维码，填写到后台即可。

[![help_02](https://camo.githubusercontent.com/aa860786aed041b650102728f67f861723c883b7e467f730c0d01d1dffce44ae/68747470733a2f2f676174657061792e6761746563646e2e636f6d2f6173736574732f696d672f68656c702f68656c705f30322e706e67)](https://camo.githubusercontent.com/aa860786aed041b650102728f67f861723c883b7e467f730c0d01d1dffce44ae/68747470733a2f2f676174657061792e6761746563646e2e636f6d2f6173736574732f696d672f68656c702f68656c705f30322e706e67)

\---------------------准备工作结束-------------------------------------

接下来我们讲讲这个sdk怎么耍起来，先是在你的应用的composer里新增这个sdk

```
composer require gatepay-io/gatepay.io-php
```

然后在入口的位置声明使用类

```
  require_once './autoload.php';
  use \gatepayio\Api;
  $api = new Api();
```

现在进入正题，gatepay提供三种接口，分别是anypay，stablepay，grouppay，不论哪种接口，我们都需要使用gatepay后台提供我们的appkey和appsecret。

```
$appkey = 'your appkey from gatepay';
$appsecret = 'your appsecret from gatepay';
```

1. 任意金额支付 anypay,

这个主要的特点是：金额是任意的，无需后台提前上传二维码，填写商品啥的。比如你的应用是不固定价格的服务，比如充值会员的服务，想充多少充多少。那这个比较合适搞。

调用也很简单：

```
$price = 1.00; //要充值的金额，随便填，这里我写的1块钱
$out_order_id = uniqid(); //你的系统产生的订单号，这里演示 就是搞随机函数生成了一个单号
$custom = 'terry'; //这个字段是自定义的字段，比如要充值给你的网站哪个用户， 我这里填写的是充值给我的客户名叫terry的那个家伙。
$type = 'wechat'; //这个很明显了，支付方式，这里填的是微信， 如果是支付宝，填写alipay。
//组装参数
$params = [
  'price'=>$price,
  'type'=>$type,
  'out_order_id'=>$out_order_id,
  'custom'=>$custom,
];
//开始支付请求(分别是:授权->签名->组装生成连接->请求)
$response = $api->auth($appkey,$appsecret)->sign($params)->route('anypay','create')->request();
//做下判断，看看是否生成成功，
//print_r($response);
if($response && $response['code']==100){
  //生成支付连接成功了，
    $pay_url = $response['data']['pay_url'];//支付的连接
    //跳转到gatepay那里去支付
    header("location:".$pay_url);
}
else{
  //出了问题？
    if($response){
      echo $response['msg'];
    }
    else{
      echo '服务器开了点小差~~';
    }
}
```

2.固定商品支付 stablepay,

这个主要的特点是，先要去管理后台-&gt;产品卡密-&gt;产品管理里创建一个产品，然后上传支付宝微信二维码。

然后在管理后台-&gt;产品卡密-&gt;卡密管理 里导入这个产品的卡密。

感觉是很麻烦，但是这个stablepay 可以帮我们做到销售卡密的过程，比如你要卖什么xxx影视会员点卡之类，对接这个api就可以。

直接上代码：

```
$product_id = 8; //产品的编号(ID)， 这个在管理后台->产品卡密->产品管理里可以看到。
$out_order_id = uniqid(); //你的系统产生的订单号，这里演示 就是搞随机函数生成了一个单号
$custom = 'terry'; //这个字段是自定义的字段，比如要充值给你的网站哪个用户， 我这里填写的是充值给我的客户名叫terry的那个家伙。
$type = 'wechat'; //这个很明显了，支付方式，这里填的是微信， 如果是支付宝，填写alipay。
//组装参数
$params = [
  'product_id'=>$product_id,
  'type'=>$type,
  'out_order_id'=>$out_order_id,
  'custom'=>$custom,
];
//开始支付请求(分别是:授权->签名->组装生成连接->请求)
$response = $api->auth($appkey,$appsecret)->sign($params)->route('stablepay','create')->request();
//做下判断，看看是否生成成功，
//print_r($response);
if($response && $response['code']==100){
  //生成支付连接成功了，
    $pay_url = $response['data']['pay_url'];//支付的连接
    //跳转到gatepay那里去支付
    header("location:".$pay_url);
}
else{
  //出了问题？
    if($response){
      echo $response['msg'];
    }
    else{
      echo '服务器开了点小差~~';
    }
}
```

3. 组合商品支付 grouppay,

可以实现对多个固定商品 组合后进行支付， 如果你想实现 一些组合出售的需求，可以使用这个接口。

直接上代码

```
$fields = '8:1,7:2';//代表产品ID为8的购买1件，产品ID为7的购买2件
$out_order_id = uniqid(); //你的系统产生的订单号，这里演示 就是搞随机函数生成了一个单号
$custom = 'terry'; //这个字段是自定义的字段，比如要充值给你的网站哪个用户， 我这里填写的是充值给我的客户名叫terry的那个家伙。
$type = 'wechat'; //这个很明显了，支付方式，这里填的是微信， 如果是支付宝，填写alipay。
//组装参数
$params = [
  'fields'=>$fields,
  'type'=>$type,
  'out_order_id'=>$out_order_id,
  'custom'=>$custom,
];
//开始支付请求(分别是:授权->签名->组装生成连接->请求)
$response = $api->auth($appkey,$appsecret)->sign($params)->route('grouppay','create')->request();
//做下判断，看看是否生成成功，
//print_r($response);
if($response && $response['code']==100){
  //生成支付连接成功了，
    $pay_url = $response['data']['pay_url'];//支付的连接
    //跳转到gatepay那里去支付
    header("location:".$pay_url);
}
else{
  //出了问题？
    if($response){
      echo $response['msg'];
    }
    else{
      echo '服务器开了点小差~~';
    }
}
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 95.7% 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

2572d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5bf5bdf79b7577f211179dcd67384f8a0a48d4c8a740746c6bc2940c1ab51145?d=identicon)[iterrypeng](/maintainers/iterrypeng)

---

Top Contributors

[![iterrypeng](https://avatars.githubusercontent.com/u/7263001?v=4)](https://github.com/iterrypeng "iterrypeng (22 commits)")[![gatebe](https://avatars.githubusercontent.com/u/89851817?v=4)](https://github.com/gatebe "gatebe (1 commits)")

### Embed Badge

![Health badge](/badges/gatepay-io-gatepayio-php/health.svg)

```
[![Health](https://phpackages.com/badges/gatepay-io-gatepayio-php/health.svg)](https://phpackages.com/packages/gatepay-io-gatepayio-php)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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