package com.jeequan.jeepay.core.model.params.lmspay;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.jeequan.jeepay.core.model.params.IsvParams;
import com.jeequan.jeepay.core.utils.StringKit;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/*
* 立码收 配置参数
*
* @author zhuxiao
*
* @date 2021/6/8 18:02
*/
@Data
public class LmspayIsvParams extends IsvParams {

    /** 加密密钥 */
    private String secretKey;

    /** 商户公钥 */
    private String publicKey;


    @Override
    public String deSenData() {

        LmspayIsvParams isvParams = this;
        if (StringUtils.isNotBlank(this.secretKey)) {
            isvParams.setSecretKey(StringKit.autoDesensitization(this.secretKey));
        }
        if (StringUtils.isNotBlank(this.publicKey)) {
            isvParams.setPublicKey(StringKit.autoDesensitization(this.publicKey));
        }
        return ((JSONObject)JSON.toJSON(isvParams)).toJSONString();
    }
}
