diff --git a/app/third/paymentService/payment_service.go b/app/third/paymentService/payment_service.go index 82fafb0..1921f64 100644 --- a/app/third/paymentService/payment_service.go +++ b/app/third/paymentService/payment_service.go @@ -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 { diff --git a/front/templates/payPage.html b/front/templates/payPage.html index 69f6a55..2b2c7c9 100644 --- a/front/templates/payPage.html +++ b/front/templates/payPage.html @@ -1,6 +1,7 @@ {{define "payPage.html"}} + @@ -38,8 +39,6 @@ button:hover { background-color: #0056b3; } - - @@ -100,6 +99,8 @@ if (data === null || data.data.length === 0) { const pay = document.getElementById('pay'); pay.innerHTML = '

支付环境异常,请检查

'; + } 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 @@ {{ else}} +

{{.message}}