完善商福通支付接口,修复证书加载问题;数据库扩展支付平台字段并更新支付信息保存逻辑;日志中间件异步记录日志
This commit is contained in:
@@ -45,6 +45,7 @@ func newTrade(db *gorm.DB, opts ...gen.DOOption) trade {
|
||||
_trade.UpdatedAt = field.NewField(tableName, "updated_at")
|
||||
_trade.DeletedAt = field.NewField(tableName, "deleted_at")
|
||||
_trade.Acquirer = field.NewInt32(tableName, "acquirer")
|
||||
_trade.Platform = field.NewInt32(tableName, "platform")
|
||||
|
||||
_trade.fillFieldMap()
|
||||
|
||||
@@ -64,7 +65,7 @@ type trade struct {
|
||||
Remark field.String // 订单备注
|
||||
Amount field.Field // 订单总金额
|
||||
Payment field.Field // 支付金额
|
||||
Method field.Int32 // 支付方式:1-支付宝,2-微信,3-商福通
|
||||
Method field.Int32 // 支付方式:1-支付宝,2-微信,3-商福通渠道支付宝,4-商福通渠道微信
|
||||
Status field.Int32 // 订单状态:0-待支付,1-已支付,2-已取消,3-已退款
|
||||
PayURL field.String // 支付链接
|
||||
PaidAt field.Field // 支付时间
|
||||
@@ -73,6 +74,7 @@ type trade struct {
|
||||
UpdatedAt field.Field // 更新时间
|
||||
DeletedAt field.Field // 删除时间
|
||||
Acquirer field.Int32 // 收单机构:1-支付宝,2-微信,3-银联
|
||||
Platform field.Int32 // 支付平台:1-电脑网站,2-手机网站
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
@@ -107,6 +109,7 @@ func (t *trade) updateTableName(table string) *trade {
|
||||
t.UpdatedAt = field.NewField(table, "updated_at")
|
||||
t.DeletedAt = field.NewField(table, "deleted_at")
|
||||
t.Acquirer = field.NewInt32(table, "acquirer")
|
||||
t.Platform = field.NewInt32(table, "platform")
|
||||
|
||||
t.fillFieldMap()
|
||||
|
||||
@@ -123,7 +126,7 @@ func (t *trade) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
||||
}
|
||||
|
||||
func (t *trade) fillFieldMap() {
|
||||
t.fieldMap = make(map[string]field.Expr, 18)
|
||||
t.fieldMap = make(map[string]field.Expr, 19)
|
||||
t.fieldMap["id"] = t.ID
|
||||
t.fieldMap["user_id"] = t.UserID
|
||||
t.fieldMap["inner_no"] = t.InnerNo
|
||||
@@ -142,6 +145,7 @@ func (t *trade) fillFieldMap() {
|
||||
t.fieldMap["updated_at"] = t.UpdatedAt
|
||||
t.fieldMap["deleted_at"] = t.DeletedAt
|
||||
t.fieldMap["acquirer"] = t.Acquirer
|
||||
t.fieldMap["platform"] = t.Platform
|
||||
}
|
||||
|
||||
func (t trade) clone(db *gorm.DB) trade {
|
||||
|
||||
Reference in New Issue
Block a user