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;
}
}