From 8c37018011da80527256b066d43c857399da1518 Mon Sep 17 00:00:00 2001 From: lanzu_qsy <334039090@qq.com> Date: Tue, 11 Aug 2020 14:06:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BC=81=E4=B8=9A=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/LanzuMpInfoController.php | 25 +- app/Admin/routes.php | 1 + composer.json | 3 +- composer.lock | 643 +++++++++++++++++- config/wechat.php | 131 ++++ public/certs/apiclient_cert.pem | 24 + public/certs/apiclient_key.pem | 28 + 7 files changed, 852 insertions(+), 3 deletions(-) create mode 100644 config/wechat.php create mode 100644 public/certs/apiclient_cert.pem create mode 100644 public/certs/apiclient_key.pem diff --git a/app/Admin/Controllers/LanzuMpInfoController.php b/app/Admin/Controllers/LanzuMpInfoController.php index 6fb44ba..0d687dd 100644 --- a/app/Admin/Controllers/LanzuMpInfoController.php +++ b/app/Admin/Controllers/LanzuMpInfoController.php @@ -12,6 +12,7 @@ use Dcat\Admin\Form; use Dcat\Admin\Grid; use Dcat\Admin\Show; use Dcat\Admin\Controllers\AdminController; +use EasyWeChat\Factory; use Encore\Admin\Grid\Displayers\Actions; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Hash; @@ -68,7 +69,29 @@ class LanzuMpInfoController extends AdminController public function test() { - echo 11; + $config = [ + // 必要配置 + 'app_id' => 'wxf66ed55b54d7f942', + 'mch_id' => '1536995001', + 'key' => 'lazywisdom8888888888888888888888', // API 密钥 + + // 如需使用敏感接口(如退款、发送红包等)需要配置 API 证书路径(登录商户平台下载 API 证书) + 'cert_path' => './certs/apiclient_cert.pem', // XXX: 绝对路径!!!! + 'key_path' => './certs/apiclient_key.pem', // XXX: 绝对路径!!!! + + 'notify_url' => '默认的订单回调地址', // 你也可以在下单时单独设置来想覆盖它 + ]; + + $app = Factory::payment($config); + $res = $app->transfer->toBalance([ + 'partner_trade_no' => '1233455', // 商户订单号,需保持唯一性(只能是字母或者数字,不能包含有符号) + 'openid' => 'ojbLs4otqY74RjlVHLlywoaLS5t8', + 'check_name' => 'NO_CHECK', // NO_CHECK:不校验真实姓名, FORCE_CHECK:强校验真实姓名 + 're_user_name' => '王小帅', // 如果 check_name 设置为FORCE_CHECK,则必填用户真实姓名 + 'amount' => 1, // 企业付款金额,单位为分 + 'desc' => '测试', // 企业付款操作说明信息。必填 + ]); + dd($res); } diff --git a/app/Admin/routes.php b/app/Admin/routes.php index 82dbcf8..7af0aad 100644 --- a/app/Admin/routes.php +++ b/app/Admin/routes.php @@ -15,6 +15,7 @@ Route::group([ $router->get('/', 'HomeController@index'); $router->resource('/speaker', 'LanzuServiceSpeakerController'); $router->resource('/mp', 'LanzuMpInfoController'); + $router->any('/mp_test', 'LanzuMpInfoController@test'); $router->resource('/mm', 'LanzuMmInfoController'); $router->resource('/market', 'ImsCjdcMarketController'); $router->resource('/mp_withdraw', 'LanzuMpWithdrawController'); diff --git a/composer.json b/composer.json index a918050..f795599 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,8 @@ "guzzlehttp/guzzle": "^6.3", "iidestiny/laravel-filesystem-oss": "^2.0", "laravel/framework": "^7.0", - "laravel/tinker": "^2.0" + "laravel/tinker": "^2.0", + "overtrue/laravel-wechat": "~5.0" }, "require-dev": { "facade/ignition": "^2.0", diff --git a/composer.lock b/composer.lock index 631071f..b7905c0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e6c7615960e10e0e6c86b86b3a49a061", + "content-hash": "b3d2ad98d7c44d90fdb1789d0ac90e0f", "packages": [ { "name": "aliyuncs/oss-sdk-php", @@ -755,6 +755,56 @@ ], "time": "2019-03-31T00:38:28+00:00" }, + { + "name": "easywechat-composer/easywechat-composer", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/mingyoung/easywechat-composer.git", + "reference": "93cfce1ec842b9a5b1b0791a52afd18b833f114a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mingyoung/easywechat-composer/zipball/93cfce1ec842b9a5b1b0791a52afd18b833f114a", + "reference": "93cfce1ec842b9a5b1b0791a52afd18b833f114a", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=7.0" + }, + "require-dev": { + "composer/composer": "^1.0 || ^2.0", + "phpunit/phpunit": "^6.5 || ^7.0" + }, + "type": "composer-plugin", + "extra": { + "class": "EasyWeChatComposer\\Plugin" + }, + "autoload": { + "psr-4": { + "EasyWeChatComposer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "张铭阳", + "email": "mingyoungcheung@gmail.com" + } + ], + "description": "The composer plugin for EasyWeChat", + "time": "2020-07-23T11:06:47+00:00" + }, { "name": "egulias/email-validator", "version": "2.1.18", @@ -1964,6 +2014,198 @@ ], "time": "2020-06-17T14:59:55+00:00" }, + { + "name": "overtrue/laravel-wechat", + "version": "5.0.7", + "source": { + "type": "git", + "url": "https://github.com/overtrue/laravel-wechat.git", + "reference": "feb3eca83910dac425390aaabcd89896686b9c34" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/overtrue/laravel-wechat/zipball/feb3eca83910dac425390aaabcd89896686b9c34", + "reference": "feb3eca83910dac425390aaabcd89896686b9c34", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "illuminate/container": "^5.1 || ^6.0 || ^7.0", + "overtrue/wechat": "^4.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Overtrue\\LaravelWeChat\\ServiceProvider" + ], + "aliases": { + "EasyWeChat": "Overtrue\\LaravelWeChat\\Facade" + } + } + }, + "autoload": { + "psr-4": { + "Overtrue\\LaravelWeChat\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "overtrue", + "email": "anzhengchao@gmail.com" + } + ], + "description": "微信 SDK for Laravel", + "keywords": [ + "laravel", + "sdk", + "wechat", + "weixin" + ], + "time": "2020-07-28T04:23:13+00:00" + }, + { + "name": "overtrue/socialite", + "version": "2.0.16", + "source": { + "type": "git", + "url": "https://github.com/overtrue/socialite.git", + "reference": "bbcd8ffd2e1f3aa7c4d5298c56c6d73803aa3067" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/overtrue/socialite/zipball/bbcd8ffd2e1f3aa7c4d5298c56c6d73803aa3067", + "reference": "bbcd8ffd2e1f3aa7c4d5298c56c6d73803aa3067", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "ext-json": "*", + "guzzlehttp/guzzle": "~5.0|~6.0", + "php": ">=7.0", + "symfony/http-foundation": "^2.7|^3.0|^4.0|^5.0" + }, + "conflict": { + "socialiteproviders/weixin": "*" + }, + "require-dev": { + "mockery/mockery": "~1.2", + "phpunit/phpunit": "~6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Overtrue\\Socialite\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "overtrue", + "email": "anzhengchao@gmail.com" + } + ], + "description": "A collection of OAuth 2 packages that extracts from laravel/socialite.", + "keywords": [ + "login", + "oauth", + "qq", + "social", + "wechat", + "weibo" + ], + "time": "2020-03-04T15:22:25+00:00" + }, + { + "name": "overtrue/wechat", + "version": "4.2.30", + "source": { + "type": "git", + "url": "https://github.com/overtrue/wechat.git", + "reference": "708dbc84eea25e249e4cb6d01f6bcb95a6cad116" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/overtrue/wechat/zipball/708dbc84eea25e249e4cb6d01f6bcb95a6cad116", + "reference": "708dbc84eea25e249e4cb6d01f6bcb95a6cad116", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "easywechat-composer/easywechat-composer": "^1.1", + "ext-fileinfo": "*", + "ext-openssl": "*", + "ext-simplexml": "*", + "guzzlehttp/guzzle": "^6.2 || ^7.0", + "monolog/monolog": "^1.22 || ^2.0", + "overtrue/socialite": "~2.0", + "php": ">=7.2", + "pimple/pimple": "^3.0", + "psr/simple-cache": "^1.0", + "symfony/cache": "^3.3 || ^4.3 || ^5.0", + "symfony/event-dispatcher": "^4.3 || ^5.0", + "symfony/http-foundation": "^2.7 || ^3.0 || ^4.0 || ^5.0", + "symfony/psr-http-message-bridge": "^0.3 || ^1.0 || ^2.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.15", + "mikey179/vfsstream": "^1.6", + "mockery/mockery": "^1.2.3", + "phpstan/phpstan": "^0.12.0", + "phpunit/phpunit": "^7.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "EasyWeChat\\": "src/" + }, + "files": [ + "src/Kernel/Support/Helpers.php", + "src/Kernel/Helpers.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "overtrue", + "email": "anzhengchao@gmail.com" + } + ], + "description": "微信SDK", + "keywords": [ + "easywechat", + "sdk", + "wechat", + "weixin", + "weixin-sdk" + ], + "time": "2020-07-29T07:36:50+00:00" + }, { "name": "paragonie/random_compat", "version": "v9.99.99", @@ -2076,6 +2318,114 @@ ], "time": "2020-07-20T17:29:33+00:00" }, + { + "name": "pimple/pimple", + "version": "v3.3.0", + "source": { + "type": "git", + "url": "https://github.com/silexphp/Pimple.git", + "reference": "e55d12f9d6a0e7f9c85992b73df1267f46279930" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/silexphp/Pimple/zipball/e55d12f9d6a0e7f9c85992b73df1267f46279930", + "reference": "e55d12f9d6a0e7f9c85992b73df1267f46279930", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": "^7.2.5", + "psr/container": "^1.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^3.4|^4.4|^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3.x-dev" + } + }, + "autoload": { + "psr-0": { + "Pimple": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Pimple, a simple Dependency Injection Container", + "homepage": "https://pimple.symfony.com", + "keywords": [ + "container", + "dependency injection" + ], + "time": "2020-03-03T09:12:48+00:00" + }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "time": "2016-08-06T20:24:11+00:00" + }, { "name": "psr/container", "version": "1.0.0", @@ -2749,6 +3099,160 @@ ], "time": "2019-11-12T09:31:26+00:00" }, + { + "name": "symfony/cache", + "version": "v5.1.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache.git", + "reference": "a9ac09a5e9786b734a4baa98158c2cd3251f1e4c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache/zipball/a9ac09a5e9786b734a4baa98158c2cd3251f1e4c", + "reference": "a9ac09a5e9786b734a4baa98158c2cd3251f1e4c", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.2.5", + "psr/cache": "~1.0", + "psr/log": "~1.0", + "symfony/cache-contracts": "^1.1.7|^2", + "symfony/polyfill-php80": "^1.15", + "symfony/service-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0" + }, + "conflict": { + "doctrine/dbal": "<2.5", + "symfony/dependency-injection": "<4.4", + "symfony/http-kernel": "<4.4", + "symfony/var-dumper": "<4.4" + }, + "provide": { + "psr/cache-implementation": "1.0", + "psr/simple-cache-implementation": "1.0", + "symfony/cache-implementation": "1.0" + }, + "require-dev": { + "cache/integration-tests": "dev-master", + "doctrine/cache": "^1.6", + "doctrine/dbal": "^2.5|^3.0", + "predis/predis": "^1.1", + "psr/simple-cache": "^1.0", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/var-dumper": "^4.4|^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Cache\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Cache component with PSR-6, PSR-16, and tags", + "homepage": "https://symfony.com", + "keywords": [ + "caching", + "psr6" + ], + "time": "2020-07-23T17:22:30+00:00" + }, + { + "name": "symfony/cache-contracts", + "version": "v2.1.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache-contracts.git", + "reference": "9771a09d2e6b84ecb8c9f0a7dbc72ee92aeba009" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/9771a09d2e6b84ecb8c9f0a7dbc72ee92aeba009", + "reference": "9771a09d2e6b84ecb8c9f0a7dbc72ee92aeba009", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.2.5", + "psr/cache": "^1.0" + }, + "suggest": { + "symfony/cache-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Cache\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to caching", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2020-07-06T13:23:11+00:00" + }, { "name": "symfony/console", "version": "v5.1.3", @@ -4278,6 +4782,76 @@ "homepage": "https://symfony.com", "time": "2020-07-23T08:36:24+00:00" }, + { + "name": "symfony/psr-http-message-bridge", + "version": "v2.0.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/psr-http-message-bridge.git", + "reference": "e44f249afab496b4e8c0f7461fb8140eaa4b24d2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/e44f249afab496b4e8c0f7461fb8140eaa4b24d2", + "reference": "e44f249afab496b4e8c0f7461fb8140eaa4b24d2", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0", + "symfony/http-foundation": "^4.4 || ^5.0" + }, + "require-dev": { + "nyholm/psr7": "^1.1", + "symfony/phpunit-bridge": "^4.4 || ^5.0" + }, + "suggest": { + "nyholm/psr7": "For a super lightweight PSR-7/17 implementation" + }, + "type": "symfony-bridge", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Bridge\\PsrHttpMessage\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "PSR HTTP message bridge", + "homepage": "http://symfony.com", + "keywords": [ + "http", + "http-message", + "psr-17", + "psr-7" + ], + "time": "2020-06-25T08:21:47+00:00" + }, { "name": "symfony/routing", "version": "v5.1.3", @@ -4740,6 +5314,73 @@ ], "time": "2020-06-24T13:36:18+00:00" }, + { + "name": "symfony/var-exporter", + "version": "v5.1.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-exporter.git", + "reference": "eabaabfe1485ca955c5b53307eade15ccda57a15" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/eabaabfe1485ca955c5b53307eade15ccda57a15", + "reference": "eabaabfe1485ca955c5b53307eade15ccda57a15", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.15" + }, + "require-dev": { + "symfony/var-dumper": "^4.4.9|^5.0.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\VarExporter\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A blend of var_export() + serialize() to turn any serializable data structure to plain PHP code", + "homepage": "https://symfony.com", + "keywords": [ + "clone", + "construct", + "export", + "hydrate", + "instantiate", + "serialize" + ], + "time": "2020-06-07T15:42:22+00:00" + }, { "name": "tijsverkoyen/css-to-inline-styles", "version": "2.2.3", diff --git a/config/wechat.php b/config/wechat.php new file mode 100644 index 0000000..63550bd --- /dev/null +++ b/config/wechat.php @@ -0,0 +1,131 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +return [ + /* + * 默认配置,将会合并到各模块中 + */ + 'defaults' => [ + /* + * 指定 API 调用返回结果的类型:array(default)/collection/object/raw/自定义类名 + */ + 'response_type' => 'array', + + /* + * 使用 Laravel 的缓存系统 + */ + 'use_laravel_cache' => true, + + /* + * 日志配置 + * + * level: 日志级别,可选为: + * debug/info/notice/warning/error/critical/alert/emergency + * file:日志文件位置(绝对路径!!!),要求可写权限 + */ + 'log' => [ + 'level' => env('WECHAT_LOG_LEVEL', 'debug'), + 'file' => env('WECHAT_LOG_FILE', storage_path('logs/wechat.log')), + ], + ], + + /* + * 路由配置 + */ + 'route' => [ + /* + * 开放平台第三方平台路由配置 + */ + // 'open_platform' => [ + // 'uri' => 'serve', + // 'action' => Overtrue\LaravelWeChat\Controllers\OpenPlatformController::class, + // 'attributes' => [ + // 'prefix' => 'open-platform', + // 'middleware' => null, + // ], + // ], + ], + + /* + * 公众号 + */ + 'official_account' => [ + 'default' => [ + 'app_id' => env('WECHAT_OFFICIAL_ACCOUNT_APPID', 'your-app-id'), // AppID + 'secret' => env('WECHAT_OFFICIAL_ACCOUNT_SECRET', 'your-app-secret'), // AppSecret + 'token' => env('WECHAT_OFFICIAL_ACCOUNT_TOKEN', 'your-token'), // Token + 'aes_key' => env('WECHAT_OFFICIAL_ACCOUNT_AES_KEY', ''), // EncodingAESKey + + /* + * OAuth 配置 + * + * scopes:公众平台(snsapi_userinfo / snsapi_base),开放平台:snsapi_login + * callback:OAuth授权完成后的回调页地址(如果使用中间件,则随便填写。。。) + */ + // 'oauth' => [ + // 'scopes' => array_map('trim', explode(',', env('WECHAT_OFFICIAL_ACCOUNT_OAUTH_SCOPES', 'snsapi_userinfo'))), + // 'callback' => env('WECHAT_OFFICIAL_ACCOUNT_OAUTH_CALLBACK', '/examples/oauth_callback.php'), + // ], + ], + ], + + /* + * 开放平台第三方平台 + */ + // 'open_platform' => [ + // 'default' => [ + // 'app_id' => env('WECHAT_OPEN_PLATFORM_APPID', ''), + // 'secret' => env('WECHAT_OPEN_PLATFORM_SECRET', ''), + // 'token' => env('WECHAT_OPEN_PLATFORM_TOKEN', ''), + // 'aes_key' => env('WECHAT_OPEN_PLATFORM_AES_KEY', ''), + // ], + // ], + + /* + * 小程序 + */ + // 'mini_program' => [ + // 'default' => [ + // 'app_id' => env('WECHAT_MINI_PROGRAM_APPID', ''), + // 'secret' => env('WECHAT_MINI_PROGRAM_SECRET', ''), + // 'token' => env('WECHAT_MINI_PROGRAM_TOKEN', ''), + // 'aes_key' => env('WECHAT_MINI_PROGRAM_AES_KEY', ''), + // ], + // ], + + /* + * 微信支付 + */ + // 'payment' => [ + // 'default' => [ + // 'sandbox' => env('WECHAT_PAYMENT_SANDBOX', false), + // 'app_id' => env('WECHAT_PAYMENT_APPID', ''), + // 'mch_id' => env('WECHAT_PAYMENT_MCH_ID', 'your-mch-id'), + // 'key' => env('WECHAT_PAYMENT_KEY', 'key-for-signature'), + // 'cert_path' => env('WECHAT_PAYMENT_CERT_PATH', 'path/to/cert/apiclient_cert.pem'), // XXX: 绝对路径!!!! + // 'key_path' => env('WECHAT_PAYMENT_KEY_PATH', 'path/to/cert/apiclient_key.pem'), // XXX: 绝对路径!!!! + // 'notify_url' => 'http://example.com/payments/wechat-notify', // 默认支付结果通知地址 + // ], + // // ... + // ], + + /* + * 企业微信 + */ + // 'work' => [ + // 'default' => [ + // 'corp_id' => 'xxxxxxxxxxxxxxxxx', + // 'agent_id' => 100020, + // 'secret' => env('WECHAT_WORK_AGENT_CONTACTS_SECRET', ''), + // //... + // ], + // ], +]; diff --git a/public/certs/apiclient_cert.pem b/public/certs/apiclient_cert.pem new file mode 100644 index 0000000..e24c151 --- /dev/null +++ b/public/certs/apiclient_cert.pem @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIID8DCCAtigAwIBAgIUEYU+F3SrdAr6PSoL1bq5FnEsveQwDQYJKoZIhvcNAQEL +BQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT +FFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg +Q0EwHhcNMjAwNTEzMDIyNTE0WhcNMjUwNTEyMDIyNTE0WjCBgTETMBEGA1UEAwwK +MTUzNjk5NTAwMTEbMBkGA1UECgwS5b6u5L+h5ZWG5oi357O757ufMS0wKwYDVQQL +DCTlub/opb/mh5Lml4/nlJ/mtLvnp5HmioDmnInpmZDlhazlj7gxCzAJBgNVBAYM +AkNOMREwDwYDVQQHDAhTaGVuWmhlbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBAJ+t2UVuxiUmvpB6rcWo6xeV2EWRifYVANhL9QFzh5k2mNrMrY4sUT9b +4ilQKnd+ojrBrM2NpoGT1bm6uvDuG3FKRJpZ9xdQRxqGIJ4yfqBe4R3NnTUbmTEb +dK6uRrri4c2urd+JOnFpMg08sCU17uYeCMNRkDTJ5qeM/WdXOIBZHKLyig28SuyG +E4SDR/YnhSr0dxPD6BtiEdyNPien2bQyNyrHqEpQPduDI1yNFiBHHvE0Abo43JHD +q6uavq652UDLlIsDLbWwZl7nNNM9AuhBFtBfKuAnFlbkeAGWOzbvPqLdWL971buU +pl21rBJYVURnDn1jRCv8ojlCm03QA5kCAwEAAaOBgTB/MAkGA1UdEwQCMAAwCwYD +VR0PBAQDAgTwMGUGA1UdHwReMFwwWqBYoFaGVGh0dHA6Ly9ldmNhLml0cnVzLmNv +bS5jbi9wdWJsaWMvaXRydXNjcmw/Q0E9MUJENDIyMEU1MERCQzA0QjA2QUQzOTc1 +NDk4NDZDMDFDM0U4RUJEMjANBgkqhkiG9w0BAQsFAAOCAQEAlQ7wtl6w0BiT23fh +8A8w1Vbebp6MU31fXFrPh7TjtWBs4Hr3Az1OjgdQsve0KFDXqwG6a6dUnCS4Qw+v +fXe/By7YNaL0R7q+lVkASwhWkFpXjR24yUGT+pmcKeugJXTSM531FFCXE096IMdG +43kVLyFdfzNpN7IpMXpdW3WMVcosKXMHLVw2RmDUlKPecxxi3QBg73CnqjDdYGOX +ZdqvTwDQgpEsIMK0++/uUC5u9EQYc8JIP9FdNxJJV5dHHnB3YO+LpaKRJHFwMK9/ +EBcWT1gtO2TfwHEBHWsYOBwynQMRvglTP2fHJx02UmqUX7Xetz3tTGWrUyvb31ss +fJXzFA== +-----END CERTIFICATE----- \ No newline at end of file diff --git a/public/certs/apiclient_key.pem b/public/certs/apiclient_key.pem new file mode 100644 index 0000000..e1427be --- /dev/null +++ b/public/certs/apiclient_key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCfrdlFbsYlJr6Q +eq3FqOsXldhFkYn2FQDYS/UBc4eZNpjazK2OLFE/W+IpUCp3fqI6wazNjaaBk9W5 +urrw7htxSkSaWfcXUEcahiCeMn6gXuEdzZ01G5kxG3Surka64uHNrq3fiTpxaTIN +PLAlNe7mHgjDUZA0yeanjP1nVziAWRyi8ooNvErshhOEg0f2J4Uq9HcTw+gbYhHc +jT4np9m0Mjcqx6hKUD3bgyNcjRYgRx7xNAG6ONyRw6urmr6uudlAy5SLAy21sGZe +5zTTPQLoQRbQXyrgJxZW5HgBljs27z6i3Vi/e9W7lKZdtawSWFVEZw59Y0Qr/KI5 +QptN0AOZAgMBAAECggEBAJFQ61wu1ZBV1DM0EhTCB0Dtk2asbntO3ff6GDx74Tlj +4HOutXufhUk923JxjFQ3IHiMbTCb6p4d5fEiqKI+bycIyaoWmbHT0wGmcuTFW0uj +TQeMabc9KIryS5v06lWFyK0gfQfjoRY4/93gDwWuMX2mc58dCTmhTJHK04pKbBcQ +kbfoxIOAeWRv+yBjw9jpbR3bIEWW41491G0JTvOoaFPY2EAN45TrcxPcZuN4Ozwy +reUIEea8Ur0Pxu1GaD9LiIuvB7HDrbMn6Yr5xDmSi5p4L2LuRNPczSly7XXbnBGM +uzH0n7oGMo3K42P6WuoAObm0iswmegAumkg6V3Z9ggECgYEA0NfrJ1sGhWv/vT63 +LV2+X+lnE8dMsCGo14llaGOUcHGbyTIfzkz6jZ+ibC47HGC+B1WnY7V3gjuyYSg4 +5HfLcf6XxvZWxnXifBZOX0JEeBsfnauvIXS9ZjjjuSvOpMYKTZhEbwBsUroTcZu4 +Rr2WGv/6ggWLw2IJO2i8jI006GECgYEAw7wDKzBvaJz+a2xjvY2Ug7tvTGjBYpWY +xErFBt+/IMnH3huEVrpwf3w0P6ZwZ6DulBOJJ1ecyPE2x6VPrlKx1NgDY4p6Sfsc +x0oENGcXlDJwICJErezCBvdP21dMfnn9kUTnhfCEO8NAfZpC+EV5KmdAGrPgcF9T ++dJMSO9WBjkCgYAAutBqicnjC3aQTbjMIsi4gxNGIWsmLmftoOBG1ho9rlfyAwfT +a7dwaT9jC2JPfhML6YO1OHwba2P7LO3N9pEya8ZR/qhc9yp8boOFl7CvjsC0h1YM +UuEai1ZYXkvRjZOZo8+RZ7n5LAdHXVjuflkY7Q4OCEDtxNjtaTdHcnLd4QKBgBgC +bQUUOOZFM7QrpIRw5IHQMRPXWbllDkstvMNeGMzF0518FJyq2/fXXXVdTjZ3+Cvz +xYQs7A99/zE4JvEENcodATVpnByND/emLaPb7XmBQl2+tlv7ScWe+o22RKzS+/ag +1CGK4j2Ocs+1Z3ea1gUMi0F7RRGjr+JaGH9t1EiJAoGAAn7A8x1N3wWC/f+YoRBS +cD4BSo7e3Dkb+I58W5C8t2QKtQ1MO86SFWh260US4Oc7PJMOUuQ4MCZMU+MDytUj +kSJ1k3RFk39SW0IHrcXjbsFamlvh/SdOASa7SUhK+WDlfnAdjsCfZqBB525NWTQb +e1EFl0d2GElUQw+IMVXECX8= +-----END PRIVATE KEY----- \ No newline at end of file