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

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * TODO
 * 拉卡拉订单状态枚举
 * @author crystal
 * @date 2023/11/25 13:58
 */
@Getter
@AllArgsConstructor
public enum LklOrderStatus {

    INIT("INIT","初始化"),
    CREATE("CREATE","下单成功"),
    SUCCESS("SUCCESS","交易成功"),
    DEAL("DEAL","交易处理中"),
    UNKNOWN("UNKNOWN","未知状态"),
    CLOSE("CLOSE","交易关闭"),
    FAIL("FAIL","交易失败"),
    PART_REFUND("PART_REFUND","部分退款"),
    REFUND("REFUND","全部退款(或订单被撤销）");

    private final String status;

    private final String desc;

    public static LklOrderStatus getVal(String status) {
        LklOrderStatus[] orderStatuses = values();
        for (LklOrderStatus orderStatuse : orderStatuses) {
            if (orderStatuse.getStatus().equals(status)) {
                return orderStatuse;
            }
        }
        return DEAL;
    }
}
