pay
This commit is contained in:
@@ -3,6 +3,8 @@ package cms
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/financial"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
|
||||
@@ -13,13 +15,13 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
)
|
||||
|
||||
func CreateOrder(ctx *jxcontext.Context, orderType, price int) (orderID int64, err error) {
|
||||
func CreateOrder(ctx *jxcontext.Context, orderType, price int) (orderID string, err error) {
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
order *model.Order
|
||||
)
|
||||
order = &model.Order{
|
||||
OrderID: jxutils.GenOrderNo(),
|
||||
OrderID: utils.Int64ToStr(jxutils.GenOrderNo()),
|
||||
UserID: ctx.GetUserID(),
|
||||
Type: orderType,
|
||||
Status: model.OrderStatusWait4Pay,
|
||||
@@ -40,11 +42,11 @@ func CreateOrder(ctx *jxcontext.Context, orderType, price int) (orderID int64, e
|
||||
return order.OrderID, err
|
||||
}
|
||||
|
||||
func Pay(ctx *jxcontext.Context, orderID, payType int, vendorPayType string) (result *model.Order, err error) {
|
||||
func Pay(ctx *jxcontext.Context, orderID string, payType int, vendorPayType string) (result *model.Order, err error) {
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
order = &model.Order{
|
||||
OrderID: int64(orderID),
|
||||
OrderID: orderID,
|
||||
}
|
||||
payHandler = &financial.PayHandler{
|
||||
PayType: payType,
|
||||
@@ -66,11 +68,11 @@ func Pay(ctx *jxcontext.Context, orderID, payType int, vendorPayType string) (re
|
||||
return payHandler.Order, err
|
||||
}
|
||||
|
||||
func Cash(ctx *jxcontext.Context, orderID, payType int, vendorPayType string) (errCode string, err error) {
|
||||
func Cash(ctx *jxcontext.Context, orderID string, payType int, vendorPayType string) (errCode string, err error) {
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
order = &model.Order{
|
||||
OrderID: int64(orderID),
|
||||
OrderID: orderID,
|
||||
}
|
||||
payHandler = &financial.PayHandler{
|
||||
PayType: payType,
|
||||
|
||||
Reference in New Issue
Block a user