package com.tzy.framework.pay.service;

import com.alipay.api.response.AlipayTradeQueryResponse;
import com.tzy.framework.pay.config.AliPayConfig;
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;
import java.util.Date;

/**
 * 支付宝
 */
public interface AlipayService {
    //加载alipay配置
    public AliPayConfig initConfig(String appid,String type);

    //统一支付接口
    public ResultMap unifiedOrder(String orderNo, BigDecimal amount, String body);

    /**
     * @param orderNo
     * @param amount
     * @param body
     * @param expireTime 指定过期时间,当前时间3分钟后过期
     * @return
     */
    public ResultMap unifiedOrder(String orderNo, BigDecimal amount, String body, Date expireTime);
    //统一支付接口
    public ResultMap unifiedOrder(PaymentRequestDto paymentRequestDto);
    //退款接口
    public ResultMap aliRefundNotify(String appid,String orderNo, BigDecimal amount, String body);
    /**
     * 查询订单支付情况
     * @param orderNo
     * @return
     */
    AlipayTradeQueryResponse searchOrder(String orderNo);

    public PaymentInfoResponseDto queryOrder(String appid,String orderNo);

    boolean closeTradeOrder(String orderNo);

    //关闭订单-新
    public ResultMap closeTradeOrderNew(String appid,String orderNo);

    public ResultMap unifiedOrderNew(PaymentRequestDto paymentRequestDto);

    public ResultMap aliRefundNotify(RefundRequestDto refundRequestDto);

    public PaymentInfoResponseDto queryOrder(PaymentRequestDto paymentRequestDto);

    public ResultMap queryRefundOrder(RefundRequestDto refundRequestDto);
}
