```
feat(split): 添加微信分账V3版本验证和汇付分账冻结资金处理 - 在ProfitSharingService中添加Yansongda Pay V3版本验证,确保微信官方分账功能正常运行 - 实现汇付分账冻结资金检测逻辑,当资金被冻结时标记分账失败而非抛出异常 - 在管理后台控制器中增强错误处理和状态显示功能 - 优化前端界面,根据分账模式动态显示相应操作按钮 ```
这个提交包含在:
@@ -40,11 +40,38 @@ class ProfitSharingService
|
||||
|
||||
protected function callPlugin($plugin, array $params)
|
||||
{
|
||||
$this->assertYansongdaPayV3();
|
||||
$wechat = Pay::wechat($this->config);
|
||||
if (!is_object($wechat) || !method_exists($wechat, 'mergeCommonPlugins')) {
|
||||
throw new \RuntimeException(
|
||||
'当前加载的是 Yansongda Pay V2,无法调用微信官方分账。'
|
||||
. '纯汇付分账请勿使用「同步微信」;若需微信分账请将 epay 插件 API 版本改为 V3 并重新进入后台再试。'
|
||||
);
|
||||
}
|
||||
$plugins = $wechat->mergeCommonPlugins([$plugin]);
|
||||
return $wechat->pay($plugins, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信官方分账(ProfitSharing)仅 epay 内置的 Yansongda V3 支持,与汇付 delaytrans/confirm 无关。
|
||||
*/
|
||||
protected function assertYansongdaPayV3()
|
||||
{
|
||||
if (!class_exists('\\addons\\epay\\library\\Service')) {
|
||||
throw new \RuntimeException('请先安装并启用 epay(微信支付宝整合)插件');
|
||||
}
|
||||
if (!\addons\epay\library\Service::isVersionV3()) {
|
||||
throw new \RuntimeException(
|
||||
'epay 当前为 API V2,不支持微信官方分账接口。'
|
||||
. '您若使用汇付延时分账:接收方在汇付控台绑定 huifu_id 即可,不要点「同步微信」。'
|
||||
. '若业务必须用微信分账:在 epay 配置里改为 V3,并配置微信支付 APIv3 密钥与证书(与 V2 密钥不通用)。'
|
||||
);
|
||||
}
|
||||
if (!class_exists(CreatePlugin::class)) {
|
||||
throw new \RuntimeException('Yansongda Pay V3 类未加载,请确认 epay 为 V3 后刷新页面再试');
|
||||
}
|
||||
}
|
||||
|
||||
protected function buildWechatConfig()
|
||||
{
|
||||
$paymentConfig = json_decode(ShoproConfig::get(['name' => 'wechat'])->value, true);
|
||||
|
||||
在新工单中引用
屏蔽一个用户