Merge remote-tracking branch 'origin/feature/rzy/api_1.0' into feature_413_cjh
This commit is contained in:
		
						commit
						6ab982e874
					
				| 
						 | 
					@ -1,6 +1,7 @@
 | 
				
			||||||
package do
 | 
					package do
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
 | 
						"PaymentCenter/app/constants/common"
 | 
				
			||||||
	"PaymentCenter/app/constants/errorcode"
 | 
						"PaymentCenter/app/constants/errorcode"
 | 
				
			||||||
	"PaymentCenter/app/services"
 | 
						"PaymentCenter/app/services"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -31,6 +32,7 @@ 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,
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	)
 | 
						)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -58,7 +60,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
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -19,7 +19,7 @@ type OrderNotify struct {
 | 
				
			||||||
	app   *appmodel.App
 | 
						app   *appmodel.App
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	OrderId      int64
 | 
						OrderId      int64
 | 
				
			||||||
	ErrCode      int
 | 
						Status       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, errCode int, actualAmount int, msg string) *OrderNotifyResp {
 | 
					func NewOrderNotifyWithHandle(orderId int64, Status int, actualAmount int, msg string) *OrderNotifyResp {
 | 
				
			||||||
	orderNotify := &OrderNotify{
 | 
						orderNotify := &OrderNotify{
 | 
				
			||||||
		OrderId:      orderId,
 | 
							OrderId:      orderId,
 | 
				
			||||||
		ErrCode:      errCode,
 | 
							Status:       Status,
 | 
				
			||||||
		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
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue