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

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * TODO
 * 拉卡拉交易状态枚举
 * @author crystal
 * @date 2023/6/7 10:19
 */
@Getter
@AllArgsConstructor
public enum LklTradeStatus {

    INIT("INIT","初始化"),

    CREATE("CREATE","下单成功"),

    SUCCESS("SUCCESS","交易成功"),

    FAIL("FAIL","交易失败"),

    DEAL("DEAL","交易处理中"),

    UNKNOWN("UNKNOWN","未知状态"),

    CLOSE("CLOSE","交易关闭"),

    PART_REFUND("PART_REFUND","部分退款"),

    REFUND("REFUND","退款成功"),

    REVOKED("REVOKED","订单撤销");

    private final String tradeStatus;

    private final String desc;

    public static LklTradeStatus getVal(String tradeStatus){
        LklTradeStatus[] values = values();
        for (LklTradeStatus val:values) {
            if(val.getTradeStatus().equals(tradeStatus)){
                return val;
            }
        }
        return UNKNOWN;
    }
}
