更改微信支付号;代理新增是否显示价格

This commit is contained in:
2025-06-26 16:59:06 +08:00
parent 0c54504f40
commit 6a1d18926d
12 changed files with 87 additions and 78 deletions

View File

@@ -63,6 +63,7 @@ type WxpayConfig struct {
MchPrivateKeyPath string
MchPublicKeyID string
MchPublicKeyPath string
MchPlatformRAS string
NotifyUrl string
RefundNotifyUrl string
}

View File

@@ -101,6 +101,7 @@ func (l *GeneratingLinkLogic) GeneratingLink(req *types.AgentGeneratingLinkReq)
agentLink.LinkIdentifier = encrypted
agentLink.ProductId = productModel.Id
agentLink.Price = price
agentLink.ShowPrice = req.ShowPrice
_, err = l.svcCtx.AgentLinkModel.Insert(l.ctx, nil, &agentLink)
if err != nil {
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "生成代理链接, %v", err)

View File

@@ -41,6 +41,7 @@ func (l *GetLinkDataLogic) GetLinkData(req *types.GetLinkDataReq) (resp *types.G
copier.Copy(&product, productModel)
product.SellPrice = agentLinkModel.Price
return &types.GetLinkDataResp{
Product: product,
ShowPrice: agentLinkModel.ShowPrice,
Product: product,
}, nil
}

View File

@@ -106,12 +106,12 @@ func newWechatPayServiceWithPlatformCert(c config.Config, userAuthModel model.Us
// newWechatPayServiceWithWxPayPubKey 使用微信支付公钥初始化微信支付服务
func newWechatPayServiceWithWxPayPubKey(c config.Config, userAuthModel model.UserAuthModel) *WechatPayService {
// 从配置中加载商户信息
mchID := c.Wxpay.MchID
mchCertificateSerialNumber := c.Wxpay.MchCertificateSerialNumber
mchAPIv3Key := c.Wxpay.MchApiv3Key
mchPrivateKeyPath := c.Wxpay.MchPrivateKeyPath
mchPublicKeyID := c.Wxpay.MchPublicKeyID
mchPublicKeyPath := c.Wxpay.MchPublicKeyPath
mchID := c.Wxpay.MchID // 商户号
mchCertificateSerialNumber := c.Wxpay.MchCertificateSerialNumber // 商户证书序列号
mchAPIv3Key := c.Wxpay.MchApiv3Key // 商户APIv3密钥
mchPrivateKeyPath := c.Wxpay.MchPrivateKeyPath // 商户私钥路径
mchPublicKeyID := c.Wxpay.MchPublicKeyID // 商户公钥ID
mchPublicKeyPath := c.Wxpay.MchPublicKeyPath // 商户公钥路径
// 从文件中加载商户私钥
mchPrivateKey, err := utils.LoadPrivateKeyWithPath(mchPrivateKeyPath)
if err != nil {

View File

@@ -755,8 +755,9 @@ type AgentCommissionListItem struct {
}
type AgentGeneratingLinkReq struct {
Product string `json:"product"`
Price string `json:"price"`
Product string `json:"product"`
Price string `json:"price"`
ShowPrice int64 `json:"show_price"`
}
type AgentGeneratingLinkResp struct {
@@ -1111,6 +1112,7 @@ type GetLinkDataReq struct {
}
type GetLinkDataResp struct {
ShowPrice int64 `json:"show_price"`
Product
}