Ejemplo n.º 1
0
    /// <summary>
    /// 用户信贷信息查询
    /// </summary>
    /// <param name="Uid"></param>
    /// <returns></returns>
    public QueryMemberLoanJsonInfo Query_Member_Loan(string Uid)
    {
        QueryMemberLoanJsonInfo JsonInfo = null;

        string sign, sign_type;

        string gateway = loan_url + "?_input_charset=utf-8";

        string[] parameters =
        {
            "service=query_member_loan",
            "version=1.0",
            "partner_id=" + partner_id,
            "_input_charset=utf-8",
            "uid=" + Uid,
            "need_margin=true"
        };

        sign_type = "MD5";
        sign      = pub.ReturnSignStr(parameters, "utf-8", tradesignkey);

        StringBuilder prestr = new StringBuilder();

        prestr.Append("&service=query_member_loan");
        prestr.Append("&version=1.0");
        prestr.Append("&partner_id=" + partner_id);
        prestr.Append("&sign=" + sign);
        prestr.Append("&sign_type=" + sign_type);
        prestr.Append("&uid=" + Uid);
        prestr.Append("&need_margin=true");

        string request_url = gateway + prestr.ToString();

        CookieCollection cookies = new CookieCollection();

        string strJson = HttpHelper.GetResponseString(HttpHelper.CreateGetHttpResponse(request_url, 0, "", cookies));

        JsonInfo = JsonHelper.JSONToObject <QueryMemberLoanJsonInfo>(strJson);

        if (JsonInfo != null && JsonInfo.Is_success == "T")
        {
            pub.AddSysInterfaceLog(2, "用户信贷信息查询", "成功", request_url, "授信总额:" + JsonInfo.Credit_limit + ";当前申请额度:" + JsonInfo.Apply_credit + ";已借贷款额度:" + JsonInfo.Used_credit + ";可用额度:" + JsonInfo.Available_credit);
        }
        else
        {
            pub.AddSysInterfaceLog(2, "用户信贷信息查询", "失败", request_url, JsonInfo.Error_code + ":" + JsonInfo.Error_message);
        }

        return(JsonInfo);
    }