This commit is contained in:
苏尹岚
2020-09-04 16:11:12 +08:00
parent be973b05e7
commit 1929b24bed
3 changed files with 57 additions and 17 deletions

View File

@@ -18,7 +18,7 @@ import (
"git.rosy.net.cn/jx-callback/globals/api"
)
func pay4OrderByTL(ctx *jxcontext.Context, order *model.GoodsOrder, vendorPayType string) (orderPay *model.OrderPay, err error) {
func pay4OrderByTL(ctx *jxcontext.Context, order *model.GoodsOrder, payType int, vendorPayType string) (orderPay *model.OrderPay, err error) {
// if order.FromStoreID != 0 {
// result, _ := orderman.GetMatterStoreOrderCount(nil, order.FromStoreID)
// if !result.Flag {
@@ -57,7 +57,7 @@ func pay4OrderByTL(ctx *jxcontext.Context, order *model.GoodsOrder, vendorPayTyp
prePayID := result2.Package[strings.LastIndex(result2.Package, "=")+1 : len(result2.Package)]
orderPay = &model.OrderPay{
PayOrderID: param.Reqsn,
PayType: model.PayTypeTL,
PayType: payType,
VendorPayType: vendorPayType,
TransactionID: result.TrxID,
VendorOrderID: order.VendorOrderID,
@@ -87,11 +87,11 @@ func OnTLPayCallback(call *tonglianpayapi.CallBackResult) (err error) {
func onTLpayFinished(call *tonglianpayapi.CallBackResult) (err error) {
orderPay := &model.OrderPay{
PayOrderID: call.CusorderID,
PayType: model.PayTypeTL,
// PayType: model.PayTypeTL,
}
orderPay.DeletedAt = utils.DefaultTimeValue
db := dao.GetDB()
if err = dao.GetEntity(db, orderPay, "PayOrderID", "PayType", "DeletedAt"); err == nil {
if err = dao.GetEntity(db, orderPay, "PayOrderID", "DeletedAt"); err == nil {
if orderPay.Status != 0 {
globals.SugarLogger.Debugf("already pay msg:%s, err:%v", utils.Format4Output(call, true), err)
return err