From b8da95788bd8e7590de7e9eaa5d67f2d4218153d Mon Sep 17 00:00:00 2001 From: wolter Date: Fri, 2 Aug 2024 17:23:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=94=AF=E4=BB=98=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E8=AF=B7=E6=B1=82=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/constants/errorcode/error_code.go | 8 +++++++- app/http/entities/backend/pay_channel.go | 15 ++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/app/constants/errorcode/error_code.go b/app/constants/errorcode/error_code.go index f240f37..5819d91 100644 --- a/app/constants/errorcode/error_code.go +++ b/app/constants/errorcode/error_code.go @@ -24,6 +24,10 @@ const ( // 商户 MerchantNotFound = 1100 + + AppNotFound = 1200 + + PayChannelNotFound = 1300 ) var MsgEN = map[int]string{ @@ -42,7 +46,9 @@ var MsgZH = map[int]string{ NotAuth: "未经授权", NotLogin: "未登录", - MerchantNotFound: "商户不存在", + MerchantNotFound: "商户不存在", + AppNotFound: "应用不存在", + PayChannelNotFound: "支付方式不存在", } var MsgMap map[string]map[int]string = map[string]map[int]string{"en": MsgZH} diff --git a/app/http/entities/backend/pay_channel.go b/app/http/entities/backend/pay_channel.go index f1ad133..e6b3af2 100644 --- a/app/http/entities/backend/pay_channel.go +++ b/app/http/entities/backend/pay_channel.go @@ -49,16 +49,17 @@ type PayChannelCreateRequest struct { } type WechatPayChannel struct { - MchId string `json:"mch_id"` //直连商户号 - MchCertificateSerialNumber string `json:"mch_certificate_serial_number"` //商户证书序列号 - MchAPIv3Key string `json:"mch_APIv3_key"` //商户APIv3密钥 - PrivateKeyPath string `json:"private_key_path"` //商户私钥文件路径 + MchId string `json:"mch_id"` // 商户ID 或者服务商模式的 sp_mchid + SerialNo string `json:"serial_no"` // 商户证书的证书序列号 + ApiV3Key string `json:"api_v_3_key"` // apiV3Key,商户平台获取 + PrivateKey string `json:"private_key"` // 私钥 apiclient_key.pem 读取后的内容 } type AliPayPayChannel struct { - AliPublicKey string `json:"ali_public_key"` //支付宝公钥 - PrivateKeyPath string `json:"private_key_path"` //应用私钥 - SignType string `json:"sign_type"` //商户生成签名字符串所使用的签名算法类型,目前支持RSA2和RSA,推荐使用RSA2 + PrivateKey string `json:"private_key"` // 应用私钥 + AppPublicCert string `json:"app_public_cert"` // 应用公钥 + AlipayRootCert string `json:"alipay_root_cert"` // 支付宝根证书 + AlipayPublicCert string `json:"alipay_public_cert"` // 支付宝公钥 } func (p *PayChannelCreateRequest) RequestToDb() (db paychannelmodel.PayChannel, err error) {