{"id":19011676,"url":"https://github.com/zoujingli/weopendeveloper","last_synced_at":"2025-04-07T12:10:44.669Z","repository":{"id":57091995,"uuid":"119936399","full_name":"zoujingli/WeOpenDeveloper","owner":"zoujingli","description":"【新】微信开发工具（开放平台）","archived":false,"fork":false,"pushed_at":"2023-11-17T05:47:47.000Z","size":51,"stargazers_count":88,"open_issues_count":1,"forks_count":33,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-31T11:04:06.138Z","etag":null,"topics":["wechat","weopen"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zoujingli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-02T05:28:28.000Z","updated_at":"2025-02-06T07:54:02.000Z","dependencies_parsed_at":"2024-06-18T21:36:18.005Z","dependency_job_id":"b460f411-1d15-4747-aca6-756c301bcd12","html_url":"https://github.com/zoujingli/WeOpenDeveloper","commit_stats":{"total_commits":61,"total_committers":3,"mean_commits":"20.333333333333332","dds":"0.032786885245901676","last_synced_commit":"4d0d3c064e54556621453845fc65ba52de58a880"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoujingli%2FWeOpenDeveloper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoujingli%2FWeOpenDeveloper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoujingli%2FWeOpenDeveloper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoujingli%2FWeOpenDeveloper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zoujingli","download_url":"https://codeload.github.com/zoujingli/WeOpenDeveloper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247648977,"owners_count":20972945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["wechat","weopen"],"created_at":"2024-11-08T19:15:23.159Z","updated_at":"2025-04-07T12:10:44.650Z","avatar_url":"https://github.com/zoujingli.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Latest Stable Version](https://poser.pugx.org/zoujingli/weopen-developer/v/stable)](https://packagist.org/packages/zoujingli/weopen-developer) \n[![Latest Unstable Version](https://poser.pugx.org/zoujingli/weopen-developer/v/unstable)](https://packagist.org/packages/zoujingli/weopen-developer) \n[![Total Downloads](https://poser.pugx.org/zoujingli/weopen-developer/downloads)](https://packagist.org/packages/zoujingli/weopen-developer) \n[![License](https://poser.pugx.org/zoujingli/weopen-developer/license)](https://packagist.org/packages/zoujingli/weopen-developer)\n\n# WeOpenDeveloper\nWeOpenDeveloper 为微信开放平台服务开发工具，基于 WeChatDeveloper 可对公众号进行管理。\n更多功能可以参考下面的文档。\n\nDocumentation\n--\nPHP开发技术交流（QQ群 513350915）\n\n[![PHP微信开发群 (SDK)](http://pub.idqqimg.com/wpa/images/group.png)](http://shang.qq.com/wpa/qunwpa?idkey=ae25cf789dafbef62e50a980ffc31242f150bc61a61164458216dd98c411832a) \n\n\u003e WeChatDeveloper 是基于官方接口封装，在做微信开发前，必需先阅读微信官方文档。\n\u003e* 微信官方文档：http://mp.weixin.qq.com/wiki\n\u003e* 开放平台文档：https://open.weixin.qq.com\n\u003e* 商户支付文档：https://pay.weixin.qq.com/wiki/doc/api/index.html\n\n\u003e 针对 WeChatDeveloper 也有一准备了帮助资料可供参考。\n\u003e* WeChatDeveloper 文档：http://www.kancloud.cn/zoujingli/wechat-developer\n\nRepository\n--\n WeOpenDeveloper 为开源项目，允许把它用于任何地方，不受任何约束，欢迎 fork 项目。\n\u003e* GitHub 托管地址：https://github.com/zoujingli/WeOpenDeveloper\n\u003e* OSChina 托管地址：http://git.oschina.net/zoujingli/WeOpenDeveloper\n\n更多开发可以参考项目 [ThinkService](https://github.com/zoujingli/ThinkService) 。\n此项目已经实现对接，[ThinkAdmin](https://github.com/zoujingli/ThinkAdmin) + [ThinkService](https://github.com/zoujingli/ThinkService) 组合。\n\nInstall\n--\n* 通过 Composer 来管理安装\n```shell\n# 首次安装 线上版本（稳定）\ncomposer require zoujingli/weopen-developer\n\n# 首次安装 开发版本 \ncomposer require zoujingli/weopen-developer dev-master\n\n# 更新 WeChatDeveloper\ncomposer update zoujingli/weopen-developer\n```\n\n* 接口实例所需参数\n```php\n\n// 配置参数（可以公众号服务平台获取）\n$config = [\n    'component_appid'          =\u003e 'wx4e63e993e222df8d',\n    'component_token'          =\u003e 'P8QHTIxpBEq88IrxatqhgpBm2OAQROkI',\n    'component_appsecret'      =\u003e '7cfa1afa87a41e2ea3445cea015c0974',\n    'component_encodingaeskey' =\u003e 'L5uFIa0U6KLalPyXckyqoVIJYLhsfrg8k9YzybZIHsx',\n];\n\n// 注册授权公众号 AccessToken 处理\n$config['GetAccessTokenCallback'] = function ($authorizer_appid) use ($config) {\n    $open = new \\WeOpen\\Service($config);\n    $authorizer_refresh_token = ''; // 通过$authorizer_appid从数据库去找吧，在授权绑定的时候获取\n    $result = $open-\u003erefreshAccessToken($authorizer_appid, $authorizer_refresh_token);\n    if (empty($result['authorizer_access_token'])) {\n        throw new \\WeChat\\Exceptions\\InvalidResponseException($result['errmsg'], '0');\n    }\n    $data = [\n        'authorizer_access_token'  =\u003e $result['authorizer_access_token'],\n        'authorizer_refresh_token' =\u003e $result['authorizer_refresh_token'],\n    ];\n    // 需要把$data记录到数据库\n    return $result['authorizer_access_token'];\n};\n```\n\n* Ticket 接收处理\n```php\n\ntry{\n\n    // 实例公众号服务接口\n    $server = new \\WeOpen\\Service($config);\n    \n    // 获取并更新Ticket推送\n    if (!($data = $server-\u003egetComonentTicket())) {\n        return \"Ticket event handling failed.\";\n    }\n    \n} catch (Exception $e) {\n\n    // 出错啦，处理下吧\n    echo $e-\u003egetMessage() . PHP_EOL;\n\n}\n```\n\n* 实例指定接口\n```php\ntry{\n\n    // 实例公众号服务接口\n    $open = new \\WeOpen\\Service($config);\n    \n    // 获取公众号接口操作实例\n    $wechat = $open-\u003einstance('User', 'wx60a43dd8161666d4');\n    \n    // 获取公众号粉丝列表\n    $list = $wechat-\u003egetUserList();\n    var_export($list);\n    \n} catch (Exception $e) {\n\n    // 出错啦，处理下吧\n    echo $e-\u003egetMessage() . PHP_EOL;\n\n}\n\n```\n\nCopyright\n--\n* WeOpenDeveloper 基于`MIT`协议发布，任何人可以用在任何地方，不受约束\n* WeOpenDeveloper 部分代码来自互联网，若有异议，可以联系作者进行删除\n\n\nSponsor\n--\n![赞助](http://static.thinkadmin.top/pay.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoujingli%2Fweopendeveloper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzoujingli%2Fweopendeveloper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoujingli%2Fweopendeveloper/lists"}