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

import lombok.AllArgsConstructor;
import lombok.Getter;

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

    PROCESSING("P","处理中"),

    RECT("C","被冲正"),

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

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

    SEND_FAIL("X","发送失败"),

    EXPIRE("T","发送超时");

    private final String tradeStatus;

    private final String desc;

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