import http from '@/http/http.js'
const request = http.request

/**
 * 获取店铺订单支付URL
 * @returns
 */
export function getOrderPayUrl(data, urlType = 'order') {
	return request({
		url: `${urlType}/pay/shopPayApi/orderPayUrl`,
		method: "POST",
		data: {
			...data
		}
	})
}

/**
 * 扫码支付
 * @returns
 */
// export function scanPay(data, urlType = 'order') {
// 	return request({
// 		url: `${urlType}/pay/scanPay`,
// 		method: "POST",
// 		data: {
// 			...data
// 		}
// 	})
// }

/**
 * 现金支付
 * @returns
 */
export function cashPay(data, urlType = 'order') {
	return request({
		url: `${urlType}/pay/cashPay`,
		method: "POST",
		data: {
			...data
		}
	})
}

/**
 * 扫码/储值支付
 * @returns
 */
export function microPay(data, urlType = 'order') {
	return request({
		url: `${urlType}/pay/microPay`,
		method: "POST",
		data: {
			...data
		}
	})
}

/**
 * 挂账支付
 * @returns
 */
export function creditPay(data, urlType = 'order') {
	return request({
		url: `${urlType}/pay/creditPay`,
		method: "POST",
		data: {
			...data
		}
	})
}

/**
 * 会员支付
 * @returns
 */
export function vipPay(data, urlType = 'order') {
	return request({
		url: `${urlType}/pay/vipPay`,
		method: "POST",
		data: {
			...data
		}
	})
}

/**
 * 查询订单状态
 * @returns
 */
export function queryOrderStatus(data, urlType = 'order') {
	return request({
		url: `${urlType}/pay/queryOrderStatus`,
		method: "GET",
		data: {
			...data
		}
	})
}
// 分销员开通支付
export function mchRecharge(data, urlType = 'order') {
	return request({
		url: `${urlType}/pay/distribution/mchRecharge`,
		method: "POST",
		data: {
			...data
		}
	})
}