import request from '@/utils/request'

// 查询支付明细列表
export function listStorePayment(query,refundDateRange) {
    if (null != refundDateRange && '' != refundDateRange) {
      query.refundBeginTime = refundDateRange[0];
      query.refundEndTime = refundDateRange[1];
    }else{
      query.refundBeginTime =null;
      query.refundEndTime =null;
    }
    return request({
      url: '/store/store/storePayment/list',
      method: 'get',
      params: query
    })
}

// 查询支付明细详细
export function getStorePayment(paymentId) {
  return request({
    url: '/store/store/storePayment/' + paymentId,
    method: 'get'
  })
}

// 新增支付明细
export function addStorePayment(data) {
  return request({
    url: '/store/store/storePayment',
    method: 'post',
    data: data
  })
}

export function refundStorePayment(data) {
  return request({
    url: '/store/store/storePayment/refundStorePayment',
    method: 'post',
    data: data
  })
}


// 修改支付明细
export function updateStorePayment(data) {
  return request({
    url: '/store/store/storePayment',
    method: 'put',
    data: data
  })
}

// 删除支付明细
export function delStorePayment(paymentId) {
  return request({
    url: '/store/store/storePayment/' + paymentId,
    method: 'delete'
  })
}

// 导出支付明细
export function exportStorePayment(query) {
  return request({
    url: '/store/store/storePayment/export',
    method: 'get',
    params: query
  })
}

//同步订单状态
export function setPayNotify(data) {
  return request({
    url: '/store/store/storePayment/returnPayStatus',
    method: 'post',
    data: data
  })
}

//同步订单状态
export function oneClickShipping(data) {
  return request({
    url: '/store/store/storePayment/oneClickShipping',
    method: 'post',
    data: data
  })
}
