From 0ff054afedd91032cd84d4c63ed20fc443dbd7db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Wed, 14 Oct 2020 16:01:58 +0800 Subject: [PATCH] pay --- business/jxstore/financial/financial.go | 16 +++------------- business/model/order.go | 3 ++- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/business/jxstore/financial/financial.go b/business/jxstore/financial/financial.go index 73c480e4c..eb6706f55 100644 --- a/business/jxstore/financial/financial.go +++ b/business/jxstore/financial/financial.go @@ -40,19 +40,9 @@ func (p *PayHandler) CreatePay(order *model.Order, payType int, vendorPayType st var result2 tonglianpayapi.PayInfo json.Unmarshal([]byte(result.PayInfo), &result2) order.PrepayID = result2.Package[strings.LastIndex(result2.Package, "=")+1 : len(result2.Package)] - orderPay = &model.OrderPay{ - PayOrderID: param.Reqsn, - PayType: payType, - VendorPayType: vendorPayType, - TransactionID: result.TrxID, - VendorOrderID: order.VendorOrderID, - VendorID: order.VendorID, - Status: 0, - PayCreatedAt: payCreatedAt, - PrepayID: prePayID, - CodeURL: utils.LimitUTF8StringLen(result.PayInfo, 3200), - TotalFee: int(order.ActualPayPrice), - } + order.TransactionID = result.TrxID + order.OriginalData = utils.LimitUTF8StringLen(result.PayInfo, 3200) + } default: err = fmt.Errorf("支付方式:%d当前不支持", payType) diff --git a/business/model/order.go b/business/model/order.go index 974d908f8..b729be96d 100644 --- a/business/model/order.go +++ b/business/model/order.go @@ -453,7 +453,8 @@ type Order struct { TransactionID string `orm:"column(transaction_id);size(48)" json:"transactionID"` // 支付成功后,支付方生成的事务ID PayFinishedAt *time.Time `orm:"type(datetime);null" json:"payFinishedAt"` PrepayID string `orm:"column(prepay_id);size(48)" json:"prepayID"` // 下单后,支付前,支付方生成的事务ID - Comment string `orm:"size(255)" json:"comment"` //备注 + OriginalData string `orm:"type(text)" json:"-"` + Comment string `orm:"size(255)" json:"comment"` //备注 } func (v *Order) TableIndex() [][]string {