示例#1
0
        public void handleWXQrcodePayResultTest()
        {
            BCBill bill       = new BCBill(BCPay.PayChannel.WX_NATIVE.ToString(), 1, BCUtil.GetUUID(), "dotNet自来水");
            string respString = "{\"result_msg\":\"OK\",\"code_url\":\"weixin://wxpay/bizpayurl?pr=TtAYx12\",\"resultCode\":0,\"errMsg\":\"OK:\",\"err_detail\":\"\",\"result_code\":0,\"id\":\"99f2c898-56e7-451a-8984-f077e0688033\"}";
            BCBill actual     = BCPay.handlePayResult(respString, bill);

            Assert.IsNotNull(actual.id);
            Assert.IsNotNull(actual.codeURL);
        }
示例#2
0
        public void handleUNWebPayResultTest()
        {
            BCBill bill = new BCBill(BCPay.PayChannel.UN_WEB.ToString(), 1, BCUtil.GetUUID(), "dotNet自来水");

            bill.returnUrl = "http://localhost:50003/return_un_url.aspx";
            string respString = "{\"result_msg\":\"OK\",\"resultCode\":0,\"errMsg\":\"OK:\",\"err_detail\":\"\",\"result_code\":0,\"html\":\"<html><head><meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=UTF-8\\\"/></head><body><form id = \\\"pay_form\\\" action=\\\"https://gateway.95516.com/gateway/api/frontTransReq.do\\\" method=\\\"post\\\"><input type=\\\"hidden\\\" name=\\\"bizType\\\" id=\\\"bizType\\\" value=\\\"000201\\\"/><input type=\\\"hidden\\\" name=\\\"orderId\\\" id=\\\"orderId\\\" value=\\\"4c8ae26558b0415491fbf97e6023671c\\\"/><input type=\\\"hidden\\\" name=\\\"backUrl\\\" id=\\\"backUrl\\\" value=\\\"http://123.57.71.81:8080/1/pay/callback/UNWeb/c37d661d-7e61-49ea-96a5-68c34e83db3b/d020f6b8-b35f-41a3-b4a8-780846c03725\\\"/><input type=\\\"hidden\\\" name=\\\"txnSubType\\\" id=\\\"txnSubType\\\" value=\\\"01\\\"/><input type=\\\"hidden\\\" name=\\\"signature\\\" id=\\\"signature\\\" value=\\\"Qtc3jybIFV+SYRN2cXPvMx2qZN5hMP+5xr+6IafLID7PNUQamCRrpQ3quygRrm8kiRmpF5/ddwdiNmoLuCb91zkCs24pYZfAUB2TDPnWlgI8QQTyUfa0W8USybwSj1WTfvLpeOL4A2Eawgl35xPaxB4MslQGl2dilOc/MnT8RCn7+bo84XGeCcj+n4OXJvvZK+M7k5sBn1slEm+WqAuy95C8esrjnIRSjq0vc62z/zzhjrPXXE0MXVrUHBQTiKRUn9RwnAq24PzFVaalNQgFCJetXw2MZPQCIWedzQ6TwlyPE34aCOBf0ivtHGxhRhC7b2AG00xoFyHzkB5ArHlMVw==\\\"/><input type=\\\"hidden\\\" name=\\\"frontUrl\\\" id=\\\"frontUrl\\\" value=\\\"http://localhost:50003/return_un_url.aspx\\\"/><input type=\\\"hidden\\\" name=\\\"txnType\\\" id=\\\"txnType\\\" value=\\\"01\\\"/><input type=\\\"hidden\\\" name=\\\"channelType\\\" id=\\\"channelType\\\" value=\\\"08\\\"/><input type=\\\"hidden\\\" name=\\\"certId\\\" id=\\\"certId\\\" value=\\\"69363599447\\\"/><input type=\\\"hidden\\\" name=\\\"encoding\\\" id=\\\"encoding\\\" value=\\\"UTF-8\\\"/><input type=\\\"hidden\\\" name=\\\"version\\\" id=\\\"version\\\" value=\\\"5.0.0\\\"/><input type=\\\"hidden\\\" name=\\\"accessType\\\" id=\\\"accessType\\\" value=\\\"0\\\"/><input type=\\\"hidden\\\" name=\\\"txnTime\\\" id=\\\"txnTime\\\" value=\\\"20151222155314\\\"/><input type=\\\"hidden\\\" name=\\\"merId\\\" id=\\\"merId\\\" value=\\\"898320548160217\\\"/><input type=\\\"hidden\\\" name=\\\"currencyCode\\\" id=\\\"currencyCode\\\" value=\\\"156\\\"/><input type=\\\"hidden\\\" name=\\\"orderDesc\\\" id=\\\"orderDesc\\\" value=\\\"dotNet自来水\\\"/><input type=\\\"hidden\\\" name=\\\"txnAmt\\\" id=\\\"txnAmt\\\" value=\\\"1\\\"/><input type=\\\"hidden\\\" name=\\\"signMethod\\\" id=\\\"signMethod\\\" value=\\\"01\\\"/></form></body><script type=\\\"text/javascript\\\">document.all.pay_form.submit();</script></html>\",\"id\":\"d020f6b8-b35f-41a3-b4a8-780846c03725\"}";
            BCBill actual     = BCPay.handlePayResult(respString, bill);

            Assert.IsNotNull(actual.id);
            Assert.IsNotNull(actual.html);
        }
示例#3
0
        public void handleYeePayResultTest()
        {
            BCBill bill = new BCBill(BCPay.PayChannel.YEE_WEB.ToString(), 1, BCUtil.GetUUID(), "dotNet自来水");

            bill.returnUrl = "http://localhost:50003/return_yee_url.aspx";
            string respString = "{\"result_msg\":\"OK\",\"resultCode\":0,\"errMsg\":\"OK:\",\"err_detail\":\"\",\"result_code\":0,\"html\":\"<form name=\\\"yeepay\\\" action=\\\"https://www.yeepay.com/app-merchant-proxy/node\\\" method=\\\"POST\\\"><input type=\\\"hidden\\\" name=\\\"p4_Cur\\\" value=\\\"CNY\\\"/><input type=\\\"hidden\\\" name=\\\"p0_Cmd\\\" value=\\\"Buy\\\"/><input type=\\\"hidden\\\" name=\\\"p3_Amt\\\" value=\\\"0.01\\\"/><input type=\\\"hidden\\\" name=\\\"pa_MP\\\" value=\\\"c37d661d-7e61-49ea-96a5-68c34e83db3b%3A41695744-f7f7-4926-8eee-2d5dfb745af0\\\"/><input type=\\\"hidden\\\" name=\\\"p2_Order\\\" value=\\\"9572742753bf43298eef21a1579dc9c1\\\"/><input type=\\\"hidden\\\" name=\\\"p5_Pid\\\" value=\\\"dotNet%D7%D4%C0%B4%CB%AE\\\"/><input type=\\\"hidden\\\" name=\\\"hmac\\\" value=\\\"972dd9930d6e34d959886339b6a7f349\\\"/><input type=\\\"hidden\\\" name=\\\"p8_Url\\\" value=\\\"http%3A%2F%2Flocalhost%3A50003%2Freturn_yee_url.aspx\\\"/><input type=\\\"hidden\\\" name=\\\"p1_MerId\\\" value=\\\"10012506312\\\"/></form><script>document.yeepay.submit();</script>\",\"id\":\"41695744-f7f7-4926-8eee-2d5dfb745af0\",\"url\":\"https://www.yeepay.com/app-merchant-proxy/node?p4_Cur=CNY&p0_Cmd=Buy&p3_Amt=0.01&pa_MP=c37d661d-7e61-49ea-96a5-68c34e83db3b%3A41695744-f7f7-4926-8eee-2d5dfb745af0&p2_Order=9572742753bf43298eef21a1579dc9c1&p5_Pid=dotNet%D7%D4%C0%B4%CB%AE&hmac=972dd9930d6e34d959886339b6a7f349&p8_Url=http%3A%2F%2Flocalhost%3A50003%2Freturn_yee_url.aspx&p1_MerId=10012506312\"}";
            BCBill actual     = BCPay.handlePayResult(respString, bill);

            Assert.IsNotNull(actual.id);
            Assert.IsNotNull(actual.url);
        }
示例#4
0
        public void handleAliWebPayResultTest()
        {
            BCBill bill = new BCBill(BCPay.PayChannel.ALI_WEB.ToString(), 1, BCUtil.GetUUID(), "dotNet自来水");

            bill.returnUrl = "http://*****:*****@beecloud.cn\\\"/><input type=\\\"hidden\\\" name=\\\"subject\\\" value=\\\"dotNet自来水\\\"/><input type=\\\"hidden\\\" name=\\\"_input_charset\\\" value=\\\"utf-8\\\"/><input type=\\\"hidden\\\" name=\\\"sign\\\" value=\\\"6b69e7e8b890b0f2e5ba282028d583a3\\\"/><input type=\\\"hidden\\\" name=\\\"notify_url\\\" value=\\\"http://payservice.beecloud.cn/bcpay/aliPayDynamic/c37d661d-7e61-49ea-96a5-68c34e83db3b_06e5647b-f5f2-4697-aba9-e2bb05608aa8.php\\\"/><input type=\\\"hidden\\\" name=\\\"payment_type\\\" value=\\\"1\\\"/><input type=\\\"hidden\\\" name=\\\"out_trade_no\\\" value=\\\"64a054f5ae0841188f077172b54dedf9\\\"/><input type=\\\"hidden\\\" name=\\\"partner\\\" value=\\\"2088711322600312\\\"/><input type=\\\"hidden\\\" name=\\\"service\\\" value=\\\"create_direct_pay_by_user\\\"/><input type=\\\"hidden\\\" name=\\\"total_fee\\\" value=\\\"0.01\\\"/><input type=\\\"hidden\\\" name=\\\"return_url\\\" value=\\\"http://*****:*****@beecloud.cn&subject=dotNet自来水&_input_charset=utf-8&sign=6b69e7e8b890b0f2e5ba282028d583a3&notify_url=http://payservice.beecloud.cn/bcpay/aliPayDynamic/c37d661d-7e61-49ea-96a5-68c34e83db3b_06e5647b-f5f2-4697-aba9-e2bb05608aa8.php&payment_type=1&out_trade_no=64a054f5ae0841188f077172b54dedf9&partner=2088711322600312&service=create_direct_pay_by_user&total_fee=0.01&return_url=http://localhost:50003/return_ali_url.aspx&exter_invoke_ip=112.86.54.108&sign_type=MD5\"}";
            BCBill actual     = BCPay.handlePayResult(respString, bill);

            Assert.IsNotNull(actual.id);
            Assert.IsNotNull(actual.url);
            Assert.IsNotNull(actual.html);
        }
示例#5
0
        public void handleAliWapPayResultTest()
        {
            BCBill bill = new BCBill(BCPay.PayChannel.ALI_WAP.ToString(), 1, BCUtil.GetUUID(), "dotNet自来水");

            bill.returnUrl = "http://localhost:50003/return_ali_url.aspx";
            string respString = "{\"result_msg\":\"OK\",\"resultCode\":0,\"errMsg\":\"OK:\",\"err_detail\":\"\",\"result_code\":0,\"html\":\"<form id=\\\"alipaysubmit\\\" name=\\\"alipaysubmit\\\" action=\\\"https://mapi.alipay.com/gateway.do?_input_charset=utf-8\\\" method=\\\"get\\\"><input type=\\\"hidden\\\" name=\\\"payment_type\\\" value=\\\"1\\\"/><input type=\\\"hidden\\\" name=\\\"out_trade_no\\\" value=\\\"370e678e72d04d139d1e623453f9aa1a\\\"/><input type=\\\"hidden\\\" name=\\\"partner\\\" value=\\\"2088711322600312\\\"/><input type=\\\"hidden\\\" name=\\\"subject\\\" value=\\\"dotNet自来水\\\"/><input type=\\\"hidden\\\" name=\\\"_input_charset\\\" value=\\\"utf-8\\\"/><input type=\\\"hidden\\\" name=\\\"service\\\" value=\\\"alipay.wap.create.direct.pay.by.user\\\"/><input type=\\\"hidden\\\" name=\\\"total_fee\\\" value=\\\"0.01\\\"/><input type=\\\"hidden\\\" name=\\\"sign\\\" value=\\\"045d7ede0af92f78fd334b726f171465\\\"/><input type=\\\"hidden\\\" name=\\\"return_url\\\" value=\\\"http://localhost:50003/return_ali_url.aspx\\\"/><input type=\\\"hidden\\\" name=\\\"notify_url\\\" value=\\\"http://payservice.beecloud.cn/bcpay/aliPayDynamic/c37d661d-7e61-49ea-96a5-68c34e83db3b_d136a0ca-2be9-4ba7-b5e4-d8293e53bea1.php\\\"/><input type=\\\"hidden\\\" name=\\\"sign_type\\\" value=\\\"MD5\\\"/><input type=\\\"hidden\\\" name=\\\"seller_id\\\" value=\\\"2088711322600312\\\"/><input type=\\\"submit\\\" value=\\\"确认\\\" style=\\\"display:none;\\\"></form><script>document.forms['alipaysubmit'].submit();</script>\",\"id\":\"d136a0ca-2be9-4ba7-b5e4-d8293e53bea1\",\"url\":\"https://mapi.alipay.com/gateway.do?_input_charset=utf-8&payment_type=1&out_trade_no=370e678e72d04d139d1e623453f9aa1a&partner=2088711322600312&subject=dotNet自来水&_input_charset=utf-8&service=alipay.wap.create.direct.pay.by.user&total_fee=0.01&sign=045d7ede0af92f78fd334b726f171465&return_url=http://localhost:50003/return_ali_url.aspx&notify_url=http://payservice.beecloud.cn/bcpay/aliPayDynamic/c37d661d-7e61-49ea-96a5-68c34e83db3b_d136a0ca-2be9-4ba7-b5e4-d8293e53bea1.php&sign_type=MD5&seller_id=2088711322600312\"}";
            BCBill actual     = BCPay.handlePayResult(respString, bill);

            Assert.IsNotNull(actual.id);
            Assert.IsNotNull(actual.url);
            Assert.IsNotNull(actual.html);
        }
示例#6
0
        public void handleAliQrcodePayResultTest()
        {
            BCBill bill = new BCBill(BCPay.PayChannel.ALI_QRCODE.ToString(), 1, BCUtil.GetUUID(), "dotNet自来水");

            bill.qrPayMode = "0";
            bill.returnUrl = "http://*****:*****@beecloud.cn\\\"/><input type=\\\"hidden\\\" name=\\\"subject\\\" value=\\\"dotNet自来水\\\"/><input type=\\\"hidden\\\" name=\\\"_input_charset\\\" value=\\\"utf-8\\\"/><input type=\\\"hidden\\\" name=\\\"sign\\\" value=\\\"8216a45e51f576cfd6a38f8c8576663a\\\"/><input type=\\\"hidden\\\" name=\\\"notify_url\\\" value=\\\"http://payservice.beecloud.cn/bcpay/aliPayDynamic/c37d661d-7e61-49ea-96a5-68c34e83db3b_c4dee3ef-69a1-4cfc-8faa-32c0b0b7c4fc.php\\\"/><input type=\\\"hidden\\\" name=\\\"qr_pay_mode\\\" value=\\\"0\\\"/><input type=\\\"hidden\\\" name=\\\"payment_type\\\" value=\\\"1\\\"/><input type=\\\"hidden\\\" name=\\\"out_trade_no\\\" value=\\\"0548650a2b8e4a5bb2ee4bba56c6fb0c\\\"/><input type=\\\"hidden\\\" name=\\\"partner\\\" value=\\\"2088711322600312\\\"/><input type=\\\"hidden\\\" name=\\\"service\\\" value=\\\"create_direct_pay_by_user\\\"/><input type=\\\"hidden\\\" name=\\\"total_fee\\\" value=\\\"0.01\\\"/><input type=\\\"hidden\\\" name=\\\"return_url\\\" value=\\\"http://*****:*****@beecloud.cn&subject=dotNet自来水&_input_charset=utf-8&sign=8216a45e51f576cfd6a38f8c8576663a&notify_url=http://payservice.beecloud.cn/bcpay/aliPayDynamic/c37d661d-7e61-49ea-96a5-68c34e83db3b_c4dee3ef-69a1-4cfc-8faa-32c0b0b7c4fc.php&qr_pay_mode=0&payment_type=1&out_trade_no=0548650a2b8e4a5bb2ee4bba56c6fb0c&partner=2088711322600312&service=create_direct_pay_by_user&total_fee=0.01&return_url=http://localhost:50003/return_ali_url.aspx&exter_invoke_ip=112.86.54.108&sign_type=MD5\"}";
            BCBill actual     = BCPay.handlePayResult(respString, bill);

            Assert.IsNotNull(actual.id);
            Assert.IsNotNull(actual.url);
            Assert.IsNotNull(actual.html);
        }
示例#7
0
        public void handleJSAPIPayResultTest()
        {
            BCBill bill       = new BCBill(BCPay.PayChannel.WX_JSAPI.ToString(), 1, BCUtil.GetUUID(), "dotNet自来水");
            string respString = "{\"result_msg\":\"OK\",\"resultCode\":0,\"errMsg\":\"OK:\",\"err_detail\":\"\",\"result_code\":0,\"id\":\"41695744-f7f7-4926-8eee-2d5dfb745af0\",\"app_id\": \"wxa4ca6ed13385\",\"timestamp\": \"1450771041\", \"nonce_str\": \"znjsj7mw98q1drn251arrr30gq5gz0b1\", \"package\": \"prepay_id=wx20151222155721c70baa1e680187231678\", \"sign_type\": \"MD5\", \"pay_sign\": \"1E58DA3043C3D80AEC7A51B99E32\"}";
            BCBill actual     = BCPay.handlePayResult(respString, bill);

            Assert.IsNotNull(actual.id);
            Assert.IsNotNull(actual.timestamp);
            Assert.IsNotNull(actual.noncestr);
            Assert.IsNotNull(actual.package);
            Assert.IsNotNull(actual.paySign);
            Assert.IsNotNull(actual.signType);
        }