import { useRequest } from '@/use/useHttp'

/**
 * 获取应收单订单支付方式信息
 */
export const GetOrderPayApi = () => {
  return useRequest({
    url: '/v1/mall/orderPayment/orderPaymentMethodInfo',
    method: 'get',
  })
}

/**
 * 应收单订单支付提交
 */
export const SubmitOrderPayApi = () => {
  return useRequest({
    url: '/v1/mall/orderPayment/orderPaymentSubmission',
    method: 'put',
  })
}

/**
 * 获取预付单支付方式信息
 */
export const GetPrepayOrderPayApi = () => {
  return useRequest({
    url: '/v1/mall/orderPayment/preCollectOrder/orderPaymentMethodInfo',
    method: 'get',
  })
}

/**
 * 预付单订单支付提交
 */
export const SubmitPrepayOrderPayApi = () => {
  return useRequest({
    url: '/v1/mall/orderPayment/preCollectOrder/orderPaymentSubmission',
    method: 'put',
  })
}

/**
 * 查询支付成功接口
 */
export const SubmitTradeOrderPayApi = () => {
  return useRequest({
    url: '/v1/mall/trade',
    method: 'put',
  })
}

/**
 * 打开收银台后调用
 */
export const SubmitNeedHandleApi = () => {
  return useRequest({
    url: '/v1/mall/trade/needHandle',
    method: 'put',
  })
}
