package com.tzy.framework.pay.service;


import com.tzy.framework.pay.dto.PaymentInfoResponseDto;
import com.tzy.framework.pay.dto.PaymentRequestDto;
import com.tzy.framework.pay.dto.RefundRequestDto;
import com.tzy.framework.pay.dto.ResultMap;

import java.math.BigDecimal;

/**
 * 支付
 */
public interface PaymentService<T> {
    //支付统一下单
    public ResultMap unifiedOrder(PaymentRequestDto paymentRequestDto);
    //查询订单
    public PaymentInfoResponseDto queryPaymentOrder(String payWay, String orderNo);
    //支付退款
    @Deprecated
    public ResultMap refund(String payWay, String orderNo, BigDecimal orderPrice, BigDecimal refundAmount, String refundMsg);
    //关闭订单
    public ResultMap close(String payWay, String orderNo);
    //查询退款订单
    public ResultMap refundQuery(String payWay,String tradeNo, String refundNo);

    //
    public PaymentInfoResponseDto queryPaymentOrder(PaymentRequestDto paymentRequestDto);

    @Deprecated
    public ResultMap close(PaymentRequestDto paymentRequestDto);

    @Deprecated
    public ResultMap refund(RefundRequestDto refundRequestDto);

    public ResultMap refundQuery(RefundRequestDto refundRequestDto);
    /*********************新支付逻辑********************/

    public T initPayConfigs(String payWay, Class<T> tClass);

    //获取银行列表
    public ResultMap getBankList(PaymentRequestDto paymentRequestDto);

    /**
     * 预支付
     * @param payRequestBody
     */
    public ResultMap readPay(PaymentRequestDto payRequestBody);

    /**
     * 确认支付
     * @param payRequestBody
     */
    public ResultMap confirmPay(PaymentRequestDto payRequestBody);

    //支付统一下单
    public ResultMap unifiedOrderNew(PaymentRequestDto paymentRequestDto);
    //查询订单
    public PaymentInfoResponseDto queryPaymentOrderNew(String payWay, String orderNo);
    //支付退款
    @Deprecated
    public ResultMap refundNew(String payWay, String orderNo, BigDecimal orderPrice, BigDecimal refundAmount, String refundMsg);
    //关闭订单
    public ResultMap closeNew(String payWay, String orderNo);
    //查询退款订单
    public ResultMap refundQueryNew(String payWay,String tradeNo, String refundNo);

    //
    public PaymentInfoResponseDto queryPaymentOrderNew(PaymentRequestDto paymentRequestDto);

    public ResultMap closeNew(PaymentRequestDto paymentRequestDto);

    public ResultMap refundNew(RefundRequestDto refundRequestDto);

    public ResultMap refundQueryNew(RefundRequestDto refundRequestDto);
}
