This commit is contained in:
苏尹岚
2020-10-14 16:01:58 +08:00
parent cbe94c7916
commit 0ff054afed
2 changed files with 5 additions and 14 deletions

View File

@@ -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)

View File

@@ -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 {