diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57872d0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/vendor/ diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..72abef0 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..c804c30 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/thinkphp5-wechat.iml b/.idea/thinkphp5-wechat.iml new file mode 100644 index 0000000..c956989 --- /dev/null +++ b/.idea/thinkphp5-wechat.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..0229f23 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,225 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + project + + + true + + + + DIRECTORY + + false + + + + + + + + + 1484192781907 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..9849076 --- /dev/null +++ b/composer.json @@ -0,0 +1,20 @@ +{ + "name": "hooklife/thinkphp5-wechat", + "description": "微信 SDK for thinkphp5, 基于 overtrue/wechat", + "keywords": ["wechat", "weixin","thinkphp5"], + "authors": [ + { + "name": "hooklife", + "email": "miaogaopeng123@gmail.com" + } + ], + "require": { + "overtrue/wechat": "~3.0" + }, + "extra": { + "think-config": { + "wechat": "src/config.php" + } + }, + "license": "Apache-2.0" +} diff --git a/src/Wechat.php b/src/Wechat.php new file mode 100644 index 0000000..6478b3a --- /dev/null +++ b/src/Wechat.php @@ -0,0 +1,24 @@ + true, + /** + * 账号基本信息,请从微信公众平台/开放平台获取 + */ + 'app_id' => 'your-app-id', // AppID + 'secret' => 'your-app-secret', // AppSecret + 'token' => 'your-token', // Token + 'aes_key' => '', // EncodingAESKey,安全模式下请一定要填写!!! + /** + * 日志配置 + * + * level: 日志级别, 可选为: + * debug/info/notice/warning/error/critical/alert/emergency + * permission:日志文件权限(可选),默认为null(若为null值,monolog会取0644) + * file:日志文件位置(绝对路径!!!),要求可写权限 + */ + 'log' => [ + 'level' => 'debug', + 'permission' => 0777, + 'file' => LOG_PATH.'easywechat.log', + ], + /** + * OAuth 配置 + * + * scopes:公众平台(snsapi_userinfo / snsapi_base),开放平台:snsapi_login + * callback:OAuth授权完成后的回调页地址 + */ + 'oauth' => [ + 'scopes' => ['snsapi_userinfo'], + 'callback' => '/examples/oauth_callback.php', + ], + /** + * 微信支付 + */ + 'payment' => [ + 'merchant_id' => 'your-mch-id', + 'key' => 'key-for-signature', + 'cert_path' => 'path/to/your/cert.pem', // XXX: 绝对路径!!!! + 'key_path' => 'path/to/your/key', // XXX: 绝对路径!!!! + // 'device_info' => '013467007045764', + // 'sub_app_id' => '', + // 'sub_merchant_id' => '', + // ... + ], + /** + * Guzzle 全局设置 + * + * 更多请参考: http://docs.guzzlephp.org/en/latest/request-options.html + */ + 'guzzle' => [ + 'timeout' => 3.0, // 超时时间(秒) + //'verify' => false, // 关掉 SSL 认证(强烈不建议!!!) + ], +]; \ No newline at end of file