Download the PHP package qinii/wechat-official-account without Composer
On this page you can find all versions of the php package qinii/wechat-official-account. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download qinii/wechat-official-account
More information about qinii/wechat-official-account
Files in qinii/wechat-official-account
Package wechat-official-account
Short Description 基于 EasyWeChat 6 的微信公众号能力扩展包
License MulanPSL-2.0
Informations about the package wechat-official-account
Qinii WeChat Official Account
基于 EasyWeChat 6 的微信公众号扩展包,提供 CRMEB 当前真实使用的公众号能力,并复用 qinii/wechat-core 的多账号配置和 HTTP 客户端。
环境要求
- PHP 8.0 及以上
- EasyWeChat 6.19.1 及以上
qinii/wechat-core
安装
配置
配置按账号组组织,公众号配置固定放在 official_account 节点。secret、appsecret 和 app_secret 均可使用,内部统一转换为 EasyWeChat 需要的 secret。
使用依赖注入时,可以直接注入 ConfigResolver:
公共能力
Swoole 环境可以直接注入 wechat-core 提供的客户端:
扩展包会为注入的客户端补充微信 API 基础地址。OAuth 换取 token 和获取授权用户资料同样使用该客户端,不会绕回 Guzzle/cURL。
网页授权
用户和 JS-SDK
菜单和二维码
永久素材
模板消息
已经完整组装微信参数时,可以使用 sendRaw()。
模板库管理接口可以用于项目自己的模板同步流程:
扩展包只负责调用微信接口,不绑定项目数据库或模板配置。项目中的模板同步接口可以先读取自己的模板配置,再调用上述接口完成删除、添加和保存模板 ID。
客服消息
消息回调和自动回复
Server 接收 PSR-7 ServerRequestInterface。普通 PHP 环境可以直接传入请求,Swoole 环境必须传入当前协程对应的请求,避免复用其他请求状态。
支持的被动回复构造方法:
回调处理会执行:
- 明文模式
signature校验; - 安全模式 URL 校验字符串解密;
- 安全模式消息验签、AES 解密和加密回复;
- 微信服务器 URL 验证响应。
AES 能力直接复用 EasyWeChat,不在扩展包中自行实现签名或加解密算法。
功能范围
完整的方法列表和暂未实现功能见 功能清单。
All versions of wechat-official-account with dependencies
nyholm/psr7 Version ^1.5
psr/http-message Version ^1.0 || ^2.0
psr/simple-cache Version ^1.0 || ^2.0 || ^3.0
qinii/wechat-core Version ^1.0.0
symfony/http-client-contracts Version ^3.0
w7corp/easywechat Version ^6.19.1