package com.ruoyi.pay.enums;

import java.util.Arrays;

/**
 * 支付类型枚举
 * @Author liwenlong
 */
public enum PayEnums {

    app_alipay(1, "app支付宝"),

    h5_alipay(2, "h5支付宝"),

    app_weChat(3, "app微信"),

    h5_WeChat(4, "h5微信"),

    applet(5, "小程序"),

    apple (6, "苹果支付"),

    balance(7, "余额"),

    lakala_ccss(8, "拉卡拉聚合收银台"),


    ;

    private final Integer code;
    private final String name;

    public static String getName(Integer code) {
        return getPayEnums(code).name;
    }


    public static PayEnums getPayEnums(Integer code) {
        return Arrays.stream(PayEnums.values()).filter(c->c.getCode().equals(code)).findFirst().get();
    }

    PayEnums(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }


}
