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

import java.io.IOException;

/**
 * 支付方式，payType=UnionPayJsMini时必填
 */
public enum PayChannel {

    THE_01, THE_02;

    public String toValue() {
        switch (this) {
            case THE_01 -> {
                return "01";
            }
            case THE_02 -> {
                return "02";
            }
        }
        return null;
    }

    public static PayChannel forValue(String value) throws IOException {
        return switch (value) {
            case "01" -> THE_01;
            case "02" -> THE_02;
            default -> throw new IOException("Cannot deserialize PayChannel");
        };
    }
}
