package com.zhongshu.card.client.utils;

import org.apache.commons.lang3.StringUtils;

/**
 * 支付异常提示
 *
 * @author TRX
 * @date 2024/11/4
 */
public class PayExceptionToShowUtil {

    /**
     * 支付中心
     *
     * @param cls
     * @return
     */
    public static String convertException(String cls) {
        String msg = "";
        if (StringUtils.isNotEmpty(cls)) {
            if (cls.contains("BalanceRangeMinException")) {
                msg = "钱包余额不足"; // 消费金额超出限制
            } else if (cls.contains("BalanceRangeMaxException")) {
                msg = "钱包余额不足";
            } else if (cls.contains("UncategorizedMongoDbException")) {
                msg = "内部错误";
            }
        }
        return msg;
    }

}
