diff --git a/app/services/thirdpay/do/pay.go b/app/services/thirdpay/do/pay.go index 184a946..e07d841 100644 --- a/app/services/thirdpay/do/pay.go +++ b/app/services/thirdpay/do/pay.go @@ -1,6 +1,7 @@ package do import ( + "PaymentCenter/app/constants/common" "PaymentCenter/app/constants/errorcode" "PaymentCenter/app/services" @@ -31,6 +32,7 @@ func (w *Pay) CreateOrder() { Amount: w.paycheck.WebPayReqs.Amount, ExtJson: w.paycheck.WebPayReqs.ExtJson, Desc: w.paycheck.WebPayReqs.Desc, + Status: common.ORDER_STATUS_WAITPAY, }, ) } @@ -58,7 +60,7 @@ func (w *Pay) Pay() { return } res := paymentService.PaymentService(*w.paycheck.ctx, *thirdPay) - + // payCommon.PAY_SUCCESS_CODE w.PayCode = res.Code return } diff --git a/app/services/thirdpay/notify/notify.go b/app/services/thirdpay/notify/notify.go index 8cad419..f1a92aa 100644 --- a/app/services/thirdpay/notify/notify.go +++ b/app/services/thirdpay/notify/notify.go @@ -19,7 +19,7 @@ type OrderNotify struct { app *appmodel.App OrderId int64 - ErrCode int + Status int //订单状态 ActualAmount int Msg string CompleteTime time.Time @@ -45,10 +45,10 @@ type OrderNotifySendContent struct { MerchantId int64 `json:"merchant_id"` } -func NewOrderNotifyWithHandle(orderId int64, errCode int, actualAmount int, msg string) *OrderNotifyResp { +func NewOrderNotifyWithHandle(orderId int64, Status int, actualAmount int, msg string) *OrderNotifyResp { orderNotify := &OrderNotify{ OrderId: orderId, - ErrCode: errCode, + Status: Status, ActualAmount: actualAmount, Msg: msg, code: errorcode.Success, @@ -118,7 +118,7 @@ func (o *OrderNotify) setBody() *OrderNotifySendContent { } func (o *OrderNotify) updateOrder() { - if o.ErrCode == errorcode.Success { + if o.ErrCode != errorcode.Success { o.order.Status = common.ORDER_STATUS_FAILED } else { o.order.Status = common.ORDER_STATUS_PAYED