Browse Source

feat:增加移动支付查询交易

zhengjie 1 năm trước cách đây
mục cha
commit
3e97dcf60c
2 tập tin đã thay đổi với 33 bổ sung16 xóa
  1. 26 16
      Business/MobilePay.cs
  2. 7 0
      InsuBusiness.cs

+ 26 - 16
Business/MobilePay.cs

@@ -193,25 +193,11 @@ namespace PTMedicalInsurance.Business
         }
         public int MobilePayConfirmSettlement(out string outPar)
         {
-            string errMsg, M6301Inpar;
             outPar = "";
             try
             {
-                //EncryptHelper eh = new EncryptHelper();
-                //6301查询具体明细信息
-                if (Get6301Inpar(out errMsg) != 0)
-                {
-                    outPar = errMsg;
-                    return -1;
-                }
-                M6301Inpar = errMsg;
-                JObject joM6301Rtn = invoker.invokeMPService("6301", M6301Inpar);
-                if (JsonHelper.parseMPRtnValue(joM6301Rtn, out errMsg) != 0)
-                {
-                    outPar = errMsg;
-                    return -1;
-                }
-                JObject joEncData = JObject.Parse((errMsg));
+                PayStatusQuery(out outPar);
+                JObject joEncData = JObject.Parse((outPar));
                 string setlInfo = JsonHelper.getDestValue(joEncData, "extData.SETLINFO");
                 if (string.IsNullOrEmpty(setlInfo))
                 {
@@ -231,6 +217,30 @@ namespace PTMedicalInsurance.Business
             }
         }
 
+        /// <summary>
+        /// 查询交易状态
+        /// </summary>
+        /// <param name="outPar"></param>
+        /// <returns></returns>
+        public int PayStatusQuery(out string outPar)
+        {
+            string errMsg, M6301Inpar;
+            if (Get6301Inpar(out errMsg) != 0)
+            {
+                outPar = errMsg;
+                return -1;
+            }
+            M6301Inpar = errMsg;
+            JObject joM6301Rtn = invoker.invokeMPService("6301", M6301Inpar);
+            if (JsonHelper.parseMPRtnValue(joM6301Rtn, out errMsg) != 0)
+            {
+                outPar = errMsg;
+                return -1;
+            }
+            outPar = errMsg;
+            return 0;
+        }
+
         public int ConfirmResult(JObject data, out string outPar)
         {
             string errMsg = "";

+ 7 - 0
InsuBusiness.cs

@@ -1196,6 +1196,13 @@ namespace PTMedicalInsurance
                                 rtnResult = outParam;
                             return rtnResult;
                         }
+                    case "M6Q": //移动支付查询
+                        {
+                            MobilePay mp = new MobilePay(InParam, out errMsg);
+                            mp.PayStatusQuery(out outParam);
+                            rtnResult = outParam;
+                            return rtnResult;
+                        }
                     case "M6Confirm"://门诊移动支付确认
                         {
                             MobilePay mp = new MobilePay(InParam, out errMsg);