Download the PHP package wop-platform/wop-php-sdk without Composer

On this page you can find all versions of the php package wop-platform/wop-php-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 wop-php-sdk

WOP PHP SDK

Packagist PHP 8.2+ Release CI Coverage CodeRabbit Pull Request Reviews

WOP · 万联易达开放平台 官方 PHP SDK —— 协议与黄金向量真源:wop-specs

WOP 网关商户侧官方 PHP 客户端库:封装协议核心(结构化签名 / 内容摘要 / L2 数字信封 / 验签解密), 商户无需理解 canonicalRequest、套件推导与线上字节格式即可安全对接。

快速开始

RequestDraft::headers 为 name => value 关联数组;curl 需要 "$name: $value" 头行、 Guzzle 适配器直接接受数组——GuzzleTransport::send() 内部完成转换。

密钥准备(D12 分发契约)

用途 格式
RSA 公钥(SPKI) X.509 SubjectPublicKeyInfo DER 的 Base64 单行,或等价 PEM(-----BEGIN PUBLIC KEY----- 包装)
RSA 私钥(PKCS8) PKCS#8 DER 的 Base64 单行,或等价 PEM(-----BEGIN PRIVATE KEY----- 包装)

L0 + L2 示例

L0(明文 + 摘要 + 签名):buildRequest(method, path, $body, 'L0') —— 有 body 时自动生成 x-wop-content-digest: sha-256 <小写hex>(恰一空格),无 body(GET)则该头缺席; digest 与 x-wop-appkey/x-wop-nonce/x-wop-timestamp 一并进入 signedHeaders(协议不变式 I1)。

L2(全文数字信封):buildRequest(method, path, $body, 'L2') —— CSPRNG 生成 32B DEK + 12B IV,AES-256-GCM 加密 body(密文 = ciphertext||tag 尾拼), DEK 载荷 AES-256-GCM$b64url(key)$b64url(iv) 经 RSA-OAEP(显式双 SHA-256 + 空 label)包装后 置于 x-wop-encrypt: L2;dek=<b64url>;digest 改为对密文载体字节计算(D2)。 L2 wire body 恒为 JSON 信封 {"encrypted":"<base64url 密文>"}(与网关 CryptoFilter 线上契约一致); 入向解密时提取 encrypted 字段(容忍未知字段),非法结构/缺字段按协议类错误明确拒绝。

回调验证:verifyCallback($headers, $body, $callbackUrl) —— canonical URI 取回调 URL 的 path。

向量自测(conformance)

错误处理与模糊化(I7)

依赖说明

依赖 角色
phpseclib/phpseclib ^3.0 唯一运行时密码库:RSA 签名 + OAEP(必须走它——openssl 扩展 OAEP 的 MGF1 写死 SHA-1,不满足 F2 钉子)
ext-openssl(suggest) L2 信封 AES-256-GCM bulk 加解密(tag 独立出参,本 SDK 完成尾拼)
ext-curl(suggest) CurlTransport 默认适配器
guzzlehttp/guzzle(suggest) GuzzleTransport peer 适配器(不污染核心依赖面)

国密路线图(SM2-SM3 套件)

本版(0.1.0)按 SDK spec §1.2(裁决 Q7)仅支持 RSA 套件;WOP-SM2-SM3 配置与报文 将明确抛出 WopException("SM2-SM3 套件暂未支持,见 README 路线图")。

计划中的国密支持(SM3withSM2 裸 r‖s 64B / SM4-GCM / SM2 C1C3C2)将以纯 PHP 实现交付, 黄金向量 fixture 已全量就位(tests/fixtures/crypto-vectors.json 的 SM 段当前作为 "必须拒"负测试消费),届时无需变更协议层。欢迎在 issue 中反馈需求优先级。

🧩 WOP 生态导航 | Ecosystem

类别 组件
协议与向量真源 wop-specs —— crypto-strategy-spec · wop-sdk-spec · 黄金测试向量
官方 SDK(六语言) Java · Go · Python · PHP · .NET · TypeScript
浏览器工作台 wop-web-tools —— 密钥生成 · 报文联调 · 国密 · 六语言代码片段
Agent 技能包 wop-skills —— 零代码调用 · 联调对拍 · 62 错误码排错
平台服务(企业内部) 统一接入网关 · 核心逻辑服务 · 回调服务 · 开发者门户 · 文档中心

License

MIT(见 LICENSE)。


All versions of wop-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
phpseclib/phpseclib Version ^3.0
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 wop-platform/wop-php-sdk contains the following files

Loading the files please wait ...