package com.fzm.mall.server.front.repo.alipay;

import org.springframework.util.StringUtils;

public enum AlipayTradeStautsEnum {

    SUCCESS("TRADE_SUCCESS"),
    FINISHED("TRADE_FINISHED"),
    CLOSED("TRADE_CLOSED"),
    BUYER_PAY("WAIT_BUYER_PAY");


    private String status;

    AlipayTradeStautsEnum(String status){
        this.status = status;
    }


    public String getVal() {
        return status;
    }

    public static AlipayTradeStautsEnum getEnum(String val) {
        if (!StringUtils.isEmpty(val)) {
            for (AlipayTradeStautsEnum statusEnum : AlipayTradeStautsEnum.values()) {
                if (statusEnum.getVal().equals(val)) {
                    return statusEnum;
                }
            }
        }
        return null;
    }


}
