package com.jeequan.jeepay.thirdparty.channel.ryxpay.model;

import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.text.DateFormat;

/**
 * TODO
 * 瑞银信支付业务公共参数
 * @author crystal
 * @date 2024/2/29 13:48
 */
@Data
@NoArgsConstructor
public class PayBizEntity {

    public static final String DEFAULT_VERSION = "1.0.0";

    private String version;

    /**
     * 取值范围
     * 合作方相关报文：01
     * 扫码支付平台相关报文：02
     */
    private String msgType;

    /**
     * 平台返回流水号
     */
    private String smzfMsgId;


    private String reqDate;

    /**
     * 业务参数
     */
    private JSONObject data;


    public PayBizEntity(JSONObject data,String msgId) {
        this.version = DEFAULT_VERSION;
        this.msgType = "01";
        this.smzfMsgId = msgId;
        this.reqDate = DateUtil.format(DateUtil.date(), DatePattern.PURE_DATETIME_FORMAT);
        this.data = data;
    }
}
