瀏覽代碼

修改支付回调地址为sp

lichunlei 1 年之前
父節點
當前提交
d8ef983e9b

+ 1 - 0
Areas/Api/Controllers/BaseController.cs

@@ -27,6 +27,7 @@ namespace MySystem.Areas.Api.Controllers
         public string ApiKey = "G6H7@J8%";
         public string Host = Library.ConfigurationManager.AppSettings["Host"].ToString();
         public string SourceHost = Library.ConfigurationManager.AppSettings["SourceHost"].ToString();
+        public string SpHost = Library.ConfigurationManager.AppSettings["SpHost"].ToString();
         public string OssHost = Library.ConfigurationManager.AppSettings["OssHost"].ToString();
         public string Database = Library.ConfigurationManager.AppSettings["Database"].ToString();
         public string defaultImage = Library.ConfigurationManager.AppSettings["Host"].ToString() + "/skin/app/default/static/images/header.png";

+ 2 - 2
Areas/Api/Controllers/v1/MainServer/ConsumerOrdersController.cs

@@ -297,7 +297,7 @@ namespace MySystem.Areas.Api.Controllers.v1
             maindb.SaveChanges();
             if (PayMode == 1)
             { 
-                string backString = new AlipayFunction(_accessor.HttpContext).CreateTrade(OrderNo, merchant.Name, PayMoney, openid, merchantAdd.AlipayAuthToken, SourceHost + "api/alipay/notice");
+                string backString = new AlipayFunction(_accessor.HttpContext).CreateTrade(OrderNo, merchant.Name, PayMoney, openid, merchantAdd.AlipayAuthToken, SpHost + "/api/alipay/notice");
                 JsonData obj = JsonMapper.ToObject(backString);
                 if (obj["alipay_trade_create_response"]["code"].ToString() == "10000")
                 {
@@ -318,7 +318,7 @@ namespace MySystem.Areas.Api.Controllers.v1
                 string Description = merchant.Name;
                 string OpenId = openid;
                 string Key = AppConfig.WeChatParam.AesGemKey;
-                string NotifyUrl = SourceHost + "/api/wechat/notice";
+                string NotifyUrl = SpHost + "/api/wechat/notice";
                 Dictionary<string, string> dic = new WeChatFunction(_accessor.HttpContext).Pay(SubMchId, PayMoney, OrderNo, Description, OpenId, Key, NotifyUrl, ActFlag);
                 Obj.Add("appId", dic["appId"]); //微信小程序appid
                 Obj.Add("timeStamp", dic["timeStamp"]); //时间戳

+ 1 - 0
appsettings.json

@@ -11,6 +11,7 @@
     "ConnectionStrings": "",
     "Host": "http://test.mpap.kexiaoshuang.com/",
     "SourceHost": "http://test.mpap.kexiaoshuang.com/",
+    "SpHost": "http://mpsp.kexiaoshuang.com/",
     "OssHost": "http://oss.qrcodeplate.com",
     "QrCodeHost": "http://test.mpap.kexiaoshuang.com/",
     "Database": "ApServer",