Notify complete from Piscal to LeafWeb

This commit is contained in:
2016-05-04 12:12:35 -04:00
parent e9a9ae186c
commit e0788154ec
5 changed files with 23 additions and 7 deletions
+10 -1
View File
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Configuration;
using LeafWeb.Core.Entities;
using LeafWeb.Core.Remote;
@@ -11,10 +12,14 @@ namespace LeafWeb.Web.Services.PiscalQueue
public class PiscalService
{
private readonly IPiscalClient _piscalClient;
private readonly string _notifyCompleteUrl;
public PiscalService(IPiscalClient piscalClient)
{
_piscalClient = piscalClient;
_notifyCompleteUrl =
ConfigurationManager.AppSettings["LeafWebUrl"] +
ConfigurationManager.AppSettings["PiscalNotifyCompleteUrlPath"];
}
public PiscalService() : this(new PiscalSshClient(ConfigurationManager.ConnectionStrings["PiscalServer"].ConnectionString))
@@ -24,6 +29,10 @@ namespace LeafWeb.Web.Services.PiscalQueue
public void Run(LeafInput leafInput)
{
var inputFile = new PiscalLeafInput(leafInput);
if (!string.IsNullOrEmpty(_notifyCompleteUrl))
inputFile.NotifyCompleteUrl = _notifyCompleteUrl;
// TODO: remove this, just for testing
if (string.Equals(leafInput.Email, "james.kolpack@gmail.com", StringComparison.InvariantCultureIgnoreCase))
inputFile.SuppressStorageCopy = true;