コード例 #1
0
func requestCreateOrder(userId, playerId, amount, payType, productId, productCount, sdkType, extData, source string, serverId, gameId int) interface{} {
	var response struct {
		OrderId int
	}
	order := model.CreateOrder(gameId, serverId, userId, playerId, amount, payType, productId, productCount, extData, sdkType, source)
	response.OrderId = dao.SaveOrder(order)
	return response
}
コード例 #2
0
ファイル: chanpay.go プロジェクト: HinaKaze/GameChargeServer
func payMsgHandler() {
	for {
		morder := <-payChan
		order, ok := dao.GetOrder(morder.Id)
		if !ok {
			log.Debugf("Pay chan got new message but order id is invalid [%+v]", morder)
			continue
		}
		//判定是否需要被保存
		dao.SaveOrder(order)
		//判定是否需要被通知
		//		if morder.PayStatus != order.PayStatus || morder.OrderStatus != order.OrderStatus {
		//			snet.NotifyOrderState(morder)
		//		}
		snet.NotifyOrderState(morder)
	}
}