package com.jeesharp.business.modules.pay.application.api;

import com.jeesharp.business.modules.pay.api.PayRefundChannelApi;
import com.jeesharp.business.modules.pay.refund.dto.PayRefundRequestDTO;
import com.jeesharp.business.modules.pay.refund.dto.PayRefundResultDTO;
import com.jeesharp.business.modules.pay.refund.support.PayWechatRefundClient;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * {@link PayRefundChannelApi} 实现，委托微信 V3 退款客户端。
 *
 * @author jeesharp
 * @since 2026-06-11
 */
@Service
@AllArgsConstructor
public class PayRefundChannelApiImpl implements PayRefundChannelApi {

    private final PayWechatRefundClient payWechatRefundClient;

    @Override
    public PayRefundResultDTO applyRefund(PayRefundRequestDTO request) {
        return payWechatRefundClient.applyRefund(request);
    }

    @Override
    public PayRefundResultDTO queryByOutRefundNo(String platformTenantId, String wechatPayMode,
            String subMchId, String outRefundNo) {
        return payWechatRefundClient.queryByOutRefundNo(platformTenantId, wechatPayMode, subMchId, outRefundNo);
    }
}
