feat: 收银台只有一个支付方式默认唤起
This commit is contained in:
parent
d634ca7d22
commit
3f26ffa8cb
|
@ -30,7 +30,7 @@ type WxPay struct {
|
||||||
SerialNo string `json:"serial_no"` // 商户证书的证书序列号
|
SerialNo string `json:"serial_no"` // 商户证书的证书序列号
|
||||||
ApiV3Key string `json:"api_v_3_key"` // apiV3Key,商户平台获取
|
ApiV3Key string `json:"api_v_3_key"` // apiV3Key,商户平台获取
|
||||||
PrivateKey string `json:"private_key"` // 私钥 apiclient_key.pem 读取后的内容
|
PrivateKey string `json:"private_key"` // 私钥 apiclient_key.pem 读取后的内容
|
||||||
Secret string `json:"secret"` // 商户私钥,读取后的内容
|
Secret string `json:"secret"` // 和appid配对使用
|
||||||
}
|
}
|
||||||
|
|
||||||
type AliPay struct {
|
type AliPay struct {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{{define "payPage.html"}}
|
{{define "payPage.html"}}
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
@ -38,8 +39,6 @@
|
||||||
button:hover {
|
button:hover {
|
||||||
background-color: #0056b3;
|
background-color: #0056b3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
@ -100,6 +99,8 @@
|
||||||
if (data === null || data.data.length === 0) {
|
if (data === null || data.data.length === 0) {
|
||||||
const pay = document.getElementById('pay');
|
const pay = document.getElementById('pay');
|
||||||
pay.innerHTML = '<h3>支付环境异常,请检查</h3>';
|
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 {
|
} else {
|
||||||
renderPaymentMethods(data.data);
|
renderPaymentMethods(data.data);
|
||||||
}
|
}
|
||||||
|
@ -136,6 +137,7 @@
|
||||||
const submitButton = document.createElement('button');
|
const submitButton = document.createElement('button');
|
||||||
submitButton.type = 'button';
|
submitButton.type = 'button';
|
||||||
submitButton.textContent = '提交';
|
submitButton.textContent = '提交';
|
||||||
|
|
||||||
submitButton.onclick = function () {
|
submitButton.onclick = function () {
|
||||||
const no = getQueryParam('no');
|
const no = getQueryParam('no');
|
||||||
const selectedMethod = document.querySelector('input[name="paymentMethod"]:checked');
|
const selectedMethod = document.querySelector('input[name="paymentMethod"]:checked');
|
||||||
|
@ -154,6 +156,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{{ else}}
|
{{ else}}
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<p>{{.message}}</p>
|
<p>{{.message}}</p>
|
||||||
</body>
|
</body>
|
||||||
|
|
Loading…
Reference in New Issue