add wxpay callback manul
This commit is contained in:
parent
0f96f44c3e
commit
60dd9b28c5
|
@ -118,3 +118,9 @@ type OpOrderListData struct {
|
||||||
//Offset int `json:"offset"`
|
//Offset int `json:"offset"`
|
||||||
//More int `json:"more"`
|
//More int `json:"more"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type WxpayCallbackManualParam struct {
|
||||||
|
OrderId string `json:"order_id"` // 我们自己服务的订单id
|
||||||
|
OutOrderId string `json:"out_order_id"` // 外部订单id,比如支付宝、微信
|
||||||
|
CallbackPayType string `json:"callback_pay_type"` // 支付类型
|
||||||
|
}
|
||||||
|
|
|
@ -290,6 +290,7 @@ func Init(r *gin.Engine) {
|
||||||
extVasPayGroup := r.Group("/ext/vas")
|
extVasPayGroup := r.Group("/ext/vas")
|
||||||
extVasPayGroup.POST("alipay_callback", AlipayCallback)
|
extVasPayGroup.POST("alipay_callback", AlipayCallback)
|
||||||
extVasPayGroup.POST("wxpay_callback", WxpayCallback)
|
extVasPayGroup.POST("wxpay_callback", WxpayCallback)
|
||||||
|
extVasPayGroup.POST("wxpay_callback_manual", middleware.JSONParamValidator(vasproto.WxpayCallbackManualParam{}), WxpayCallbackManual)
|
||||||
|
|
||||||
opVasPayGroup := r.Group("/op/vas", PrepareOp())
|
opVasPayGroup := r.Group("/op/vas", PrepareOp())
|
||||||
opVasPayGroup.POST("create_order", middleware.JSONParamValidator(vasproto.OpCreateOrderReq{}), OpCreateOrder)
|
opVasPayGroup.POST("create_order", middleware.JSONParamValidator(vasproto.OpCreateOrderReq{}), OpCreateOrder)
|
||||||
|
|
|
@ -31,3 +31,13 @@ func WxpayCallback(ctx *gin.Context) {
|
||||||
}
|
}
|
||||||
ctx.String(200, "success")
|
ctx.String(200, "success")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func WxpayCallbackManual(ctx *gin.Context) {
|
||||||
|
req := ctx.MustGet("client_req").(*vasproto.WxpayCallbackManualParam)
|
||||||
|
service.DefaultService.PayCallback(ctx, &vasproto.PayCallbackParamIn{
|
||||||
|
OrderId: req.OrderId,
|
||||||
|
OutOrderId: req.OutOrderId,
|
||||||
|
CallbackPayType: vasproto.CallBackPayTypeWxpay,
|
||||||
|
})
|
||||||
|
ctx.String(200, "success")
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue