package com.jeequan.jeepay.core.interfaces.transfer;

import com.jeequan.jeepay.core.model.tranfer.TransferBasicInfo;
import org.apache.commons.lang3.tuple.MutablePair;

import javax.servlet.http.HttpServletRequest;

/**
 * 转账发起方和接收方对象相关的操作
 *
 * @author deng
 * @since 2024/4/25
 */
public interface IChannelTransferSubjectService {

    MutablePair<String, Object> parseParam(HttpServletRequest request, String customApplyId);

    /**
     * 添加转账方
     * @param transferBasicInfo
     */
    void addExporter(TransferBasicInfo transferBasicInfo);

    /**
     * 添加接收方
     * @param transferBasicInfo
     */
    void addAcceptor(TransferBasicInfo transferBasicInfo);

    /**
     * 添加转账方或接收方的三方请求业务回调
     */
    default Object callback(Object bizContent) {
        callbackProcess(bizContent);
        return retOk(bizContent);
    }

    void callbackProcess(Object bizContent);

    Object retOk(Object bizContent);
}
