Download the PHP package feihu/allinpay-tppay without Composer

On this page you can find all versions of the php package feihu/allinpay-tppay. 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 allinpay-tppay

通企付 PHP SDK

基于通联支付(通企付)的 PHP 开发包,支持微信、支付宝等多种支付方式。

安装

基本使用

内置支付方式

wayCode 说明 方法
WX_NATIVE 微信主扫 wxNative()
WX_JSAPI 微信公众号支付 wxJsapi()
ALI_QR 支付宝主扫 aliQr()
H5_CASHIER H5收银台 h5Cashier()

回调通知处理


扩展机制

SDK 采用插件化设计,支持在不修改核心代码(vendor)的情况下扩展新功能。

为什么需要扩展机制

通企付提供了大量 API(29个功能模块),而 SDK 核心仅实现了最常用的支付功能。通过扩展机制,你可以:

  1. 按需扩展 - 只实现你需要的功能
  2. 安全升级 - 升级 SDK 不会覆盖你的自定义代码
  3. 团队协作 - 不同开发者可以独立开发不同扩展

扩展架构

如何创建扩展

步骤1:创建扩展类

步骤2:注册扩展

步骤3:使用扩展方法

扩展基类提供的方法

BaseExtension 提供了以下便捷方法:

方法 说明
request($path, $params) 发送 API 请求(自动签名、验签)
buildBaseParams($params) 构建基础参数(mchNo、appId、signType等)
parseResponse($response) 解析响应(自动验签)
getConfig() 获取配置
getSignKit() 获取签名工具
getTqPay() 获取 TqPay 实例

内置扩展

SDK 内置了以下扩展,可直接使用:

OrderExtension(订单扩展)

AccountExtension(账户扩展)

SettlementExtension(分账扩展)

扩展管理方法

扩展开发最佳实践

  1. 不要修改 vendor 代码 - 所有自定义扩展应放在你的项目目录中
  2. 遵循命名规范 - 扩展类名以 Extension 结尾,如 BillExtension
  3. 单一职责 - 每个扩展只负责一个功能模块
  4. 提供文档 - 为你的扩展方法添加 PHPDoc 注释
  5. 错误处理 - 在扩展中捕获异常并返回统一格式

订单状态说明

状态码 说明
0 订单生成
1 支付中
2 支付成功
3 支付失败
5 已退款
6 订单关闭
7 预消费支付成功

金额说明

License

MIT


All versions of allinpay-tppay with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
ext-openssl Version *
ext-curl Version *
ext-json Version *
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 feihu/allinpay-tppay contains the following files

Loading the files please wait ...