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

import com.jeesharp.business.modules.pay.api.PayCombineTransactionChannelApi;
import com.jeesharp.business.modules.pay.combine.dto.PayCombineCloseRequestDTO;
import com.jeesharp.business.modules.pay.combine.dto.PayCombineJsapiRequestDTO;
import com.jeesharp.business.modules.pay.combine.dto.PayCombineTransactionResultDTO;
import com.jeesharp.business.modules.pay.combine.support.PayWechatCombineTransactionClient;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * {@link PayCombineTransactionChannelApi} 实现。
 *
 * @author jeesharp
 * @since 2026-06-12
 */
@Service
@AllArgsConstructor
public class PayCombineTransactionChannelApiImpl implements PayCombineTransactionChannelApi {

    private final PayWechatCombineTransactionClient payWechatCombineTransactionClient;

    @Override
    public PayCombineTransactionResultDTO jsapiPrepay(PayCombineJsapiRequestDTO request) {
        return payWechatCombineTransactionClient.jsapiPrepay(request);
    }

    @Override
    public PayCombineTransactionResultDTO queryByOutTradeNo(String platformTenantId, String combineOutTradeNo) {
        return payWechatCombineTransactionClient.queryByOutTradeNo(platformTenantId, combineOutTradeNo);
    }

    @Override
    public PayCombineTransactionResultDTO close(PayCombineCloseRequestDTO request) {
        return payWechatCombineTransactionClient.close(request);
    }
}
