Download the PHP package kylin987/netsale-report-sdk without Composer
On this page you can find all versions of the php package kylin987/netsale-report-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package netsale-report-sdk
netsale-report-sdk
网售票房上报 SDK(2025 协议)— 用于专资办正式票房上报,包含售票 / 退票上报和数据比对文件下载。
功能
| 方法 | 说明 |
|---|---|
reportTicket |
票房数据上报(售票 operation=1 / 退票 operation=2),一次最多 50 条 |
downloadReportRecord |
数据比对文件下载(需 V-STK p7AttachSign 签名),返回 zip 文件流 |
环境要求
- PHP >= 8.1
ext-opensslext-curl- V-STK 签名服务(
downloadReportRecord需要,通过VstkSignerInterface接入)
安装
快速开始
配置参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
reportUrl |
string | 是 | 上报接口地址(SDK 自动追加 /reportTicket) |
serviceUrl |
string | 是 | 下载接口地址(SDK 自动追加 /data/downloadReportRecord) |
channelCode |
string | 是 | 网售商编码(sendChannelCode) |
certId |
string | 是 | 证书 ID(通常等于 channelCode,V-STK 签名时使用) |
certFile |
string | 是 | 客户端证书路径(PEM 格式) |
keyFile |
string | 是 | 客户端私钥路径(PEM 格式,与证书分离) |
keyFilePwd |
string | 否 | 私钥密码(PEM 加密时使用,通常为空) |
trustFile |
string | 否 | 信任根证书路径(CA 链 PEM) |
proxy |
string | 否 | 代理地址(不填时默认禁用系统代理) |
vstkSigner |
object | 下载时必填 | V-STK 签名器,需实现 VstkSignerInterface |
httpLogger |
callable | 否 | HTTP 日志回调,接收 array 上下文 |
reportToken |
string | 否 | 业务层上报令牌(SDK 不使用,供业务层读取) |
V-STK 签名器
downloadReportRecord 需要调用 V-STK 的 p7AttachSign 方法进行签名。PHP 无法直接调用 V-STK COM 组件,通过 VstkSignerInterface 接入外部签名服务。
接口定义
HTTP 签名桥实现示例
V-STK 签名桥配置要点
- SM2 证书需设置
DigestAlg=SM3、EncAlg=SM4、asymmalg=SM2 - SSL 协议需
TLSv1.2 - PHP 端通过 HTTP 调用 Java 签名桥(如
cn.com.jit.new_vstk.AdvanceSignClient.p7AttachSign)
与 2025 协议的差异
与旧 zzb-sdk-php 的 netsale2025 模式相比:
reportTicket根级直接发送sendChannelCode+ticketList,不加业务签名downloadReportRecord需要 V-STKp7AttachSign签名- 证书只支持 PEM 格式(证书 + 私钥分离),不再处理 PFX/P12
联调脚本
包内附带冒烟测试脚本:
环境变量参见脚本头部注释。
数据模型
| 模型 | 说明 |
|---|---|
ReportTicket |
上报票据(numberByDay, ticketNo, cinemaCode, operation 等 16 个字段) |
ReportResult |
上报响应(code, status, data, traceId),isSuccess() 判断是否 code === '200' |
版本
| 版本 | 说明 |
|---|---|
| v1.0.0 | 从 zzb-sdk-php 2.x 提取 netsale2025 逻辑,独立发布 |
License
MIT
All versions of netsale-report-sdk with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.1
ext-curl Version *
ext-openssl Version *
ext-curl Version *
ext-openssl Version *
The package kylin987/netsale-report-sdk contains the following files
Loading the files please wait ...