+Pay4Order
This commit is contained in:
@@ -28,3 +28,19 @@ func (c *JxOrderController) CreateOrder() {
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 请求支付京西商城订单
|
||||
// @Description 请求支付京西商城订单
|
||||
// @Param token header string true "认证token"
|
||||
// @Param vendorOrderID formData string true "订单ID"
|
||||
// @Param payType formData int true "支付类型"
|
||||
// @Param vendorPayType formData string true "平台支付类型"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /Pay4Order [post]
|
||||
func (c *JxOrderController) Pay4Order() {
|
||||
c.callPay4Order(func(params *tJxorderPay4OrderParams) (retVal interface{}, errCode string, err error) {
|
||||
retVal, err = localjx.Pay4Order(params.Ctx, utils.Str2Int64(params.VendorOrderID), params.PayType, params.VendorPayType)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import (
|
||||
"net/http"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/wxpay"
|
||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/jx/localjx"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
"github.com/astaxie/beego"
|
||||
)
|
||||
|
||||
@@ -13,8 +15,14 @@ type WXPayController struct {
|
||||
|
||||
func (c *WXPayController) Msg() {
|
||||
if c.Ctx.Input.Method() == http.MethodPost {
|
||||
var callbackResponse *wxpay.CallbackResponse
|
||||
|
||||
msg, callbackResponse := api.WxpayAPI.GetCallbackMsg(c.Ctx.Request)
|
||||
if callbackResponse == nil {
|
||||
if err := localjx.OnWxPayCallback(msg); err != nil {
|
||||
if msg.MsgType != wxpay.MsgTypeUnkown {
|
||||
callbackResponse = wxpay.Err2CallbackResponse(err, "")
|
||||
}
|
||||
}
|
||||
}
|
||||
if callbackResponse == nil {
|
||||
callbackResponse = wxpay.SuccessResponse
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user