Download the PHP package wyw1994/tonglian-pay-sdk without Composer

On this page you can find all versions of the php package wyw1994/tonglian-pay-sdk. 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 tonglian-pay-sdk

通联支付 SDK

安装

配置说明

注意:channelExtra 公共参数可以在各个接口的 params 中通过 channelExtra 参数进行覆盖,接口中的参数优先级高于公共配置。

功能列表

1. 统一下单

支付方式 wayCode 必须使用 TonglianPay\Utils\PayWayCode 类中定义的常量,常用常量包括:

  • PayWayCode::WX_JSAPI:微信JSAPI支付
  • PayWayCode::WX_NATIVE:微信扫码支付
  • PayWayCode::WX_APP:微信APP支付
  • PayWayCode::WX_H5:微信H5支付
  • PayWayCode::ALI_JSAPI:支付宝JSAPI支付
  • PayWayCode::ALI_QR:支付宝扫码支付

2. 获取小程序链接

3. 订单查询

4. 退款

5. 退款订单查询

6. 统一余额查询

7. 对账单下载

8. 支付回调处理

支付回调数据字段说明

退款回调数据字段说明

注意:

  1. 回调处理函数需要返回 'success' 字符串,否则系统会认为处理失败并重试
  2. 建议在回调处理中进行幂等性处理,避免重复处理同一笔订单
  3. 支付回调状态 state:2-支付成功
  4. 退款回调状态 state:2-退款成功,3-退款失败
  5. 所有金额单位为分
  6. 时间戳使用13位毫秒级时间戳

错误处理

所有接口都会抛出异常,您需要捕获并处理这些异常:

日志记录

SDK 使用 Monolog 进行日志记录,您可以在配置中指定日志路径和级别:

日志级别说明:

注意事项

  1. 所有金额单位为分
  2. 时间戳使用13位毫秒级时间戳
  3. 签名类型支持:MD5、RSA、SM2
  4. 回调处理需要返回 'success' 字符串
  5. 对账单下载需要在D+1日11点后进行

示例代码

更多示例代码请参考 examples 目录:


All versions of tonglian-pay-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
ext-openssl Version *
ext-json Version *
ext-mbstring Version *
monolog/monolog Version ^2.0
ext-curl 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 wyw1994/tonglian-pay-sdk contains the following files

Loading the files please wait ...