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

import java.io.IOException;

/**
 * 延时结算标识
 * 0 非延时确认交易,按商户开通的结算周期结算（D1或T1）
 * 1 延时确认交易,此笔交易需等待调用接口【7.1延时交易确认】接口才会结算
 *
 */
public enum DelaySettleFlag {

    THE_0, THE_1;

    public String toValue() {
        switch (this) {
            case THE_0 -> {
                return "0";
            }
            case THE_1 -> {
                return "1";
            }
        }
        return null;
    }

    public static DelaySettleFlag forValue(String value) throws IOException {
        return switch (value) {
            case "0" -> THE_0;
            case "1" -> THE_1;
            default -> throw new IOException("Cannot deserialize DelaySettleFlag");
        };
    }
}
