feat: 添加 HashPay 支付渠道支持
后端: - payment.go: 添加 HashPay 支付处理器 - RSA-SHA256 签名 - RSA-OAEP-256+A256GCM 回调解密 - 创建订单和回调处理 - routes.go: 添加 HashPay 回调路由 前端: - PaymentChannels.vue: 添加 HashPay 类型选项 - 商户ID配置 - RSA私钥配置 - API地址配置 参考 bepusdt 的交互方式,支持多种加密货币支付
This commit is contained in:
@@ -146,6 +146,22 @@
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
<template v-else-if="form.type === 'hashpay'">
|
||||
<el-form-item label="API地址">
|
||||
<el-input v-model="channelConfig.hashpay_base_url" placeholder="如:https://pay.example.com" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商户ID">
|
||||
<el-input v-model="channelConfig.hashpay_merchant_id" placeholder="HashPay 商户ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商户私钥">
|
||||
<el-input v-model="channelConfig.hashpay_private_key" type="textarea" :rows="6" placeholder="RSA 私钥 (PEM格式)" />
|
||||
</el-form-item>
|
||||
<el-alert type="info" :closable="false" style="margin-bottom: 16px">
|
||||
<p style="margin: 0; font-size: 12px;">HashPay 支持多种加密货币支付,包括 USDT/TRC20、USDT/ERC20、SOL 等。</p>
|
||||
<p style="margin: 8px 0 0 0; font-size: 12px;">请在 HashPay 后台创建商户并获取商户ID和私钥。</p>
|
||||
</el-alert>
|
||||
</template>
|
||||
|
||||
<template v-else-if="form.type === 'bank'">
|
||||
<el-form-item label="银行名称">
|
||||
<el-input v-model="channelConfig.bank_name" placeholder="如:中国工商银行" />
|
||||
@@ -211,6 +227,7 @@ const channelTypes = [
|
||||
{ value: 'alipay', label: '支付宝', icon: '<svg viewBox="0 0 24 24" width="16" height="16" fill="#1677ff"><rect rx="4" width="24" height="24" fill="#1677ff"/><text x="12" y="17" text-anchor="middle" fill="#fff" font-size="12" font-weight="bold">支</text></svg>' },
|
||||
{ value: 'wechat', label: '微信支付', icon: '<svg viewBox="0 0 24 24" width="16" height="16"><rect rx="4" width="24" height="24" fill="#07c160"/><text x="12" y="17" text-anchor="middle" fill="#fff" font-size="12" font-weight="bold">微</text></svg>' },
|
||||
{ value: 'bepusdt', label: 'BepUsdt', icon: '<svg viewBox="0 0 24 24" width="16" height="16"><rect rx="4" width="24" height="24" fill="#26a17b"/><text x="12" y="17" text-anchor="middle" fill="#fff" font-size="11" font-weight="bold">₮</text></svg>' },
|
||||
{ value: 'hashpay', label: 'HashPay', icon: '<svg viewBox="0 0 24 24" width="16" height="16"><rect rx="4" width="24" height="24" fill="#f7931a"/><text x="12" y="17" text-anchor="middle" fill="#fff" font-size="11" font-weight="bold">₿</text></svg>' },
|
||||
{ value: 'bank', label: '银行卡', icon: '<svg viewBox="0 0 24 24" width="16" height="16"><rect rx="4" width="24" height="24" fill="#e6a23c"/><text x="12" y="17" text-anchor="middle" fill="#fff" font-size="12" font-weight="bold">卡</text></svg>' },
|
||||
{ value: 'other', label: '其他', icon: '<svg viewBox="0 0 24 24" width="16" height="16"><rect rx="4" width="24" height="24" fill="#909399"/><text x="12" y="17" text-anchor="middle" fill="#fff" font-size="14" font-weight="bold">…</text></svg>' },
|
||||
]
|
||||
@@ -244,6 +261,7 @@ function onTypeChange(type: string) {
|
||||
alipay: 'alipay',
|
||||
wechat: 'wechat',
|
||||
bepusdt: 'usdt',
|
||||
hashpay: 'crypto',
|
||||
bank: 'bank',
|
||||
}
|
||||
form.icon = iconMap[type] || ''
|
||||
|
||||
Reference in New Issue
Block a user