feat: 初始化雄戈商城服务端代码与Webhook自动部署配置

这个提交包含在:
wikiboss
2026-09-12 16:40:24 +08:00
当前提交 e90ec58e61
共有 6438 个文件被更改,包括 1136083 次插入 和 0 次删除

查看文件

@@ -0,0 +1,47 @@
<?php
namespace addons\shopro_huifu\library\onboard;
class HuifuOnboardError
{
/**
* 将汇付/系统异常转为用户可读提示(去掉 resp_code 等技术字段)
*/
public static function translate($message)
{
$msg = trim((string) $message);
if ($msg === '') {
return '进件提交失败,请稍后重试';
}
$lower = strtolower($msg);
if (strpos($msg, 'certEndDate') !== false
|| strpos($msg, '证件有效期') !== false
|| strpos($msg, '到期日') !== false) {
return '身份证/证件有效期须晚于今天;长期有效请选择 2099-12-31';
}
if (strpos($msg, 'certBeginDate') !== false || strpos($msg, '开始日期') !== false) {
return '证件开始日期填写有误,请与身份证一致';
}
if (strpos($msg, 'branch') !== false || strpos($msg, '联行') !== false) {
return '开户银行支行信息有误,请重新搜索选择支行';
}
if (strpos($msg, 'branch_code') !== false) {
return '请选择正确的开户银行支行';
}
if (strpos($msg, '图片') !== false || strpos($lower, 'picture') !== false || strpos($lower, 'file_id') !== false) {
return '证件或银行卡图片上传失败,请重新上传 jpg/png 清晰照片';
}
if (preg_match('/基础参数校验失败[::](.+?)(?:,resp_code|$)/u', $msg, $m)) {
return '资料校验未通过:' . trim($m[1]);
}
$msg = preg_replace('/,resp_code=[^,]+/u', '', $msg);
$msg = preg_replace('/,trans_stat=[^,]+/u', '', $msg);
$msg = str_replace('汇付业务失败,', '', $msg);
$msg = str_replace('汇付 SDK 请求异常:', '', $msg);
return $msg !== '' ? $msg : '进件提交失败,请检查资料后重试';
}
}