更改微信支付号;代理新增是否显示价格
This commit is contained in:
@@ -63,6 +63,7 @@ type WxpayConfig struct {
|
||||
MchPrivateKeyPath string
|
||||
MchPublicKeyID string
|
||||
MchPublicKeyPath string
|
||||
MchPlatformRAS string
|
||||
NotifyUrl string
|
||||
RefundNotifyUrl string
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user