refactor(pay): 将微信支付配置统一收敛至epay插件管理
- epay插件配置:在config.php/config.html中增加微信支付公钥ID、APIv3密钥、回调根域名、转账场景ID等完整字段 - WxPayV3Service:读取微信支付配置时优先从epay插件读取,保留site配置兜底降级能力 - WxLogin与Wxpay:更新配置读取与错误提示说明 - site.php与SQL:系统配置聚焦维护用户端与师傅端小程序AppID与Secret,避免配置分散冲突
这个提交包含在:
@@ -103,7 +103,7 @@ class Wxpay extends Api
|
||||
public function transferNotify()
|
||||
{
|
||||
try {
|
||||
$parsed = $this->parseAndVerifyCallback();
|
||||
$parsed = $this->parseAndVerifyCallback('master');
|
||||
$data = $parsed['data'];
|
||||
$outBillNo = trim((string)($data['out_bill_no'] ?? ''));
|
||||
|
||||
@@ -126,15 +126,16 @@ class Wxpay extends Api
|
||||
|
||||
/**
|
||||
* 读取原始报文并使用微信支付公钥验签 + AES-256-GCM 解密
|
||||
* @param string $side user|master
|
||||
*/
|
||||
protected function parseAndVerifyCallback()
|
||||
protected function parseAndVerifyCallback($side = 'user')
|
||||
{
|
||||
$rawBody = file_get_contents('php://input');
|
||||
if ($rawBody === false || $rawBody === '') {
|
||||
$rawBody = (string)$this->request->getInput();
|
||||
}
|
||||
$headers = $this->request->header();
|
||||
$wxSvc = new WxPayV3Service();
|
||||
$wxSvc = new WxPayV3Service(['side' => $side]);
|
||||
return $wxSvc->verifyAndDecryptNotify((string)$rawBody, is_array($headers) ? $headers : []);
|
||||
}
|
||||
|
||||
|
||||
在新工单中引用
屏蔽一个用户