package com.ywt.domain.models.enums;


public enum PaymentStatusEnum {
    /**
     * 支付状态: 0-待支付; 1-支付处理中; 2-支付成功; 3-支付失败;
     * */
    Pending("待支付", 0),
    Processing("支付处理中", 1),
    Success("支付成功", 2),
    Failed("支付失败", 3),
    UNKNOWN("",0);

    private final String displayName;

    private final int value;

    PaymentStatusEnum(String displayName, int value) {
        this.displayName = displayName;
        this.value = value;
    }

    public String getDisplayName() {
        return displayName;
    }

    public int getValue() {
        return value;
    }

    public static PaymentStatusEnum getPaymentStatus(int value){
        switch (value){
            case 0:
                return Pending;
            case 1:
                return Processing;
            case 2:
                return Success;
            case 3:
                return Failed;
            default:
                return UNKNOWN;
        }
    }
}
