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

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 com.jeequan.jeepay.core.utils.StringKit;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/**
 * 付呗 普通商户参数定义
 *
 * @author xiaoyu
 *
 * @date 2022/5/13 11:23
 */
@Data
public class FbpayNormalMchParams extends NormalMchParams {

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

    /** 门店号 **/
    private String storeNo;

    /** privateKey */
    private String privateKey;


    @Override
    public String deSenData() {

        FbpayNormalMchParams mchParams = this;
        if (StringUtils.isNotBlank(this.privateKey)) {
            mchParams.setPrivateKey(StringKit.autoDesensitization(this.privateKey));
        }
        return ((JSONObject) JSON.toJSON(mchParams)).toJSONString();
    }

}
