WeChatDeveloper/_test/pay-v3-config.php
2025-03-03 21:55:56 +08:00

82 lines
3.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +----------------------------------------------------------------------
// | WeChatDeveloper
// +----------------------------------------------------------------------
// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ]
// +----------------------------------------------------------------------
// | 官方网站: https://thinkadmin.top
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// | 免责声明 ( https://thinkadmin.top/disclaimer )
// +----------------------------------------------------------------------
// | gitee 代码仓库https://gitee.com/zoujingli/WeChatDeveloper
// | github 代码仓库https://github.com/zoujingli/WeChatDeveloper
// +----------------------------------------------------------------------
$certPublic = <<<CERT
-----BEGIN CERTIFICATE-----
文件文本内容
-----END CERTIFICATE-----
CERT;
$certPrivate = <<<CERT
-----BEGIN PRIVATE KEY-----
文件文本内容
-----END PRIVATE KEY-----
CERT;
// 支付证书内容
$certPayment = <<<CERT
-----BEGIN PUBLIC KEY-----
文件文本内容
-----END PUBLIC KEY-----
CERT;
// =====================================================
// 配置缓存处理函数 ( 适配其他环境 )
// -----------------------------------------------------
// 数据缓存 (set|get|del) 操作可以将缓存写到任意位置或Redis
// 文件缓存 (put) 只能写在本地服务器,还需要返回可读的文件路径
// 未配置自定义缓存处理机制时,默认在 cache_path 写入文件缓存
// // =====================================================
// \WeChat\Contracts\Tools::$cache_callable = [
// 'set' => function ($name, $value, $expired = 360) {
// var_dump(func_get_args());
// return $value;
// },
// 'get' => function ($name) {
// var_dump(func_get_args());
// return $value;
// },
// 'del' => function ($name) {
// var_dump(func_get_args());
// return true;
// },
// 'put' => function ($name) {
// var_dump(func_get_args());
// return $filePath;
// },
// ];
return [
// 可选公众号APPID
'appid' => 'wx3760axxxxxxxxxxx',
// 必填微信商户编号ID
'mch_id' => '152xxxxxxxx',
// 必填微信商户V3接口密钥
'mch_v3_key' => '98b7f45xxxxxxxxxxxxxxxxxxxxxxxxxx',
// 可选,微信商户证书序列号,可从公钥中提取,请求签名使用
'cert_serial' => '49055xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
// 必填,微信商户证书公钥,支持证书内容或文件路径,仅用于提取序号
'cert_public' => $certPublic,
// 必填,微信商户证书私钥,支持证书内容或文件路径,用于请求数据签名
'cert_private' => $certPrivate,
// 可选,微信平台证书序号或支付证书序号,用于接口请求序号
'mp_cert_serial' => 'PUB_KEY_ID_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
// 可选,微信平台证书内容或支付证书内容
'mp_cert_content' => $certPayment,
// 可选,运行时的文件缓存路径
'cache_path' => ''
];