
/**
 * Web唐明明
 * 匆匆数载恍如梦，岁月迢迢华发增。
 * 碌碌无为枉半生，一朝惊醒万事空。
 * moduleName: 收银台
 */

import { request } from '../index'

// 抖火币支付
const coinPay = orderId => {
	return request({
		url		: 'pay/order/' + orderId + '/score',
	})
}

// 抖火币补差价支付
const diffCoinPay = orderId => {
	return request({
		url		: 'pay/diff/' + orderId + '/score'
	})
}

// ❤️银联支付
const umsPay = (orderId, data) => {
	return request({
		url		: 'pay/order/' + orderId + '/ums',
		data
	})
}

// 银联支付补差价
const diffUmsPay = (orderId, data) => {
	return request({
		url: 'pay/diff/' + orderId + '/ums',
		data
	})
}

// ️银联支付查询支付结果
const umsState = (trade_id) => {
	return request({
		url		: 'payments/query/' + trade_id,
	})
}

// 自由服务包订单信息
const umsFreeInfo = (service) => {
	return request({
		url		: 'app/services/recharge/' + service + '/order',
		method: 'POST'
	})
}

// 自由服务包支付
const umsFree = (orderNo, type) => {
	return request({
		url		: 'app/services/recharge/' + orderNo + '/ums',
		data	: { type },
		method: 'POST' 
	})
}

// 斗拱支付
const dgPay = (orderId, data) => {
	return request({
		url		: 'pay/order/' + orderId + '/dg',
		data
	})
}

// 斗拱支付补差价
const diffDgPay = (orderId, data) => {
	return request({
		url: 'pay/diff/' + orderId + '/dg',
		data
	})
}

// 斗拱支付自由服务包
const dgFree = (orderNo, type) => {
	return request({
		url		: 'app/services/recharge/' + orderNo + '/dg',
		data	: { ...type },
		method: 'POST' 
	})
}

// 银联综法支付
const umsSynthesize = data => {
	return request({
		url		: 'pay/cashier_desk/ums',
		data,
		method: 'POST' 
	})
}

// 抖拱综法支付
const dgSynthesize = data => {
	return request({
		url		: 'pay/cashier_desk/dg',
		data,
		method: 'POST' 
	})
}

// 火力值综法支付
const coinSynthesize = data => {
	return request({
		url		: 'pay/cashier_desk/score',
		data,
		method: 'POST' 
	})
}

export {
	coinPay,
	diffCoinPay,
	umsPay,
	diffUmsPay,
	umsState,
	umsFree,
	umsFreeInfo,
	dgPay,
	diffDgPay,
	dgFree,
	umsSynthesize,
	dgSynthesize,
	coinSynthesize
}