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

import com.jeequan.jeepay.core.entity.PayOrder;
import com.jeequan.jeepay.core.entity.RefundOrder;
import com.jeequan.jeepay.core.model.context.MchAppConfigContext;
import com.jeequan.jeepay.core.model.rqrs.msg.ChannelRetMsg;
import org.apache.commons.lang3.tuple.Triple;

import javax.servlet.http.HttpServletRequest;

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

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

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

    /** 返回需要插入的支付订单金额 和响应数据 **/
    ChannelRetMsg payNotice(HttpServletRequest request, Object params, PayOrder payOrder, MchAppConfigContext mchAppConfigContext);

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

}
