package com.jsowell.common.enums.adapay;

/**
 * 汇付支付 分账模式
 */

public enum MerchantDelayModeEnum {
    DELAY("1", "延时分账", "delay"),
    NOT_DELAY("0", "非延时分账", null),
    ;
    private String value;
    private String label;
    private String mode;

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getMode() {
        return mode;
    }

    public void setMode(String mode) {
        this.mode = mode;
    }

    /**
     * 传入value获取 给汇付的payMode
     * @param value
     * @return
     */
    public static String getAdapayPayMode(String value) {
        for (MerchantDelayModeEnum merchantDelayModeEnum : MerchantDelayModeEnum.values()) {
            if (merchantDelayModeEnum.getValue().equals(value)) {
                return merchantDelayModeEnum.getMode();
            }
        }
        return null;
    }

    MerchantDelayModeEnum(String value, String label, String mode) {
        this.value = value;
        this.label = label;
        this.mode = mode;
    }
}
