package com.czg.service.order.service;

import com.czg.entity.resp.CzgBaseResp;
import com.czg.entity.resp.CzgRefundResp;
import com.czg.order.dto.OrderInfoRefundDTO;
import com.czg.resp.CzgResult;
import com.czg.service.order.dto.*;
import lombok.NonNull;

import java.math.BigDecimal;
import java.util.Map;


/**
 * 支付
 *
 * @author ww
 */
public interface PayService {
    /**
     * 挂账
     */
    CzgResult<Object> creditPayOrder(OrderPayParamDTO payParam);

    /**
     * 现金支付
     */
    CzgResult<Object> cashPayOrder(OrderPayParamDTO payParam);

    /**
     * 会员支付
     */
    CzgResult<Object> vipPayOrder(OrderPayParamDTO payParam);

    /**
     * 充值并付款
     */
    CzgResult<Map<String, Object>> rechargePayOrder(String clintIp, OrderPayParamDTO payParam);

    /**
     * h5支付
     */
    CzgResult<Map<String, Object>> h5PayOrder(String clintIp, OrderPayParamDTO payParam);

    /**
     * js支付
     */
    CzgResult<Map<String, Object>> jsPayOrder(String clintIp, OrderPayParamDTO payParam);

    CzgResult<Map<String, Object>> js2PayOrder(@NonNull String clintIp, OrderPayParamDTO payParam);

    /**
     * 小程序支付
     */
    CzgResult<Map<String, Object>> ltPayOrder(String clintIp, OrderPayParamDTO payParam);

    /**
     * PC扫码支付
     */
    CzgResult<Map<String, Object>> scanPayOrder(String clintIp, OrderPayParamDTO payParam);

    /**
     * 聚合反扫
     */
    CzgResult<Map<String, Object>> microPayOrder(OrderPayParamDTO payParam);


    /**
     * 现金充值
     */
    CzgResult<Object> cashPayVip(VipPayParamDTO payParam);

    /**
     * js支付
     */
    CzgResult<Map<String, Object>> jsPayVip(String clintIp, VipPayParamDTO payParam);

    /**
     * 小程序支付
     */
    CzgResult<Map<String, Object>> ltPayVip(String clintIp, VipPayParamDTO payParam);

    /**
     * PC扫码支付
     */
    CzgResult<Map<String, Object>> scanPayVip(String clintIp, VipPayParamDTO payParam);

    /**
     * 聚合反扫
     */
    CzgResult<Map<String, Object>> microPayVip(VipPayParamDTO payParam);

    /**
     * 退款前校验
     */
    CzgResult<Map<String, BigDecimal>> refundVipBefore(VipRefundDTO payParam);

    /**
     * 会员退款
     */
    CzgResult<Object> refundVip(VipRefundDTO payParam);

    CzgResult<Object> refundOrderBefore(OrderInfoRefundDTO param);

    /**
     * 订单退款
     */
    void refundOrder(Long shopId, Long orderId, Long payOrderId, String refPayOrderNo, String refundReason, BigDecimal refundAmount);

    /**
     * 支付查询
     *
     * @param payOrderId 平台订单号
     * @param mchOrderNo 商户订单号
     */
    CzgResult<CzgBaseResp> queryPayOrder(Long shopId, String payOrderId, String mchOrderNo);

    /**
     * 退款查询
     *
     * @param mchRefundNo   商户退款订单号 二选一
     * @param refundOrderId 平台退款订单号 二选一
     */
    CzgResult<CzgRefundResp> queryRefund(Long shopId, String mchRefundNo, String refundOrderId);

    CzgResult<Map<String, Object>> ltPayMember(String clientIP, VipMemberPayParamDTO payParam);

    CzgResult<Map<String, Object>> recharge(String clientIP, VipPayParamDTO rechargeDTO, Long userId);
}
