Rome Online White Labelling.

This commit is contained in:
Patrick Fic
2023-02-24 15:51:37 -08:00
parent 90202e2d3c
commit 86fc13ce7f
66 changed files with 173 additions and 229 deletions

View File

@@ -8,12 +8,12 @@ using System.Xml.Linq;
using Newtonsoft;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using BodyshopPartner.Models;
using RomeOnlinePartner.Models;
using ToastNotifications.Messages;
using System.Threading;
using System.Reflection;
namespace BodyshopPartner.Utils
namespace RomeOnlinePartner.Utils
{
public static class HTTPServer
{
@@ -29,7 +29,7 @@ namespace BodyshopPartner.Utils
//QuickBooks Execution Routes.
Route.Add("/qb/", (req, res, props) =>
{
hlog("Received a QuickBooks request from ImEX.online");
hlog("Received a QuickBooks request from Rome Online");
res.WithCORS();
res.Close();
}, "OPTIONS");
@@ -41,7 +41,7 @@ namespace BodyshopPartner.Utils
//Pinging based routes.
Route.Add("/ping/", (req, res, props) =>
{
hlog("Received a ping from ImEX.online");
hlog("Received a ping from Rome Online");
res.WithCORS();
res.Close();
}, "OPTIONS");
@@ -52,7 +52,7 @@ namespace BodyshopPartner.Utils
//FileScanning Routes
Route.Add("/scan/", (req, res, props) =>
{
hlog("Received a scan request from ImEX.online");
hlog("Received a scan request from Rome Online");
res.WithCORS();
res.Close();
}, "OPTIONS");
@@ -61,7 +61,7 @@ namespace BodyshopPartner.Utils
, "POST");
Route.Add("/import/", (req, res, props) =>
{
hlog("Received an import request from ImEX.online");
hlog("Received an import request from Rome Online");
res.WithCORS();
res.Close();
}, "OPTIONS");
@@ -71,7 +71,7 @@ namespace BodyshopPartner.Utils
Route.Add("/oec/", (req, res, props) =>
{
hlog("Received an OEC from ImEX.online");
hlog("Received an OEC from Rome Online");
res.WithCORS();
res.Close();
}, "OPTIONS");
@@ -108,17 +108,17 @@ namespace BodyshopPartner.Utils
hlog = HttpLogger;
try
{
hlog("ImEX Online connection server starting...");
hlog("Rome Online connection server starting...");
HttpServer.ListenAsync(1337, token, Route.OnHttpRequestAsync).Wait();
}
catch (Exception Ex)
{
logger.Fatal("Unable to start HTTP server. " + Ex.ToString());
hlog("ImEX Online connection server could not start. Please restart the partner to try again.");
hlog("Rome Online connection server could not start. Please restart the partner to try again.");
App.Current.Dispatcher.Invoke(() =>
{
string msg = "Unable to connect to ImEX Online Web App. Please ensure your firewall allows the connection.";
string msg = "Unable to connect to Rome Online Web App. Please ensure your firewall allows the connection.";
Utils.Notifications.notifier.ShowError(msg);
});
Utils.SquirrelAwareHelper.AddHttpExcetion();
@@ -166,7 +166,7 @@ namespace BodyshopPartner.Utils
{
try
{
hlog("Processing QuickBooks request. ImEX Online Record ID:" + request.Id);
hlog("Processing QuickBooks request. Rome Online Record ID:" + request.Id);
XDocument response = XDocument.Parse(QuickBooksInterop.ProcessQBXmlRequestUnManaged(request.QbXML));
QbXmlResponse ResponseStatus = QuickBooksInterop.ParseResponseXml(response);