package cn.iocoder.yudao.framework.pay.core.client.dto.divide;

import lombok.Data;

/**
 * @author zt
 * @description <description class purpose>
 * @since 2024/7/17
 */
@Data
public class PayDivideBackRespDto {
    private String subMchId;
    private String orderId;
    private String outOrderNo;
    private String outReturnNo;
    private String returnId;
    private String returnMchid;
    private Long amount;
    private String description;
    private String result;
    private String failReason;
    private String createTime;
    private String finishTime;


    private String channelErrorCode;
    /**
     * 调用渠道报错时，错误信息
     */
    private String channelErrorMsg;

    /**
     * 原始的异步通知结果
     */
    private Object rawData;

    /**
     * 创建【FAILURE】状态的退款返回
     */
    public static PayDivideBackRespDto failureOf(String channelErrorCode, String channelErrorMsg,
                                             String transactionId, Object rawData) {
        PayDivideBackRespDto respDTO = new PayDivideBackRespDto();
        //respDTO.status = PayRefundStatusRespEnum.FAILURE.getStatus();
        respDTO.channelErrorCode = channelErrorCode;
        respDTO.channelErrorMsg = channelErrorMsg;
        // 相对通用的字段
        respDTO.orderId = transactionId;
        respDTO.rawData = rawData;
        return respDTO;
    }
}
