Compare commits
No commits in common. "cdcfaaecd67aa3ca18864cf813c0d235c833fc2e" and "79cc31ee71a433a2bd78b6aec272e2c2028c3ccd" have entirely different histories.
cdcfaaecd6
...
79cc31ee71
|
@ -96,7 +96,6 @@ func PayChannelList(c *gin.Context) {
|
||||||
// 获取付款链接,返回付款模板
|
// 获取付款链接,返回付款模板
|
||||||
func GetPayLink(c *gin.Context) {
|
func GetPayLink(c *gin.Context) {
|
||||||
req, _ := controllers.GetRequest(c).(*front.GetPayLinkRequest)
|
req, _ := controllers.GetRequest(c).(*front.GetPayLinkRequest)
|
||||||
req.ClientIp = c.ClientIP()
|
|
||||||
|
|
||||||
result, message, code := thirdpay.GetPayLinkService(*req)
|
result, message, code := thirdpay.GetPayLinkService(*req)
|
||||||
if message == "" {
|
if message == "" {
|
||||||
|
@ -108,30 +107,3 @@ func GetPayLink(c *gin.Context) {
|
||||||
"message": message,
|
"message": message,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 订单查询
|
|
||||||
func PayPageCheckOrder(c *gin.Context) {
|
|
||||||
var (
|
|
||||||
code int
|
|
||||||
orderInfo ordersmodel.Orders
|
|
||||||
returnUrl string
|
|
||||||
)
|
|
||||||
orderId := strings.TrimSpace(c.Query("no"))
|
|
||||||
|
|
||||||
if orderId == "" || len(orderId) < 18 || len(orderId) > 20 {
|
|
||||||
controllers.ErrWithCode(c, errorcode.OrdersNotFound)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
orderInfo, returnUrl, code = thirdpay.PayPageCheckOrder(orderId)
|
|
||||||
if code == errorcode.OrderPayed {
|
|
||||||
code = errorcode.Success
|
|
||||||
}
|
|
||||||
|
|
||||||
rsp := front.PayPageCheckOrderResponse{
|
|
||||||
ReturnUrl: returnUrl,
|
|
||||||
Status: orderInfo.Status,
|
|
||||||
}
|
|
||||||
controllers.HandCodeRes(c, rsp, code)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -98,8 +98,3 @@ type GetPayLinkRequest struct {
|
||||||
OrderId string `json:"no" form:"no"`
|
OrderId string `json:"no" form:"no"`
|
||||||
ClientIp string
|
ClientIp string
|
||||||
}
|
}
|
||||||
|
|
||||||
type PayPageCheckOrderResponse struct {
|
|
||||||
ReturnUrl string `json:"return_url"`
|
|
||||||
Status int `json:"status"`
|
|
||||||
}
|
|
||||||
|
|
|
@ -99,8 +99,6 @@ func RegisterRoute(router *gin.Engine) {
|
||||||
{
|
{
|
||||||
// 收银台地址
|
// 收银台地址
|
||||||
router.GET(common.PayPageAddress, front.PayPage)
|
router.GET(common.PayPageAddress, front.PayPage)
|
||||||
// 订单查询
|
|
||||||
router.GET(common.PayPageAddress+"/query", front.PayPageCheckOrder)
|
|
||||||
|
|
||||||
payPage := router.Group(common.PayPageAddress, middlewares.ValidateRequest())
|
payPage := router.Group(common.PayPageAddress, middlewares.ValidateRequest())
|
||||||
// 收银台 支付渠道列表
|
// 收银台 支付渠道列表
|
||||||
|
|
Loading…
Reference in New Issue