diff --git a/CustomerOnlineV2/CustomerOnlineV2.Business/Business/ThirdPartyAPI.cs b/CustomerOnlineV2/CustomerOnlineV2.Business/Business/ThirdPartyAPI.cs index e4d83c4..c1f0e63 100644 --- a/CustomerOnlineV2/CustomerOnlineV2.Business/Business/ThirdPartyAPI.cs +++ b/CustomerOnlineV2/CustomerOnlineV2.Business/Business/ThirdPartyAPI.cs @@ -1,4 +1,6 @@ -using CustomerOnlineV2.Common.Models; +using CustomerOnlineV2.Common.Helper; +using CustomerOnlineV2.Common.Models; +using Microsoft.Extensions.Configuration; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System.Net.Http.Headers; @@ -9,9 +11,11 @@ namespace CustomerOnlineV2.Business.Business public class ThirdPartyAPI { private static int timeOut = 100; - private string tp_base_url = "http://77.68.15.91:1083/api/v1/"; - private string apiAccessKey = "KPb1ttRs3CJnORpVU8SmAKUs7a42vtvjzQ47gU0b4u0vxAEI0PgZref6puzkVhLTX2PRNMGCbnb2TglupsjV5AGhYvw8a8POTcUcFSrEdHmTkhkIGNvUvxSpKjUOXGFQWaGU1bxoqqUSaFOmNE5zGojVmwPoMy38CNLwnpQKjdsIuxCKGCApa2gWHJl9gebmIpUODv9jAZgmMEaXqyR4CLg4iSksfTyYNjdqxEE88P5THYt5GuNk8Ti6K2RxIKfPWY49hBOpiYnXcApgSDiKFYqQG9WuZ7cvDGJIWg5WgWKjGle8Y3OydhONXVkN5OMPXDA4VZkK4c5nM363Zkg4w4qdzWuwhsEoAwU4rej6sMRZue3L0BowBJja1OK0iPoTX70EexX8rviMLOZPUDwhxzkL3eODS69VEEbjHb8WSjhho5h3KnCE4tcqCWihwSZ8Yuyhw1rzIMNw2C8pN1GEJyXc6goIFkf7dmK9ynJSxu52D9GjOkKqoD7dFNFulOFVfgeCuhPDYG2A2c2RSvGHv24VDXvmGVaAMLiPtsTz5oD8f0na7fX1xGg0Qveh0KgQL5THnrMK6gm5Ky7O8nbecIxY"; - + //private string tp_base_url = Common.Configs.ConfigurationManager.AppSettings["tp_base_url"]; + //private string apiAccessKey = Common.Configs.ConfigurationManager.AppSettings["apiAccessKey"]; + + private string tp_base_url = Utilities.ReadFromAppSettings("tp_base_url"); + private string apiAccessKey = Utilities.ReadFromAppSettings("apiAccessKey"); public ResponseModel ThirdPartyApiGetDataOnly(RequestModel model, string api_url, out APIJsonResponse jsonResponse, string MethodType = "post") { diff --git a/CustomerOnlineV2/CustomerOnlineV2.Common/Models/Notification/RestApiClient.cs b/CustomerOnlineV2/CustomerOnlineV2.Common/Models/Notification/RestApiClient.cs index d37c143..b53c43b 100644 --- a/CustomerOnlineV2/CustomerOnlineV2.Common/Models/Notification/RestApiClient.cs +++ b/CustomerOnlineV2/CustomerOnlineV2.Common/Models/Notification/RestApiClient.cs @@ -1,4 +1,5 @@ using CustomerOnlineV2.Common.Configs; +using CustomerOnlineV2.Common.Helper; using System; using System.Collections.Generic; using System.Linq; @@ -17,8 +18,8 @@ namespace CustomerOnlineV2.Common.Models.Notification //string authHeader = ConfigurationManager.AppSettings["ApiUser"].ToString() + ":" +ConfigurationManager.AppSettings["ApiPwd"].ToString(); //var plainTextBytes = Encoding.UTF8.GetBytes(authHeader); //string encodedAuthHeader = Convert.ToBase64String(plainTextBytes); - string thirdPartyUrl = "http://77.68.15.91:1083/api/v1/"; //ConfigurationManager.AppSettings["ThirdParty_Base_Url"].ToString(); - string apiAccessKey = "KPb1ttRs3CJnORpVU8SmAKUs7a42vtvjzQ47gU0b4u0vxAEI0PgZref6puzkVhLTX2PRNMGCbnb2TglupsjV5AGhYvw8a8POTcUcFSrEdHmTkhkIGNvUvxSpKjUOXGFQWaGU1bxoqqUSaFOmNE5zGojVmwPoMy38CNLwnpQKjdsIuxCKGCApa2gWHJl9gebmIpUODv9jAZgmMEaXqyR4CLg4iSksfTyYNjdqxEE88P5THYt5GuNk8Ti6K2RxIKfPWY49hBOpiYnXcApgSDiKFYqQG9WuZ7cvDGJIWg5WgWKjGle8Y3OydhONXVkN5OMPXDA4VZkK4c5nM363Zkg4w4qdzWuwhsEoAwU4rej6sMRZue3L0BowBJja1OK0iPoTX70EexX8rviMLOZPUDwhxzkL3eODS69VEEbjHb8WSjhho5h3KnCE4tcqCWihwSZ8Yuyhw1rzIMNw2C8pN1GEJyXc6goIFkf7dmK9ynJSxu52D9GjOkKqoD7dFNFulOFVfgeCuhPDYG2A2c2RSvGHv24VDXvmGVaAMLiPtsTz5oD8f0na7fX1xGg0Qveh0KgQL5THnrMK6gm5Ky7O8nbecIxY"; + string thirdPartyUrl = Utilities.ReadFromAppSettings("tp_base_url"); + string apiAccessKey = Utilities.ReadFromAppSettings("apiAccessKey"); var httpClient = new HttpClient(); httpClient.BaseAddress = new Uri(thirdPartyUrl); diff --git a/CustomerOnlineV2/CustomerOnlineV2/appsettings.json b/CustomerOnlineV2/CustomerOnlineV2/appsettings.json index f75ac92..e145826 100644 --- a/CustomerOnlineV2/CustomerOnlineV2/appsettings.json +++ b/CustomerOnlineV2/CustomerOnlineV2/appsettings.json @@ -50,7 +50,7 @@ ] }, "ConnectionStrings": { - "ApplicationDb": "Server=.;database=FastMoneyPro_Remit;uid=sa;password=123;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" + "ApplicationDb": "Server=77.68.15.91\\MSSQLSERVER01,1434;database=FastMoneyPro_Remit;uid=sa;password=DbAmin123;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" }, "JWT": { "ValidAudience": "@Ud!3nCH#3p0!Nc1", @@ -66,5 +66,7 @@ }, "AllowedHosts": "*", "SessionTimeOutInMinutes": "10", - "EncryptDecryptKey": "mH9Mjsi3VBOvk40YsCd1S8rm2vYFV7P6" + "EncryptDecryptKey": "mH9Mjsi3VBOvk40YsCd1S8rm2vYFV7P6", + "tp_base_url": "http://77.68.15.91:1083/api/v1/TP/", + "apiAccessKey": "KPb1ttRs3CJnORpVU8SmAKUs7a42vtvjzQ47gU0b4u0vxAEI0PgZref6puzkVhLTX2PRNMGCbnb2TglupsjV5AGhYvw8a8POTcUcFSrEdHmTkhkIGNvUvxSpKjUOXGFQWaGU1bxoqqUSaFOmNE5zGojVmwPoMy38CNLwnpQKjdsIuxCKGCApa2gWHJl9gebmIpUODv9jAZgmMEaXqyR4CLg4iSksfTyYNjdqxEE88P5THYt5GuNk8Ti6K2RxIKfPWY49hBOpiYnXcApgSDiKFYqQG9WuZ7cvDGJIWg5WgWKjGle8Y3OydhONXVkN5OMPXDA4VZkK4c5nM363Zkg4w4qdzWuwhsEoAwU4rej6sMRZue3L0BowBJja1OK0iPoTX70EexX8rviMLOZPUDwhxzkL3eODS69VEEbjHb8WSjhho5h3KnCE4tcqCWihwSZ8Yuyhw1rzIMNw2C8pN1GEJyXc6goIFkf7dmK9ynJSxu52D9GjOkKqoD7dFNFulOFVfgeCuhPDYG2A2c2RSvGHv24VDXvmGVaAMLiPtsTz5oD8f0na7fX1xGg0Qveh0KgQL5THnrMK6gm5Ky7O8nbecIxY" } \ No newline at end of file diff --git a/CustomerOnlineV2/CustomerOnlineV2/bin/Debug/net7.0/appsettings.json b/CustomerOnlineV2/CustomerOnlineV2/bin/Debug/net7.0/appsettings.json index f75ac92..e145826 100644 --- a/CustomerOnlineV2/CustomerOnlineV2/bin/Debug/net7.0/appsettings.json +++ b/CustomerOnlineV2/CustomerOnlineV2/bin/Debug/net7.0/appsettings.json @@ -50,7 +50,7 @@ ] }, "ConnectionStrings": { - "ApplicationDb": "Server=.;database=FastMoneyPro_Remit;uid=sa;password=123;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" + "ApplicationDb": "Server=77.68.15.91\\MSSQLSERVER01,1434;database=FastMoneyPro_Remit;uid=sa;password=DbAmin123;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" }, "JWT": { "ValidAudience": "@Ud!3nCH#3p0!Nc1", @@ -66,5 +66,7 @@ }, "AllowedHosts": "*", "SessionTimeOutInMinutes": "10", - "EncryptDecryptKey": "mH9Mjsi3VBOvk40YsCd1S8rm2vYFV7P6" + "EncryptDecryptKey": "mH9Mjsi3VBOvk40YsCd1S8rm2vYFV7P6", + "tp_base_url": "http://77.68.15.91:1083/api/v1/TP/", + "apiAccessKey": "KPb1ttRs3CJnORpVU8SmAKUs7a42vtvjzQ47gU0b4u0vxAEI0PgZref6puzkVhLTX2PRNMGCbnb2TglupsjV5AGhYvw8a8POTcUcFSrEdHmTkhkIGNvUvxSpKjUOXGFQWaGU1bxoqqUSaFOmNE5zGojVmwPoMy38CNLwnpQKjdsIuxCKGCApa2gWHJl9gebmIpUODv9jAZgmMEaXqyR4CLg4iSksfTyYNjdqxEE88P5THYt5GuNk8Ti6K2RxIKfPWY49hBOpiYnXcApgSDiKFYqQG9WuZ7cvDGJIWg5WgWKjGle8Y3OydhONXVkN5OMPXDA4VZkK4c5nM363Zkg4w4qdzWuwhsEoAwU4rej6sMRZue3L0BowBJja1OK0iPoTX70EexX8rviMLOZPUDwhxzkL3eODS69VEEbjHb8WSjhho5h3KnCE4tcqCWihwSZ8Yuyhw1rzIMNw2C8pN1GEJyXc6goIFkf7dmK9ynJSxu52D9GjOkKqoD7dFNFulOFVfgeCuhPDYG2A2c2RSvGHv24VDXvmGVaAMLiPtsTz5oD8f0na7fX1xGg0Qveh0KgQL5THnrMK6gm5Ky7O8nbecIxY" } \ No newline at end of file