Download the PHP package oephpopen/allinpay-syb without Composer

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

oephpopen/allinpay-syb

通联收银宝(Allinpay SYB)聚合收单 SDK — PHP 7.2+,零框架依赖,可独立发布 Composer。

支持接口:统一支付(微信/支付宝/云闪付/数字人民币 扫码、JS、APP、微信小程序)、统一查询统一退款统一撤销统一交易关单聚合收银台(onepay)H5 收银台(unionorder)异步结果通知验签

签名算法:RSA(SHA1WithRSA)与 RSA2(SHA256WithRSA)开箱即用;SM2 与 SM4 已预留(SM4 已含纯 PHP 实现,SM2 需第三方国密实现)。

官方入口

对接、开通账号请访问:

环境要求

安装

发布到 Packagist 后:

统一返回(ret / msg / data)

业务方法(pay / query / refund / cancel / close / onepay / unionOrder / handleNotify)统一返回:

业务方法不抛出异常;底层方法 execute() 返回 ApiResponse 并可抛出 SDK 异常(ApiException / SignException / AllinpayException),如需原始响应可自行调用。

错误码(OephpOpen\AllinpaySyb\ResultCode

errcode 常量 含义 msg
CONFIG_INCOMPLETE 关键配置缺失(密钥/cusid/appid/sign_type) 支付配置不完整
ENV_INVALID 环境值非法 支付环境配置非法
PARAM_INVALID 业务参数不合法 请求参数不合法
SIGN_FAILED 请求签名失败(商户私钥问题) 请求签名失败
VERIFY_FAILED 响应/通知验签失败 签名校验失败
RESPONSE_INVALID 网关响应非法(非 JSON 等) 支付服务响应异常
NETWORK_ERROR 传输层失败(网络/cURL) 网络请求失败,请稍后重试
GATEWAY_REJECTED 网关返回业务失败(retcode != SUCCESS) 支付服务处理失败
INTERNAL_ERROR 未知异常 系统繁忙,请稍后再试

快速开始

1. 配置

凭证从后台/数据库注入(不要写死在代码里,尤其商户私钥):

2. 客户端

3. 下单(统一支付)

常用 paytype:

4. 聚合收银台(PC / H5)

H5 自动选支付方式使用 $client->unionOrder([...])

5. 查询 / 退款 / 撤销 / 关单

判断交易结果统一看 data.trxstatus

6. 异步通知

通知字段均做了 UTF-8 urlencode;用 web 容器接收会自动解码,读原始流需自行 urldecode。

敏感字段加密(SM4)

签名规范(对应官方「接口安全规范」)

  1. 取除 sign 外的所有非空字段;
  2. 按字段名 ASCII 升序排序;
  3. 拼接为 key1=value1&key2=value2
  4. RSA:用商户私钥 SHA1WithRSA 签名后 base64(RSA2 用 SHA256WithRSA);SM2:SM3WithSM2(预留);
  5. 响应与异步通知用通联平台公钥验签,失败一律不处理。

测试

主流程测试脚本共享 tests/bootstrap.php(自动加载 SDK、生成临时 RSA 密钥对、用 FakeHttp 模拟网关完成 签名→请求→验签 全链路,不发起真实网络请求)。

接口清单

方法 接口 生产地址
pay() 统一支付 https://vsp.allinpay.com/apiweb/unitorder/pay
query() 统一查询 https://vsp.allinpay.com/apiweb/tranx/query
refund() 统一退款 https://vsp.allinpay.com/apiweb/tranx/refund
cancel() 统一撤销 https://vsp.allinpay.com/apiweb/tranx/cancel
close() 统一交易关单 https://vsp.allinpay.com/apiweb/tranx/close
onepay() 聚合收银台 https://syb.allinpay.com/apiweb/h5unionpay/onepay
unionOrder() H5 收银台 https://syb.allinpay.com/apiweb/h5unionpay/unionorder

测试环境统一走 https://syb-test.allinpay.com

License

MIT


All versions of allinpay-syb with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
ext-openssl 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 oephpopen/allinpay-syb contains the following files

Loading the files please wait ...