public void TestProperties()
        {
            string s1   = "MjY3MDk5NjMzMjE4|Aa/qpl2e+s6+kfKQY0H9rYQTbA6n0o1k/JlBTQezC81hXdIXjZLohIF1lOGTtC6q1luGeXrSHHxusCZdg5gHCz79gEQkdq4eHWN6aZPryu/DbvNv7jXVxnors+ZqFqJE2zeWp0Lr5Fu9S3zXl0w7unAxfz766Kltruy+4MXYKr4=|oIUNRpv1nzvfQQunMn70rG260iepVSeX8UmvVFxewcSjdiFPEoqP1LcMevlQBj+6wk8yKWtH8V3A51/JVgA4mWQoqYtaSrsne5wUN0wvb8ejbjgSiyu00wg3EDHSW+enaHNg399iPu+DQ929XVGyHvDYrpXqv3eZwROP+LKZ/2QR5zGZGqPYxiZu6N1rAyK4ZqZvabWLC6rlDLnmA23lXXL4eGhRixbKSmXuTJ7AsIsQbVEi5mkIMM5LIncQDVUqmYzLPNQHESv07WoWjzAb01dox1//kxzVj1k90p7uPaczkhjort48xdoasbqeixSMVA49oa52qgFkDPUTbxioOVdox1//kxzV47Uzt3uucC0ocl1rZ3TPEV0L7rqTMTY2m+KOz89IscKqR7zrrDujO+qPccNnwwSG0Os8Aeb0DoeVhiyjpWW4lrErBXrLWx/HdbHN9FH31ayW2PFVxfFzysochNP2S/1ONE1bx6WsJ2VaUoGP4ptUTzRr7QOQKKfDBUQ/uOZk3QD5MYUy/JQsgDfv2YNd17NV1zESRTLwDE5sxg+BeGVAytstx6xPeBveg0PdvV1Rsh6p8/RQBVIuVxlC4kYCUfMHjiqueqWn4ovuFnT3e1qzZJ10PfG44mwdJrLSNhTPc+fc32ObyDWV4pcRqHqTOVHC8wI895/+IwpvSnVFU1KXnyay0jYUz3PndSO7nNl7cLrZMDmrTpmgJyhv/Pz3Jma7XZEYHjzXrVUUb3uOJmyEgtLSb86Nxext5aZLdb2GG9vgDCZaa9izZZkHmP5I9erDrlU+4B4wiH0=";
            var    req1 = new TransactionNotificationRequest();

            req1.Load(s1);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 解析支付平台发送给商户平台的交易通知请求
        /// </summary>
        /// <param name="pCerFilePath">cer证书文件的路径</param>
        /// <param name="pEncryptedContent">支付平台发送过来的加密后的密文</param>
        /// <returns></returns>
        public static TransactionNotificationRequest ParseTransactionNotificationRequest(string pCerFilePath, string pEncryptedContent)
        {
            string decryptedContent            = PacketUtil.ParseRequestPackets(pCerFilePath, pEncryptedContent);
            TransactionNotificationRequest req = new TransactionNotificationRequest();

            req.Load(decryptedContent);
            return(req);
        }
        public void TestGetContent()
        {
            string strReq1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><upbp application=\"MTransNotify.Req\" version =\"1.0.0\" sendTime =\"20131226154125\" sendSeqId =\"13122615412589571\"><transType>01</transType><merchantId>630056832596</merchantId><merchantOrderId>dc10ae3119014d8180b9f8780398af45</merchantOrderId><merchantOrderAmt>1</merchantOrderAmt><settleDate>1226</settleDate><setlAmt>1</setlAmt><setlCurrency>156</setlCurrency><converRate>null</converRate><cupsQid>201312261540170019212</cupsQid><cupsTraceNum>001921</cupsTraceNum><cupsTraceTime>1226154017</cupsTraceTime><cupsRespCode>40</cupsRespCode><cupsRespDesc></cupsRespDesc></upbp>";
            TransactionNotificationRequest req1 = new TransactionNotificationRequest();

            req1.Load(strReq1);

            var strReq2 = req1.GetContent();

            Assert.IsTrue(strReq1.Replace(" ", string.Empty).Replace("\r\n", string.Empty) == strReq2.Replace(" ", string.Empty).Replace("\r\n", string.Empty));
        }
        public void TestProperties()
        {
            string strReq1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><upbp application=\"MTransNotify.Req\" version =\"1.0.0\" sendTime =\"20131226154125\" sendSeqId =\"13122615412589571\"><transType>01</transType><merchantId>630056832596</merchantId><merchantOrderId>dc10ae3119014d8180b9f8780398af45</merchantOrderId><merchantOrderAmt>1</merchantOrderAmt><settleDate>1226</settleDate><setlAmt>1</setlAmt><setlCurrency>156</setlCurrency><converRate>null</converRate><cupsQid>201312261540170019212</cupsQid><cupsTraceNum>001921</cupsTraceNum><cupsTraceTime>1226154017</cupsTraceTime><cupsRespCode>40</cupsRespCode><cupsRespDesc></cupsRespDesc></upbp>";
            TransactionNotificationRequest req1 = new TransactionNotificationRequest();

            req1.Load(strReq1);
            Assert.IsTrue(req1.ConverRate == null);
            Assert.IsTrue(req1.CupsQid == "201312261540170019212");
            Assert.IsTrue(req1.CupsRespCode == "40");
            Assert.IsTrue(req1.CupsRespDesc == string.Empty);
            Assert.IsTrue(req1.CupsTraceNum == "001921");
            Assert.IsTrue(req1.CupsTraceTime == "1226154017");
            Assert.IsTrue(req1.MerchantID == "630056832596");
            Assert.IsTrue(req1.MerchantOrderAmt == 1);
            Assert.IsTrue(req1.MerchantOrderID == "dc10ae3119014d8180b9f8780398af45");
            Assert.IsTrue(req1.SetlAmt == 1);
            Assert.IsTrue(req1.SetlCurrency == Currencys.RMB);
            Assert.IsTrue(req1.SettleDate == "1226");
            Assert.IsTrue(req1.TransType == WapTransTypes.Consumption);
        }