package com.ycwl.basic.pay.adapter;

// 假设request对象所在的包，可根据实际情况修改
import com.ycwl.basic.pay.entity.CancelOrderRequest;
import com.ycwl.basic.pay.entity.CreateOrderRequest;
import com.ycwl.basic.pay.entity.CreateOrderResponse;
import com.ycwl.basic.pay.entity.PayResponse;
import com.ycwl.basic.pay.entity.RefundResponse;
import com.ycwl.basic.pay.entity.RefundOrderRequest;
import com.ycwl.basic.pay.entity.RefundOrderResponse;

import jakarta.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.Map;

// 将接口改为抽象类
public interface IPayAdapter {
    // 下单方法
    CreateOrderResponse createOrder(CreateOrderRequest request);

    // 获取支付参数方法
    Map<String, Object> getPaymentParams(CreateOrderResponse response);

    // 处理回调信息方法
    PayResponse handleCallback(HttpServletRequest request) throws IOException;

    // 查询订单状态方法
    PayResponse queryOrder(String orderNo);

    // 退款方法
    RefundOrderResponse refund(RefundOrderRequest request);

    // 处理退款回调方法
    RefundResponse handleRefundCallback(HttpServletRequest request) throws IOException;

    // 查询退款订单状态方法
    RefundResponse checkRefundStatus(String refundNo);

    void loadConfig(Map<String, String> config);

    void cancelOrder(CancelOrderRequest request);
}
