package org.dromara.pay.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 退款状态枚举
 *
 * @author pengles
 */
@Getter
@AllArgsConstructor
public enum RefundStatusEnum {

    WAITING(0, "等待"),
    SUCCESS(10, "成功"),
    FAIL(20, "失败");

    private final Integer code;
    private final String name;

    public static RefundStatusEnum getByCode(Integer code) {
        for (RefundStatusEnum value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
