This commit is contained in:
邹宗楠
2025-04-27 10:21:07 +08:00
parent a900238a6b
commit 103197adf0
8 changed files with 533 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
package controllers
import (
"encoding/json"
"errors"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxutils"
@@ -40,6 +41,56 @@ func (c *JxOrderController) CreateOrder() {
})
}
// @Title 京西门店订单扫码枪扫码支付
// @Description 京西门店订单扫码枪扫码支付
// @Param token header string true "认证token"
// @Param vendorOrderID formData string true "订单ID"
// @Param paymentLabel formData string true "支付身份标示"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /Pay4OrderByBarCodeScanner [post]
func (c *JxOrderController) Pay4OrderByBarCodeScanner() {
c.callPay4OrderByBarCodeScanner(func(params *tJxorderPay4OrderByBarCodeScannerParams) (retVal interface{}, errCode string, err error) {
retVal, err = localjx.BarCodeScannerPay(params.VendorOrderID, params.PaymentLabel)
return retVal, "", err
})
}
// @Title 手动刷新扫码枪扫码支付订单状态
// @Description 手动刷新扫码枪扫码支付订单状态
// @Param token header string true "认证token"
// @Param vendorOrderID formData string true "订单ID"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /RefreshPayStatus [post]
func (c *JxOrderController) RefreshPayStatus() {
c.callRefreshPayStatus(func(params *tJxorderRefreshPayStatusParams) (retVal interface{}, errCode string, err error) {
retVal, err = localjx.QueryBarCodeScannerStatus(params.VendorOrderID)
return retVal, "", err
})
}
// @Title 到店扫码支付订单退款
// @Description 到店扫码支付订单退款
// @Param token header string true "认证token"
// @Param vendorOrderID formData string true "订单ID"
// @Param skuIds formData string true "[key:value]退款商品 skuId:count,int"
// @Param Reason formData string false "退单原因"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /RefundOnlineOrder [post]
func (c *JxOrderController) RefundOnlineOrder() {
c.callRefundOnlineOrder(func(params *tJxorderRefundOnlineOrderParams) (retVal interface{}, errCode string, err error) {
skuIds := make(map[int]int, 0)
if err = json.Unmarshal([]byte(params.SkuIds), &skuIds); err != nil {
return nil, "", err
}
err = localjx.RefundBarCodeScannerOrder(params.Ctx, params.VendorOrderID, skuIds, params.Reason)
return retVal, errCode, err
})
}
// @Title 请求支付京西商城订单
// @Description 请求支付京西商城订单
// @Param token header string true "认证token"