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

import lombok.AllArgsConstructor;
import lombok.Getter;

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

    WAIT(0,"待支付"),
    PAYING(1,"支付中"),
    SUCCESS(2,"支付成功"),
    FAIL(3,"支付失败"),
    EXPIRE(4,"已过期"),
    CANCEL(5,"已取消"),
    PART_REFUND(6,"已退款"),
    CLOSE(7,"订单关闭");

    private final int status;

    private final String desc;

    public static Lklsb2bOrderStatus getVal(Integer status) {
        Lklsb2bOrderStatus[] orderStatuses = values();
        for (Lklsb2bOrderStatus orderStatuse : orderStatuses) {
            if (status == orderStatuse.getStatus()) {
                return orderStatuse;
            }
        }
        return WAIT;
    }
}
