5 Star 16 Fork 7

深圳优创智投科技有限公司 / think-easywechat

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

介绍

微信SDK For ThinkPHP 6.0+ 基于overtrue/wechat easywechat SDK for ThinkPHP6.0 增加小程序云开发、微信支付服务商、第三方平台批量代云开发等接口

软件架构

软件架构说明

安装

Composer安装

composer require uctoo/think-easywechat:dev-master

Git安装

https://github.com/uctoo/think-easywechathttps://gitee.com/UCT/think-easywechat

配置

  1. 修改配置文件 修改项目根目录下extra/wechat.php中对应的参数

  2. 每个模块基本都支持多账号,默认为 default。

  3. 根据各自应用系统的情况初始化SDK

使用

接受普通消息

新建一个Controller,我这边用的是Official


获得SDK实例

使用facade

use uctoo\ThinkEasyWeChat\Facade;

$officialAccount = Facade::officialAccount();  // 公众号
$work = Facade::work(); // 企业微信
$payment = Facade::payment(); // 微信支付
$openPlatform = Facade::openPlatform(); // 开放平台
$miniProgram = Facade::miniProgram(); // 小程序  

以上均支持传入自定义账号:例如

$officialAccount = Facade::officialAccount('test'); // 公众号

以上均支持传入自定义账号+配置(注:这里的config和配置文件中账号的格式相同):例如

$officialAccount = Facade::officialAccount('',$config); // 公众号

微信第三方平台

新建一个Controller,微信第三方平台授权事件接收URL我这边用的是wechatopen\authevent

开发说明

  1. 建议采用微信第三方平台方式进行微信相关功能开发,好处很多。

更多 SDK 的具体使用请参考:https://gitee.com/uctoo/uctoo/ 由于easywechat原SDK的http client未实现PUT方法,本SDK第三方平台批量代云开发部分使用http PUT方法的接口引入了 https://gitee.com/jaguarjack/catchAdmin 项目中的http client类,请开发者自行参考。

参考资料

交流群

QQ群:984748053,使用疑问,开发,贡献代码请加群。

建议

近年微信生态已增加了很多新的能力,而且自2015年微信推出微信开放平台第三方开发方式以来,第三方开发方式逐渐流行,特别2017年小程序发布以来,第三方平台成为小程序的主要服务提供方式,建议采用第三方平台方式进行开发。

捐赠

如果觉得think-easywechat对你有帮助,欢迎请作者一杯咖啡

捐赠wechat

License

MIT

MIT License Copyright (c) 2020 UCT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

easywechat SDK 5 适配 ThinkPHP6 展开 收起
PHP
MIT
取消

发行版 (1)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/UCT/think-easywechat.git
git@gitee.com:UCT/think-easywechat.git
UCT
think-easywechat
think-easywechat
master

搜索帮助