BeeCloud.BCPay.BCPayByChannel C# (CSharp) Метод

BCPayByChannel() публичный статический Метод

支付
public static BCPayByChannel ( BCBill bill ) : BCBill
bill BeeCloud.Model.BCBill
Результат BeeCloud.Model.BCBill
        public static BCBill BCPayByChannel(BCBill bill)
        {
            string payUrl = "";
            if (!BCCache.Instance.testMode)
            {
                payUrl = BCPrivateUtil.getHost() + BCConstants.version + BCConstants.billURL;
            }
            else
            {
                payUrl = BCPrivateUtil.getHost() + BCConstants.version + BCConstants.billTestURL;
            }

            string paraString = preparePayParameters(bill);

            try
            {
                HttpWebResponse response = BCPrivateUtil.CreatePostHttpResponse(payUrl, paraString, BCCache.Instance.networkTimeout);

                string respString = BCPrivateUtil.GetResponseString(response);

                return handlePayResult(respString, bill);
            }
            catch (Exception e)
            {
                var ex = new BCException(e.Message);
                throw ex;
            }
        }