Download the PHP package oyta/xyfpay without Composer

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

星驿付支付 SDK

星驿付支付中转接口 PHP SDK,支持微信、支付宝、云闪付等多种支付方式。

目录

安装

Composer 安装

手动安装

将 src 目录复制到您的项目中,并配置自动加载:

快速开始

配置说明

全局配置

可以在初始化时设置全局配置,避免每次调用都传递相同参数:

通道说明

通道代码 说明
XYF 星驿付通道
XDL 新大陆通道
不填 微信、支付宝官方通道

终端说明

终端代码 说明
mp 小程序
App APP应用
Scan 付款码支付

支付方式说明

支付方式代码 说明
WXPAY 微信支付
ALIPAY 支付宝
YLPAY 云闪付

方法说明

订单支付 (orderPay)

发起支付请求,支持小程序支付、APP支付、付款码支付等多种方式。

调用方法:

付款码支付示例:

订单查询 (orderQuery)

查询订单支付状态。

调用方法:

订单退款 (orderRefund)

对已支付的订单发起退款。

调用方法:

退款查询 (refundQuery)

查询退款状态。

调用方法:

参数说明

公共参数

参数名 类型 必填 说明
IO_Mark int N 默认为1,退款时必须填为-1(SDK自动处理)
UseChannel string Y 使用通道:XYF=星驿付,XDL=新大陆,不填=官方
PayTerminal string Y 支付终端:mp=小程序,App=APP,Scan=付款码
PayChannel string Y 支付方式:WXPAY=微信,ALIPAY=支付宝,YLPAY=云闪付
AppId string N 微信小程序或公众号AppId
AppKey string N 微信小程序密钥
MchId string Y 商户号
MchKey string N 商户密钥
MchTermNo string N 商户终端号

订单支付参数

参数名 类型 必填 说明
Latitude string N 纬度(与IP地址选填一项)
Longitude string N 经度(与IP地址选填一项)
IPAddress string N IP地址(与经纬度选填一项)
AuthCode string N 付款码(付款码支付必填)
InternalNo string Y 商户自己的订单号
Amount double Y 支付金额,单位(元)
OpenId string N 用户OpenId(JSAPI支付必填)
Subject string N 订单标题
Body string N 订单描述
Goods string N 商品明细
Goods_Tag string N 商品优惠说明
Attach string N 附加描述,如"深圳店"
NotifyUrl string N 支付成功后异步通知地址

订单查询参数

参数名 类型 必填 说明
InternalNo string Y 商户自己的订单号
ExternalNo string N 支付通道的订单流水号

订单退款参数

参数名 类型 必填 说明
RefundNo string Y 商户自己的退单订单号
RefundId string N 退款ID(App调起微信退款时必填)
RefundAmount double Y 退款金额,单位(元)
InternalNo string Y 商户自己的订单号
ExternalNo string Y 支付成功时返回的支付通道订单流水号
RefundDesc string N 退款描述
NotifyUrl string N 退款成功后异步通知地址

退款查询参数

参数名 类型 必填 说明
InternalNo string Y 商户自己的订单号
ExternalNo string N 支付通道的订单流水号

响应说明

响应字段

字段名 类型 说明
State int 交易状态:1=成功,2=支付进行中,0=失败,-1=系统异常
Code string 交易状态码
Desc string 交易状态描述
OpenNo string 支付宝交易时返回的买家支付宝账号
InternalNo string 商户自己的订单号
ExternalNo string 支付通道的订单流水号
Amount double 支付金额,单位(元)

响应方法

交易状态说明

状态值 说明
1 交易成功
2 支付进行中(如正在输入密码)
0 交易失败
-1 系统异常

异常处理

SDK 使用异常机制处理错误,建议使用 try-catch 捕获异常:

完整示例

小程序支付示例

付款码支付示例

订单查询示例

退款示例

异步通知处理

支付成功后,支付通道会向 NotifyUrl 发送异步通知。以下是处理通知的示例:

注意事项

  1. 金额单位:所有金额单位均为元,支持小数点后两位
  2. 订单号唯一:商户订单号(InternalNo)必须唯一,不能重复
  3. 退款金额:退款金额不能超过原支付金额
  4. 异步通知:建议使用异步通知处理支付结果,不要仅依赖同步返回
  5. 安全性:生产环境建议使用 HTTPS,并验证异步通知的签名
  6. 超时设置:SDK 默认超时时间为 30 秒,可根据需要修改

技术支持

如有问题,请联系技术支持或查看官方文档。

License

MIT License


All versions of xyfpay with dependencies

PHP Build Version
Package Version
No informations.
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 oyta/xyfpay contains the following files

Loading the files please wait ...