Compare commits

..

No commits in common. "6ab982e874c6c71aebcfdb6d32a9bd42fa5c6e21" and "75d68a30329e138f6606767a15202989052d9534" have entirely different histories.

2 changed files with 5 additions and 7 deletions

View File

@ -1,7 +1,6 @@
package do package do
import ( import (
"PaymentCenter/app/constants/common"
"PaymentCenter/app/constants/errorcode" "PaymentCenter/app/constants/errorcode"
"PaymentCenter/app/services" "PaymentCenter/app/services"
@ -32,7 +31,6 @@ func (w *Pay) CreateOrder() {
Amount: w.paycheck.WebPayReqs.Amount, Amount: w.paycheck.WebPayReqs.Amount,
ExtJson: w.paycheck.WebPayReqs.ExtJson, ExtJson: w.paycheck.WebPayReqs.ExtJson,
Desc: w.paycheck.WebPayReqs.Desc, Desc: w.paycheck.WebPayReqs.Desc,
Status: common.ORDER_STATUS_WAITPAY,
}, },
) )
} }
@ -60,7 +58,7 @@ func (w *Pay) Pay() {
return return
} }
res := paymentService.PaymentService(*w.paycheck.ctx, *thirdPay) res := paymentService.PaymentService(*w.paycheck.ctx, *thirdPay)
// payCommon.PAY_SUCCESS_CODE
w.PayCode = res.Code w.PayCode = res.Code
return return
} }

View File

@ -19,7 +19,7 @@ type OrderNotify struct {
app *appmodel.App app *appmodel.App
OrderId int64 OrderId int64
Status int //订单状态 ErrCode int
ActualAmount int ActualAmount int
Msg string Msg string
CompleteTime time.Time CompleteTime time.Time
@ -45,10 +45,10 @@ type OrderNotifySendContent struct {
MerchantId int64 `json:"merchant_id"` MerchantId int64 `json:"merchant_id"`
} }
func NewOrderNotifyWithHandle(orderId int64, Status int, actualAmount int, msg string) *OrderNotifyResp { func NewOrderNotifyWithHandle(orderId int64, errCode int, actualAmount int, msg string) *OrderNotifyResp {
orderNotify := &OrderNotify{ orderNotify := &OrderNotify{
OrderId: orderId, OrderId: orderId,
Status: Status, ErrCode: errCode,
ActualAmount: actualAmount, ActualAmount: actualAmount,
Msg: msg, Msg: msg,
code: errorcode.Success, code: errorcode.Success,
@ -118,7 +118,7 @@ func (o *OrderNotify) setBody() *OrderNotifySendContent {
} }
func (o *OrderNotify) updateOrder() { func (o *OrderNotify) updateOrder() {
if o.ErrCode != errorcode.Success { if o.ErrCode == errorcode.Success {
o.order.Status = common.ORDER_STATUS_FAILED o.order.Status = common.ORDER_STATUS_FAILED
} else { } else {
o.order.Status = common.ORDER_STATUS_PAYED o.order.Status = common.ORDER_STATUS_PAYED