using Hncore.Infrastructure.Data;
using Hncore.Pass.PaymentCenter.Domain;

namespace Hncore.Pass.PaymentCenter.WeiFuTong
{
    public class WeiFuTongConfig
    {
        public const string WeiFuTongUrl = "https://pay.hstypay.com/v2/pay/gateway";

        public const string QuanFuTongUrl = "https://pay.swiftpass.cn/pay/gateway";
    }

    public static class Extension
    {
        public static string GetUrl(this PaymentChannel paymentChannel)
        {
            if (paymentChannel == PaymentChannel.WeiFuTong)
            {
                return WeiFuTongConfig.WeiFuTongUrl;
            }

            if (paymentChannel == PaymentChannel.QuanFuTong)
            {
                return WeiFuTongConfig.QuanFuTongUrl;
            }

            BusinessException.Throw("未知支付渠道");

            return "";
        }
    }
}