package com.jeequan.jeepay.thirdparty.model;

import lombok.Data;

/**
 * 商户应用支付参数信息
 * 放置到内存， 避免多次查询操作
 *
 * @author terrfly
 * @date 2021/6/8 17:29
 */
@Data
public class MchAppConfigBy3rdContext extends com.jeequan.jeepay.core.model.context.MchAppConfigContext {

    /** 缓存支付宝client 对象 **/
    private AlipayClientWrapper alipayClientWrapper;

    /** 缓存 wxServiceWrapper 对象 **/
    private WxServiceWrapper wxServiceWrapper;

    /** 缓存 Paypal 对象 **/
    private PaypalWrapper paypalWrapper;

    public AlipayClientWrapper getAlipayClientWrapper(){
        return isIsvsubMch() ? ((IsvConfigBy3rdContext)isvConfigContext).getAlipayClientWrapper(): alipayClientWrapper;
    }

    public WxServiceWrapper getWxServiceWrapper(){
        return isIsvsubMch() ? ((IsvConfigBy3rdContext)isvConfigContext).getWxServiceWrapper(): wxServiceWrapper;
    }

}
