예제 #1
0
        /// <summary>
        /// 获得在线付款接口参数MODEL
        /// </summary>
        /// <param name="code"></param>
        /// <param name="order"></param>
        public static Lebi_OnlinePay GetOnlinePay(Lebi_Order order, string code)
        {
            if (order == null)
            {
                return(null);
            }
            string where = "Code='" + code + "'";
            if (string.IsNullOrEmpty(order.KeyCode))
            {
                if (order.IsSupplierCash == 0 && order.Language_id > 0)
                {
                    where += " and ','+Language_ids+',' like '%," + order.Language_id + ",%'";
                }
            }
            Lebi_OnlinePay pay = B_Lebi_OnlinePay.GetModel(where);
            string         log = "";

            if (pay == null)
            {
                pay = B_Lebi_OnlinePay.GetModel("Code='" + code + "'");
            }
            if (pay == null)
            {
                log = "在线支付接口 " + code + " 配置错误";
                Log.Add(log);
            }
            else
            {
                if (order.IsSupplierCash == 1)
                {
                    Lebi_Supplier supplier = B_Lebi_Supplier.GetModel(order.Supplier_id);
                    if (supplier == null)
                    {
                        supplier = new Lebi_Supplier();
                        log      = "在线支付接口 " + code + " 配置错误[供应商ID:" + order.Supplier_id + "]";
                        Log.Add(log);
                        return(pay);
                    }
                    Lebi_OnlinePay supplierpay = B_Lebi_OnlinePay.GetModel("Code='" + code + "' and Supplier_id=" + supplier.id + "");
                    if (supplierpay == null)
                    {
                        log = "在线支付接口 " + code + " 配置错误[供应商:" + supplier.SubName + ",ID:" + order.Supplier_id + "]";
                        Log.Add(log);
                        return(pay);
                    }
                    supplierpay.TypeName      = pay.TypeName;
                    supplierpay.Url           = pay.Url;
                    supplierpay.Code          = pay.Code;
                    supplierpay.Currency_Code = pay.Currency_Code;
                    supplierpay.Currency_id   = pay.Currency_id;
                    supplierpay.Currency_Name = pay.Currency_Name;
                    return(supplierpay);
                }
            }
            return(pay);
        }
예제 #2
0
        /// <summary>
        /// 获取一个支付方式的对于供应商设置或(默认设置)
        /// </summary>
        /// <param name="pay"></param>
        /// <returns></returns>
        public Lebi_OnlinePay Getpay(Lebi_OnlinePay pay)
        {
            if (order.IsSupplierCash == 0)
            {
                return(pay);
            }
            Lebi_OnlinePay p = B_Lebi_OnlinePay.GetModel("parentid=" + pay.id + " and Supplier_id=" + order.Supplier_id + " and IsUsed=1");

            return(p);
        }