Download the PHP package kode/pays without Composer

On this page you can find all versions of the php package kode/pays. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pays

Kode Pays SDK

Kode Pays 是一个面向 PHP 8.3+ 的企业级多平台聚合支付 SDK,支持微信、支付宝、云闪付、抖音支付、美团支付、京东支付、快手支付、QQ 支付、支付宝国际版、PayPal、Stripe、Square、Adyen、Amazon Pay、Klarna、Wise、Revolut、Payoneer、Apple Pay、Google Pay、HitPay、Xendit 等国内外主流支付渠道。采用事件驱动、管道中间件、门面模式等现代架构设计,让开发者能够快速、安全、可扩展地接入各种支付能力。

特性

环境要求

安装

可选扩展(推荐)

快速开始

门面模式快速接入

统一入口:一个方法调用任意平台

不论接入的是哪个平台、调用的是标准方法还是各平台「特色方法」,都可以通过统一入口 Pay::call() 完成,无需关心具体网关类:

新增一个支付平台也只需「一次登记」即可纳入统一入口:

支付宝

PayPal

Stripe

Square

Adyen

美团支付

京东支付

快手支付

Apple Pay

Google Pay

Amazon Pay

Klarna

支付宝国际版

Wise

Revolut

Payoneer

聚合支付(多渠道自动切换)

沙箱环境管理

事件系统

异步通知处理

协程并发处理(需安装 kode/fibers 或 Swoole)

分账插件

订阅支付插件

支持 Stripe、PayPal、Square(完整六方法)以及支付宝周期扣款、微信支付 V2 委托代扣、 Adyen Recurring(受平台端点限制不支持暂停 / 恢复)。国内平台的 createSubscription 返回签约跳转链接,签约后需商户按周期主动扣款:

详见 订阅能力设计。

转账插件

对账插件

退款插件

红包插件

个人收款插件

支持网关:微信(wechat)、微信 V3(wechat_v3)、支付宝(alipay)、云闪付(unionpay)、Stripe(stripe)、PayPal(paypal)、Square(square)、Revolut(revolut)。 各平台个人收款实现路径不同:微信/支付宝走原生收款码;云闪付走后台交易二维码消费 + 代付;PayPal 走发票(Invoicing)二维码 + Payouts 提现;Square 走 Online Checkout Quick Pay;Revolut 走 Merchant Orders + 复用转账接口;Stripe 走 Checkout Session + Payouts 提现。 注意:云闪付无交易列表接口,queryRecords 需逐笔传入 out_trade_no;Square 无主动提现能力,withdraw 会抛出「无此方法」异常。

统一收款码路由器

针对多用户扫码场景,提供一个二维码兼容多支付通道的聚合收款方案:

详见 docs/personal-receive-verifier.md。

自动结算插件

资金操作约束验证

异常处理

支持的支付网关

网关 标识 支持场景
微信支付 wechat JSAPI、Native、App、H5、小程序、委托代扣(papay)
微信小程序虚拟支付 wechat_virtual 虚拟商品道具直购(short_series_goods)、代币充值/扣币/退款/赠送、对账、发货回执
支付宝 alipay 电脑网站、手机网站、App、小程序、当面付、周期扣款
云闪付 unionpay App、H5、小程序、二维码、个人收款(二维码消费)、代付提现
抖音支付 douyin App、小程序
美团支付 meituan App、外卖、小程序
京东支付 jd App、网页、白条
快手支付 kuaishou App、小程序
QQ 支付 qq QQ 钱包、扫码支付、JSAPI 支付
支付宝国际版 alipay_global 跨境支付、Alipay+
PayPal paypal Checkout、订阅、个人收款(发票二维码、Payouts 提现)
Stripe stripe PaymentIntent、Checkout Session、退款、个人收款、提现(Payouts)
Square square 在线支付、订单管理、Subscriptions、个人收款(Quick Pay)
Adyen adyen 全球 200+ 国家、250+ 支付方式、Recurring 代扣
Amazon Pay amazon 亚马逊账户支付
Klarna klarna 先买后付、分期付款
Apple Pay apple iOS App、网页、手表
Google Pay google Android App、网页
Wise wise 跨境汇款、50+ 货币
Revolut revolut 数字银行支付、卡支付、Apple Pay、Google Pay、个人收款(Merchant Orders)、转账提现
Payoneer payoneer 跨境 B2B 支付、200+ 国家
Coinbase Commerce coinbase 加密货币支付(BTC/ETH/USDT/USDC 等)
Afterpay/Clearpay afterpay 先买后付(BNPL)、4 期免息
HitPay hitpay 新加坡本地支付、东南亚多国家(PayNow/DuitNow/PromptPay/QRIS)
Xendit xendit 东南亚聚合支付(印尼/菲律宾/马来西亚/泰国/越南)
聚合支付 aggregate 多渠道自动路由、失败切换

架构设计

开发规范

本项目遵循 PSR-12 代码规范,使用 declare(strict_types=1) 严格模式。

性能与压测

SDK 提供零网络的微基准套件,用于回归对比热路径吞吐(请求分发、签名/验签、清单反射等):

基准采用 Guzzle MockHandler 模拟零延迟响应,仅测量 SDK 自身开销;实测数据与运行方式见 docs/performance.md。发布前建议运行并与历史数据对比,捕捉显著回退。

生态扩展

Kode Pays SDK 预留了与 kode 系列组件的集成扩展点:

扩展包 功能 集成方式
kode/tools 二维码生成、图片处理 支付码生成
kode/di 依赖注入容器 网关/中间件自动注入
kode/cache 缓存、分布式锁 订单防重、缓存证书
kode/database ORM、分库分表 订单持久化
kode/fibers 协程支持 异步通知并发处理
kode/process 多进程支持 批量任务处理
kode/parallel 多线程支持 并行计算
kode/exception 异常处理增强 异常链追踪、分布式监控上报
kode/facade 门面模式增强 静态代理
kode/limiting 限流保护 支付接口限流(令牌桶/漏桶/滑动窗口)
kode/event 事件总线增强 增强事件分发能力
monolog/monolog PSR-3 日志 支付日志记录

文档导航

完整文档请访问 docs/ 目录:

文档 说明
docs/index.md 文档总览与导航
docs/quickstart.md 快速开始(5 分钟接入)
docs/architecture.md 架构详解与设计模式
docs/development.md 开发指南(新增网关/插件/测试)
docs/plugins.md 插件体系总览
docs/wechat.md 微信支付接入文档
docs/wechat-virtual.md 微信小程序虚拟支付(xpay)接入文档
docs/alipay.md 支付宝接入文档
docs/aggregate.md 聚合支付接入文档
docs/personal-receive-verifier.md 个人收款验证器(进程内/后台进程抓取)
docs/performance.md 性能与压测数据(热路径基准、运行方式、优化要点)
docs/unified-qr-entry.md 统一收款码路由器(一码聚合多通道 + 后台监控)

各网关接入文档完整列表见 docs/index.md。

License

Apache-2.0 License


All versions of pays with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
ext-json Version *
ext-openssl Version *
guzzlehttp/guzzle Version ^7.8
psr/log Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kode/pays contains the following files

Loading the files please wait ...