package com.yn.bftl.thirdparty.modules.unionpay.service;

import com.yn.bftl.common.modules.order.dto.IRefundDTO;
import com.yn.bftl.common.modules.order.enums.UnionpayAppTradeStatus;
import com.yn.bftl.thirdparty.modules.unionpay.dto.UnionpayAppOrderDTO;
import com.yn.bftl.thirdparty.modules.unionpay.vo.base.EasylinkpayCallbackVO;
import com.yn.bftl.thirdparty.modules.unionpay.vo.base.UnionpayResponseVO;

import java.util.Map;

/**
 * 银联服务
 * 1.支付时创建结算单、分账单
 * 2.退款时创建退款结算单，退款分账单
 *
 * @author huabiao
 * @create 2022/8/30  15:11
 **/
public interface UnionpayService {

    /**
     * 银联-下单
     *
     * @param unionpayAppOrderDTO:
     * @return
     * @description
     * @author huabiao
     * @create 2022/8/30  15:15
     */
    Map<String, Object> appOrder(UnionpayAppOrderDTO unionpayAppOrderDTO);

    /**
     * 订单交易查询
     *
     * @param unionpaySn
     * @return
     */
    UnionpayAppTradeStatus orderQuery(String unionpaySn);

    /**
     * 银联-退款
     * <p>针对售后单进行退款操作</p>
     *
     * @param iRefundDTO:退款DTO
     * @return 银联退款单号
     * @author huabiao
     * @create 2022/9/3  17:25
     */
    String refund(IRefundDTO iRefundDTO);

    /**
     * 银联聚合支付回调
     *
     * @param merOrderId
     * @return
     */
    String aggregateCallBack(String merOrderId);

    /**
     * 退款查询
     *
     * @param refundMerOrderId
     * @return
     */
    UnionpayResponseVO refundQuery(String refundMerOrderId);

    /**
     * 订单关闭
     *
     * @return
     */
    UnionpayResponseVO orderClose(Long paymentId);
}
