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

import com.jeequan.jeepay.core.model.autopos.ChannelOrderAcceptParams;
import com.jeequan.jeepay.core.model.autopos.ChannelOrderAcceptRetMsg;
import com.jeequan.jeepay.core.model.context.MchAppConfigContext;
import com.jeequan.jeepay.core.model.params.IsvParams;

import javax.servlet.http.HttpServletRequest;

/*
* 渠道侧的订单通知解析实现 【支付通知（payNotice）和退款通知(refundNotice) 】
*
* @author zx
*
* @date 2021/5/8 15:14
*/
public interface IChannelOrderAcceptService {

    /** 获取到接口code **/
    String getIfCode();

    /** 解析参数：
     *  异常需要自行捕捉，并返回null , 表示已响应数据。
     * **/
    ChannelOrderAcceptParams parseParams(HttpServletRequest request, IsvParams isvParams);

    /** 返回需要插入的支付订单金额 和响应数据 **/
    ChannelOrderAcceptRetMsg payNotice(HttpServletRequest request, Object params, MchAppConfigContext mchAppConfigContext, String ifCode) throws Exception;

    /** 返回需要插入的退款订单金额 和响应数据 **/
    ChannelOrderAcceptRetMsg refundNotice(HttpServletRequest request, Object params, MchAppConfigContext mchAppConfigContext, String ifCode);

}
