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

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.jeequan.jeepay.core.annotate.ChannelMchId;
import com.jeequan.jeepay.core.constants.ChannelMchIdTypeEnum;
import com.jeequan.jeepay.core.model.params.NormalMchParams;
import lombok.Data;

/*
 * 银联支付 普通商户参数定义
 *
 * @author jmdhappy
 *
 * @date 2021/12/01 10:51
 */
@Data
public class UnionpayNormalMchParams extends NormalMchParams {

    /** 是否沙箱环境 */
    private Byte sandbox;

    /** 商户号 */
    @ChannelMchId(type = ChannelMchIdTypeEnum.MCH_NO)
    private String merId;

    /** 敏感加密证书 */
    private String encryptCert;

    /** 商户私钥证书,签名使用 */
    private String merPrivateCert;

    /** 商户私钥证书密码 */
    private String merPrivateCertPwd;

    /** 验签中级证书 */
    private String unionMiddleCert;

    /** 验签根证书 */
    private String unionRootCert;

    @Override
    public String deSenData() {
        UnionpayNormalMchParams mchParams = this;
        return ((JSONObject) JSON.toJSON(mchParams)).toJSONString();
    }

}
