예제 #1
0
        public static SZXCallbackResult VerifyCallback(string p1_MerId, string keyValue, string r0_Cmd, string r1_Code, string rb_Order, string r2_TrxId, string pa_MP, string rc_Amt, string rq_CardNo, string hmac)
        {
            string aValue = "";

            aValue = (((aValue + r0_Cmd) + r1_Code + p1_MerId) + rb_Order + r2_TrxId) + pa_MP + rc_Amt;
            if (Digest.HmacSign(aValue, keyValue) == hmac)
            {
                return(new SZXCallbackResult(r0_Cmd, r1_Code, p1_MerId, rb_Order, r2_TrxId, pa_MP, rc_Amt, rq_CardNo, hmac, ""));
            }
            return(new SZXCallbackResult(r0_Cmd, r1_Code, p1_MerId, rb_Order, r2_TrxId, pa_MP, rc_Amt, rq_CardNo, hmac, Digest.HmacSign(aValue, keyValue) + "<br>sbOld:" + aValue));
        }
예제 #2
0
        public static SZXResultTest AnnulCardTest(string p1_MerId, string keyValue, string p2_Order, string p3_Amt, string p8_Url, string pa_MP, string pa7_cardNo, string pa8_cardPwd, string pd_FrpId, string pa0_Mode, string pr_NeedResponse)
        {
            string url    = "http://tech.yeepay.com:8080/robot/debug.action";
            string aValue = "";

            aValue = ((aValue + "AnnulCard") + p1_MerId + p2_Order) + p3_Amt + p8_Url;
            if (pa0_Mode == "3")
            {
                aValue = (aValue + pa_MP) + DES.Encrypt3DESSZX(pa7_cardNo, keyValue) + DES.Encrypt3DESSZX(pa8_cardPwd, keyValue);
            }
            else if (pa0_Mode == "")
            {
                aValue = (aValue + pa_MP) + pa7_cardNo + pa8_cardPwd;
            }
            aValue = (aValue + pd_FrpId) + pa0_Mode + pr_NeedResponse;
            string para = "";

            para = (((((para + "?p0_Cmd=AnnulCard") + "&p1_MerId=" + p1_MerId) + "&p2_Order=" + p2_Order) + "&p3_Amt=" + p3_Amt) + "&p8_Url=" + HttpUtility.UrlEncode(p8_Url, Encoding.GetEncoding("gb2312"))) + "&pa_MP=" + HttpUtility.UrlEncode(pa_MP, Encoding.GetEncoding("gb2312"));
            if (pa0_Mode == "3")
            {
                para = (para + "&pa7_cardNo=" + HttpUtility.UrlEncode(DES.Encrypt3DESSZX(pa7_cardNo, keyValue), Encoding.GetEncoding("gb2312"))) + "&pa8_cardPwd=" + HttpUtility.UrlEncode(DES.Encrypt3DESSZX(pa8_cardPwd, keyValue), Encoding.GetEncoding("gb2312"));
            }
            else if (pa0_Mode == "")
            {
                para = (para + "&pa7_cardNo=" + pa7_cardNo) + "&pa8_cardPwd=" + pa8_cardPwd;
            }
            para = (((para + "&pd_FrpId=" + pd_FrpId) + "&pa0_Mode=" + pa0_Mode) + "&pr_NeedResponse=" + pr_NeedResponse) + "&hmac=" + Digest.HmacSign(aValue, keyValue);
            string strUrl = HttpUtils.SendRequest(url, para);
            string str5   = FormatQueryString.GetQueryString("r0_Cmd", strUrl, '\n');
            string str6   = FormatQueryString.GetQueryString("r1_Code", strUrl, '\n');
            string str7   = FormatQueryString.GetQueryString("r2_TrxId", strUrl, '\n');
            string str8   = FormatQueryString.GetQueryString("r6_Order", strUrl, '\n');
            string str9   = FormatQueryString.GetQueryString("rq_ReturnMsg", strUrl, '\n');

            return(new SZXResultTest(str5, str6, str7, str8, str9, FormatQueryString.GetQueryString("hmac", strUrl, '\n'), url + para, strUrl, para));
        }
예제 #3
0
        public static BuyBankDirectConnectResult BankDirectConnect(string p1_MerId, string keyValue, string p2_Order, string p3_Amt, string p4_Cur, string p5_Pid, string p6_Pcat, string p7_Pdesc, string pa7_cardNo, string pa8_cardPwd, string pa_MP, string pd_FrpId)
        {
            string aValue = "";

            aValue = (((((aValue + "BankDirectConnect" + p1_MerId) + p2_Order + p3_Amt) + p4_Cur + p5_Pid) + p6_Pcat + p7_Pdesc) + DES.Encrypt3DESJW(pa7_cardNo, keyValue) + DES.Encrypt3DESJW(pa8_cardPwd, keyValue)) + pa_MP + pd_FrpId;
            string para = "";

            para = ((((((((((((para + "?p0_Cmd=BankDirectConnect") + "&p1_MerId=" + p1_MerId) + "&p2_Order=" + p2_Order) + "&p3_Amt=" + p3_Amt) + "&p4_Cur=" + p4_Cur) + "&p5_Pid=" + HttpUtility.UrlEncode(p5_Pid, Encoding.GetEncoding("gb2312"))) + "&p6_Pcat=" + HttpUtility.UrlEncode(p6_Pcat, Encoding.GetEncoding("gb2312"))) + "&p7_Pdesc=" + HttpUtility.UrlEncode(p7_Pdesc, Encoding.GetEncoding("gb2312"))) + "&pa7_cardNo=" + HttpUtility.UrlEncode(DES.Encrypt3DESJW(pa7_cardNo, keyValue), Encoding.GetEncoding("gb2312"))) + "&pa8_cardPwd=" + HttpUtility.UrlEncode(DES.Encrypt3DESJW(pa8_cardPwd, keyValue), Encoding.GetEncoding("gb2312"))) + "&pa_MP=" + HttpUtility.UrlEncode(pa_MP, Encoding.GetEncoding("gb2312"))) + "&pd_FrpId=" + pd_FrpId) + "&hmac=" + Digest.HmacSign(aValue, keyValue);
            string strUrl = HttpUtils.SendRequest(nodeAuthorizationURL_Jun, para);
            string str4   = FormatQueryString.GetQueryString("r0_Cmd", strUrl, '\n');
            string str5   = FormatQueryString.GetQueryString("r1_Code", strUrl, '\n');
            string str6   = FormatQueryString.GetQueryString("r2_TrxId", strUrl, '\n');
            string str7   = FormatQueryString.GetQueryString("r3_Amt", strUrl, '\n');
            string str8   = FormatQueryString.GetQueryString("r4_Cur", strUrl, '\n');
            string str9   = FormatQueryString.GetQueryString("r6_Order", strUrl, '\n');
            string str10  = FormatQueryString.GetQueryString("ro_BankOrderId", strUrl, '\n');
            string str11  = FormatQueryString.GetQueryString("r8_MP", strUrl, '\n');

            return(new BuyBankDirectConnectResult(str4, str5, str6, str7, str8, str9, str10, str11, FormatQueryString.GetQueryString("hmac", strUrl, '\n'), nodeAuthorizationURL_Jun + para, strUrl));
        }
예제 #4
0
        public static bool VerifyCallback(string p1_MerId, string keyValue, string r0_Cmd, string r1_Code, string rb_Order, string r2_TrxId, string rc_Amt, string hmac)
        {
            string str = "";

            return(Digest.HmacSign(((str + r0_Cmd + r1_Code) + p1_MerId + rb_Order) + r2_TrxId + rc_Amt, keyValue) == hmac);
        }
예제 #5
0
        public static bool VerifyCallback(string p1_MerId, string keyValue, string r0_Cmd, string r1_Code, string r2_TrxId, string r3_Amt, string r4_Cur, string r5_Pid, string r6_Order, string r7_Uid, string r8_MP, string r9_BType, string hmac)
        {
            string str = "";

            return(Digest.HmacSign((((((str + p1_MerId) + r0_Cmd + r1_Code) + r2_TrxId + r3_Amt) + r4_Cur + r5_Pid) + r6_Order + r7_Uid) + r8_MP + r9_BType, keyValue) == hmac);
        }
예제 #6
0
        public static BuyRefundOrdResult RefundOrd(string p1_MerId, string keyValue, string pb_TrxId, string p3_Amt, string p4_Cur, string p5_Desc)
        {
            string aValue = "";

            aValue = ((aValue + "RefundOrd" + p1_MerId) + pb_TrxId + p3_Amt) + p4_Cur + p5_Desc;
            string para = "";

            para = ((((((para + "?p0_Cmd=RefundOrd") + "&p1_MerId=" + p1_MerId) + "&pb_TrxId=" + pb_TrxId) + "&p3_Amt=" + p3_Amt) + "&p4_Cur=" + p4_Cur) + "&p5_Desc=" + HttpUtility.UrlEncode(p5_Desc, Encoding.GetEncoding("gb2312"))) + "&hmac=" + Digest.HmacSign(aValue, keyValue);
            string strUrl = HttpUtils.SendRequest(nodeAuthorizationURL, para);
            string str4   = FormatQueryString.GetQueryString("r0_Cmd", strUrl, '\n');
            string str5   = FormatQueryString.GetQueryString("r1_Code", strUrl, '\n');
            string str6   = FormatQueryString.GetQueryString("r2_TrxId", strUrl, '\n');
            string str7   = FormatQueryString.GetQueryString("r3_Amt", strUrl, '\n');
            string str8   = FormatQueryString.GetQueryString("r4_Cur", strUrl, '\n');

            return(new BuyRefundOrdResult(str4, str5, str6, str7, str8, FormatQueryString.GetQueryString("hmac", strUrl, '\n')));
        }
예제 #7
0
        public static BuyQueryOrdDetailResult QueryOrdDetail(string p1_MerId, string keyValue, string p2_Order)
        {
            string aValue = "";

            aValue = (aValue + "QueryOrdDetail") + p1_MerId + p2_Order;
            string para = "";

            para = (((para + "?p0_Cmd=QueryOrdDetail") + "&p1_MerId=" + p1_MerId) + "&p2_Order=" + p2_Order) + "&hmac=" + Digest.HmacSign(aValue, keyValue);
            string strUrl = HttpUtils.SendRequest(nodeAuthorizationURL, para);
            string str4   = FormatQueryString.GetQueryString("r0_Cmd", strUrl, '\n');
            string str5   = FormatQueryString.GetQueryString("r1_Code", strUrl, '\n');
            string str6   = FormatQueryString.GetQueryString("r2_TrxId", strUrl, '\n');
            string str7   = FormatQueryString.GetQueryString("r3_Amt", strUrl, '\n');
            string str8   = FormatQueryString.GetQueryString("r4_Cur", strUrl, '\n');
            string str9   = FormatQueryString.GetQueryString("r5_Pid", strUrl, '\n');
            string str10  = FormatQueryString.GetQueryString("r6_Order", strUrl, '\n');
            string str11  = FormatQueryString.GetQueryString("r8_MP", strUrl, '\n');
            string str12  = FormatQueryString.GetQueryString("rb_PayStatus", strUrl, '\n');
            string str13  = FormatQueryString.GetQueryString("rc_RefundCount", strUrl, '\n');
            string str14  = FormatQueryString.GetQueryString("rd_RefundAmt", strUrl, '\n');

            return(new BuyQueryOrdDetailResult(str4, str5, str6, str7, str8, str9, str10, str11, str12, str13, str14, FormatQueryString.GetQueryString("hmac", strUrl, '\n')));
        }
예제 #8
0
        public static BuyMotoOrdResult MotoOrd(string p1_MerId, string keyValue, string p2_Order, string p3_Amt, string p4_Cur, string p5_Pid, string p7_Pdesc, string p8_Url, string pa_MP, string pd_FrpId, string pe_BuyerTel, string pf_BuyerName, string pg_BuyerAddr, string pm_Period, string pn_CheckType, string pn_Unit, string pr_NeedResponse)
        {
            string aValue = "";

            aValue = ((((((((aValue + "MotoOrd") + p1_MerId + p2_Order) + p3_Amt + p4_Cur) + p5_Pid + p7_Pdesc) + p8_Url + pa_MP) + pd_FrpId + pe_BuyerTel) + pf_BuyerName + pg_BuyerAddr) + pm_Period + pn_CheckType) + pn_Unit + pr_NeedResponse;
            string para = "";

            para = (((((((((((((((((para + "?p0_Cmd=MotoOrd") + "&p1_MerId=" + p1_MerId) + "&p2_Order=" + p2_Order) + "&p3_Amt=" + p3_Amt) + "&p4_Cur=" + p4_Cur) + "&p5_Pid=" + HttpUtility.UrlEncode(p5_Pid, Encoding.GetEncoding("gb2312"))) + "&p7_Pdesc=" + HttpUtility.UrlEncode(p7_Pdesc, Encoding.GetEncoding("gb2312"))) + "&p8_Url=" + HttpUtility.UrlEncode(p8_Url, Encoding.GetEncoding("gb2312"))) + "&pa_MP=" + HttpUtility.UrlEncode(pa_MP, Encoding.GetEncoding("gb2312"))) + "&pd_FrpId=" + pd_FrpId) + "&pe_BuyerTel=" + pe_BuyerTel) + "&pf_BuyerName=" + HttpUtility.UrlEncode(pf_BuyerName, Encoding.GetEncoding("gb2312"))) + "&pg_BuyerAddr=" + HttpUtility.UrlEncode(pg_BuyerAddr, Encoding.GetEncoding("gb2312"))) + "&pm_Period=" + pm_Period) + "&pn_CheckType=" + pn_CheckType) + "&pn_Unit=" + pn_Unit) + "&pr_NeedResponse=" + pr_NeedResponse) + "&hmac=" + Digest.HmacSign(aValue, keyValue);
            string strUrl = HttpUtils.SendRequest(nodeAuthorizationURL, para);
            string str4   = FormatQueryString.GetQueryString("r1_Code", strUrl, '\n');
            string str5   = FormatQueryString.GetQueryString("rd_MotoId", strUrl, '\n');
            string str6   = FormatQueryString.GetQueryString("r3_Amt", strUrl, '\n');
            string str7   = FormatQueryString.GetQueryString("r4_Cur", strUrl, '\n');
            string str8   = FormatQueryString.GetQueryString("r5_Pid", strUrl, '\n');
            string str9   = FormatQueryString.GetQueryString("r6_Order", strUrl, '\n');
            string str10  = FormatQueryString.GetQueryString("re_OrderIndex", strUrl, '\n');

            return(new BuyMotoOrdResult(str4, str5, str6, str7, str8, str9, str10, FormatQueryString.GetQueryString("hmac", strUrl, '\n')));
        }
예제 #9
0
        public static string CreateBuyUrl(string p1_MerId, string keyValue, string p2_Order, string p3_Amt, string p4_Cur, string p5_Pid, string p6_Pcat, string p7_Pdesc, string p8_Url, string p9_SAF, string pa_MP, string pd_FrpId, string pm_Period, string pn_Unit, string pr_NeedRespone)
        {
            string aValue = "";

            aValue = (((((((aValue + "Buy") + p1_MerId + p2_Order)
                          + p3_Amt + p4_Cur) + p5_Pid + p6_Pcat) + p7_Pdesc + p8_Url)
                       + p9_SAF + pa_MP) + pd_FrpId + pm_Period) + pn_Unit + pr_NeedRespone;

            string str2 = "";

            return((((((((((((((((str2 + nodeAuthorizationURL
                                  + "?p0_Cmd=Buy") + "&p1_MerId=" + p1_MerId)
                                + "&p2_Order=" + HttpUtility.UrlEncode(p2_Order, Encoding.GetEncoding("gb2312"))) + "&p3_Amt=" + p3_Amt) + "&p4_Cur=" + p4_Cur) + "&p5_Pid=" + HttpUtility.UrlEncode(p5_Pid, Encoding.GetEncoding("gb2312"))) + "&p6_Pcat=" + HttpUtility.UrlEncode(p6_Pcat, Encoding.GetEncoding("gb2312"))) + "&p7_Pdesc=" + HttpUtility.UrlEncode(p7_Pdesc, Encoding.GetEncoding("gb2312"))) + "&p8_Url=" + HttpUtility.UrlEncode(p8_Url, Encoding.GetEncoding("gb2312"))) + "&p9_SAF=" + p9_SAF) + "&pa_MP=" + HttpUtility.UrlEncode(pa_MP, Encoding.GetEncoding("gb2312"))) + "&pd_FrpId=" + pd_FrpId) + "&pm_Period=" + pm_Period) + "&pn_Unit=" + pn_Unit) + "&pr_NeedResponse=" + pr_NeedRespone) + "&hmac=" + Digest.HmacSign(aValue, keyValue));
        }