package com.njzscloud.supervisory.wxPay.service;

import com.github.binarywang.wxpay.exception.WxPayException;
import com.njzscloud.supervisory.order.pojo.result.PaymentContextResult;
import com.njzscloud.supervisory.wxPay.dto.RefundRequestDto;

import java.math.BigDecimal;

/**
 * 退款服务接口
 * @author ljw
 */
public interface PaymentService {

    /**
     * 申请退款
     */
    void refund(RefundRequestDto refundRequest, PaymentContextResult ctx, Boolean isChange);

    /**
     * 执行分账（支付成功后）
     */
    void profitSharing(Long orderId, String transactionId, BigDecimal totalAmount) throws WxPayException;

    /**
     * 分账回退
     */
    void profitSharingReturn(Long orderId, BigDecimal refundAmount) throws WxPayException;

    /**
     * 重新分账剩余金额（用于部分退款后）
     */
    void reProfitSharing(Long orderId, String transactionId, BigDecimal remainingAmount) throws WxPayException;

    /**
     * 执行分账（支付成功后）
     */
    void profitSharingAsync(Long orderId, String transactionId, BigDecimal totalAmount) throws WxPayException;
}
