package com.wzj.soopin.transaction.enums.easypay;

import java.io.IOException;

/**
 * 禁用支付渠道
 */
public enum LimitCreditPay {

    CREDIT_CARD, DEBIT_CARD;

    public String toValue() {
        switch (this) {
            case CREDIT_CARD -> {
                return "creditCard";
            }
            case DEBIT_CARD -> {
                return "debitCard";
            }
        }
        return null;
    }

    public static LimitCreditPay forValue(String value) throws IOException {
        return switch (value) {
            case "creditCard" -> CREDIT_CARD;
            case "debitCard" -> DEBIT_CARD;
            default -> throw new IOException("Cannot deserialize LimitCreditPay");
        };
    }
}
