From 64f8ebd43f4b46a5a12f2885b1bd1790316de421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 20 Oct 2020 10:47:10 +0800 Subject: [PATCH] wxpay --- business/jxstore/financial/financial.go | 33 +++++++++++++++++++++++++ conf/app.conf | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/business/jxstore/financial/financial.go b/business/jxstore/financial/financial.go index 246b7b0d6..a972f0f3f 100644 --- a/business/jxstore/financial/financial.go +++ b/business/jxstore/financial/financial.go @@ -40,6 +40,39 @@ func (p *PayHandler) CreatePay() (err error) { // p.Order.OriginalData = utils.LimitUTF8StringLen(result.PayInfo, 3200) _, err = dao.UpdateEntity(dao.GetDB(), p.Order, "PrepayID", "TransactionID", "OriginalData") } + case model.PayTypeWX: + // payCreatedAt := time.Now() + // param := &wxpayapi.CreateOrderParam{ + // OutTradeNo: utils.Int64ToStr(p.Order.OrderID), + // Body: fmt.Sprintf("付款给冲天猴儿app:%f 元", jxutils.IntPrice2Standard(int64(p.Order.PayPrice))), + // NotifyURL: globals.WxpayNotifyURL, + // SpbillCreateIP: p.Ctx.GetRealRemoteIP(), + // TradeType: p.VendorPayType, + // TotalFee: int(order.ActualPayPrice), + + // TimeStart: wxpayapi.Time2PayTime(payCreatedAt), + // // TimeExpire: wxpayapi.Time2PayTime(payCreatedAt.Add(PayWaitingTime)), + // ProfitSharing: wxpayapi.OptYes, + // } + // if authInfo, err := ctx.GetV2AuthInfo(); err == nil && authInfo.GetAuthType() == weixin.AuthTypeMini { + // param.OpenID = authInfo.GetAuthID() + // } + // result, err := api.WxpayAPI.CreateUnifiedOrder(param) + // if err == nil { + // orderPay = &model.OrderPay{ + // PayOrderID: param.OutTradeNo, + // PayType: model.PayTypeWX, + // VendorPayType: vendorPayType, + + // VendorOrderID: order.VendorOrderID, + // VendorID: order.VendorID, + // Status: 0, + // PayCreatedAt: payCreatedAt, + // PrepayID: result.PrepayID, + // CodeURL: result.CodeURL, + // TotalFee: int(order.ActualPayPrice), + // } + // } default: err = fmt.Errorf("支付方式:%d当前不支持", p.PayType) } diff --git a/conf/app.conf b/conf/app.conf index efc8bab54..0d914152a 100644 --- a/conf/app.conf +++ b/conf/app.conf @@ -258,7 +258,7 @@ yinbaoAppID = "18C0E0867E467DBC26EFF5E957B02EC4" aliUpcAppCode = "00a6eefba0204d3fa310ac0ee7a6fc54" -wxpayNotifyURL = "http://callback.jxc4.com/wxpay/msg/" +wxpayNotifyURL = "http://callback.rsm.jxc4.com/wxpay/msg/" tonglianPayAppID = "00183083" tonglianPayKey = "18048531223"