PHPackages                             easy-pay/sdk - 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. easy-pay/sdk

ActiveLibrary[Payment Processing](/categories/payments)

easy-pay/sdk
============

v0.2.2(7y ago)2612MITPHPPHP &gt;=5.6.0

Since Mar 6Pushed 7y ago1 watchersCompare

[ Source](https://github.com/sssxxxzzz/EasyPay)[ Packagist](https://packagist.org/packages/easy-pay/sdk)[ RSS](/packages/easy-pay-sdk/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (12)Used By (0)

简单使用
----

[](#简单使用)

```
require "vendor/autoload.php";

use EasyPay\Payment;
use EasyPay\PayFactory;

// 使用支付宝网页支付
$trade = PayFactory::create(Payment::ALI_WAP_PAY, [
    // 应用ID
    'app_id'            =>  '2016073100130857',
    // 用户生成的私钥证书
    'ssl_private_key'   =>  'ssl/ali/rsa1/rsa_private_key.pem',
    // 阿里提供的公钥证书
    'ali_public_key'    =>  'ssl/ali/rsa1/ali_public_key.pem',
    // 沙箱测试
    'is_sand_box'       =>  true,
]);

// EasyPay生成的支付跳转url
$url = $trade->execute([
    // 订单标题
    'subject'               =>  "ali pay test",
    // 订单详细信息
    'body'                  =>  "这是支付宝支付的测试订单",
    // 订单号(随机生成的订单号,最长为64位)
    'out_trade_no'          =>  substr(md5(uniqid()), 0, 18) . date("YmdHis"),
    // 支付金额,单位为分
    'total_amount'          =>  '1',
    // 商品类型 0—虚拟类商品，1—实物类商品
    'goods_type'            =>  '1',
    // 订单超时时间(m-分钟，h-小时，d-天，1c-当天)
    'timeout_express'       =>  '15m',
    // 支付完成后,异步通知地址
    'notify_url'            =>  'http://examples.com/',
    // 支付完后,用户返回的页面
    'return_url'            =>  'http://examples.com/',
    // 收款支付宝用户ID
    'seller_id'             =>  '',
    // 用户授权码
    'auth_token'            =>  '',
    // 销售产品码
    'product_code'          =>  '',
    // 公用回传参数
    'passback_params'       =>  '',
    // 优惠参数
    'promo_params'          =>  '',
    // 业务扩展参数(详细请查看接口文档)
    'extend_params'         =>  '',
    // 指定用户支付渠道,通过","进行分隔
    'enable_pay_channels'   =>  '',
    // 指定用户不可用的渠道,通过","进行分隔
    'disable_pay_channels'  =>  '',
    // 商户门店编号
    'store_id'              =>  '',
]);

// 支付宝支付方式为生成收银台url,然后跳转,由用户进行支付
header("Location: {$url}");
```

```
use EasyPay\Payment;
use EasyPay\PayFactory;

// 使用微信扫码支付
$trade = PayFactory::create(Payment::WX_QR_PAY, [
    // 应用id
    'appid'             =>  '',
    // 应用密钥
    'key'               =>  '',
    // 商户ID
    'mch_id'            =>  '',
    // 回调地址
    'notify_url'        =>  '',
    // ssl证书路径
    'ssl_cert_path'     =>  '',
    // ssl密钥路径
    'ssl_key_path'      =>  '',
]);

// 支付信息
$trade->attach           = 'wechat pay test';
// 支付订单信息
$trade->body             = '微信扫码支付,测试订单';
// 支付订单号
$trade->out_trade_no     = substr(md5(uniqid()), 0, 18) . date("YmdHis");
// 支付金额,单位为分
$trade->total_fee        = '1';
// 客户端IP
$trade->spbill_create_ip = $_SERVER['REMOTE_ADDR'];
// 商品id
$trade->product_id       = '123';

// EasyPay生成的支付跳转url
$url = $trade->execute();

// 生成二维码
$qrCode = (new Endroid\QrCode\QrCode($url))->setSize(300);
header('Content-Type: image/png');
echo $qrCode->get('png');
```

获取通知信息
------

[](#获取通知信息)

```
use EasyPay\Notify;

// 获取微信通知信息
$notify = Notify::get('wechat');
// 获取支付宝通知信息
$notify = Notify::get('ali');
```

可以通过laravel,symfony,psr-7的request对象来构建通知消息对象

> $notify = Notify::get(string $service, array $options\[, Symfony\\Component\\HttpFoundation\\Request | Illuminate\\Http\\Request | Psr\\Http\\Message\\RequestInterface $request = null\]);

Todo
----

[](#todo)

- 将RSA加密分离为单独的库,同时添加密钥解析
- 文档待补充
- App支付

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

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

Recently: every ~32 days

Total

9

Last Release

2676d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/755ad6fc19e3debf94bfe59b23b134b06d92c16a989411f0f38553b18c7a107f?d=identicon)[rayson](/maintainers/rayson)

---

Top Contributors

[![rayson-x](https://avatars.githubusercontent.com/u/17398068?v=4)](https://github.com/rayson-x "rayson-x (42 commits)")

---

Tags

alipaypaymentwechat-pay

### Embed Badge

![Health badge](/badges/easy-pay-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/easy-pay-sdk/health.svg)](https://phpackages.com/packages/easy-pay-sdk)
```

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