Compare commits

...

2 Commits

Author SHA1 Message Date
wolter 3f26ffa8cb feat: 收银台只有一个支付方式默认唤起 2025-02-18 10:47:17 +08:00
wolter d634ca7d22 feat: v2预支付fix 2024-12-25 14:36:08 +08:00
4 changed files with 15 additions and 6 deletions

View File

@ -79,6 +79,8 @@ const (
OrderRefundAmountError = 1414
OrderPayChannelChange = 1415
OrderPayRequestLogNotExist = 1416
OrderPayRequestAcquireLock = 1430
// 关闭订单
CloseOrderPayed = 1420
@ -188,9 +190,10 @@ var MsgZH = map[int]string{
ThirdRefundFail: "第三方退款失败",
WechatAuthFail: "微信授权失败",
WechatAuthSignFail: "微信签名失败",
ClientEnvErr: "支付环境错误",
WechatAuthFail: "微信授权失败",
WechatAuthSignFail: "微信签名失败",
ClientEnvErr: "支付环境错误",
OrderPayRequestAcquireLock: "系统繁忙,请稍后再试",
}
var MsgMap map[string]map[int]string = map[string]map[int]string{"en": MsgZH}

View File

@ -181,6 +181,9 @@ func (this *payUrl) PayUrlV2Service() (result front.PayReqsV2Response, code int)
} else {
if err != nil {
utils.Log(nil, "", "PayUrlV2Service,获取分布式锁失败", fmt.Sprintf("错误原因:%s", err.Error()))
code = errorcode.SystemError
} else {
code = errorcode.OrderPayRequestAcquireLock
}
return
}

View File

@ -30,7 +30,7 @@ type WxPay struct {
SerialNo string `json:"serial_no"` // 商户证书的证书序列号
ApiV3Key string `json:"api_v_3_key"` // apiV3Key商户平台获取
PrivateKey string `json:"private_key"` // 私钥 apiclient_key.pem 读取后的内容
Secret string `json:"secret"` // 商户私钥,读取后的内容
Secret string `json:"secret"` // 和appid配对使用
}
type AliPay struct {

View File

@ -1,6 +1,7 @@
{{define "payPage.html"}}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@ -38,8 +39,6 @@
button:hover {
background-color: #0056b3;
}
</style>
</head>
@ -100,6 +99,8 @@
if (data === null || data.data.length === 0) {
const pay = document.getElementById('pay');
pay.innerHTML = '<h3>支付环境异常,请检查</h3>';
} else if (data.data.length === 1) {
window.location.href = `/pay/front/api/v1/payPage/submit?pay_channel_id=${data.data[0].pay_channel_id}&no=${id}`;
} else {
renderPaymentMethods(data.data);
}
@ -136,6 +137,7 @@
const submitButton = document.createElement('button');
submitButton.type = 'button';
submitButton.textContent = '提交';
submitButton.onclick = function () {
const no = getQueryParam('no');
const selectedMethod = document.querySelector('input[name="paymentMethod"]:checked');
@ -154,6 +156,7 @@
</script>
{{ else}}
<body>
<p>{{.message}}</p>
</body>